Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3.14 LAB: One-sample hypothesis test for population proportion Load the gpa.csv data set. Find the number of students with a gpa greater than the user
3.14 LAB: One-sample hypothesis test for population proportion Load the gpa.csv data set. Find the number of students with a gpa greater than the user input value. Find the total number of students. Perform a z-test for the user input expected proportion. Determine if the hypothesis that the actual proportion is different from the expected proportion should be rejected at the alpha = 0.01 significance level. Ex: When the input is: 0.5 3.0 the ouput is: (-0.16909988539863083, 0. 8657180750703445) The two-tailed p-value, 0. 8657180750703445 , is greater than than o. Thus, insufficient evidence exists to support the hypothesis that the proportion is different from 0.5 420709.2940102.qxxazgy7 LAB ACTIVITY 3.14.1: LAB: One-sample hypothesis test for population proportion 0/3 main.py Load default template... # Import the correct modules import pandas as pd import statsmodels . stats. weightstats as ztest from statsmodels. stats. proportion import proportions_ztest # Read in gpa. CSV 7 gpadf = pd. read_cav("gpa. cav") # Code to read in data set 8 9 #bring in inputs 10 value = float(input() ) 11 cutoff = float (input()) 12 13 #section out the gpa column 14 gpacolumn = gpadf [*gpa' ] 15 16 # Determine the number of students with a goa higher than cutoff counts = gpacolumn [gpacolumn>cutoff] . count() # Code to count number of students with gpo > cutoff 18 19 # Determine the total number of students 20 nobs = gpacolumn. count() # Code to count total number of students 21 22 # Perform z-test for counts, nobs, and value 23 ztest = (proportions_ztest (counts, nobs, value, prop_var = value) ) # Code to perform z-test print (ztest) 25 # Determine the correct conclusion 27 if ztest [1]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started