4 3.10 LAB: One-sample hypothesis test for population proportion The gpa dataset is a toy dataset...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4 3.10 LAB: One-sample hypothesis test for population proportion The gpa dataset is a toy dataset containing the features height and gpa for 35 students. Use the statsmodels function proportions_ztest and the user defined values for the proportion for the null hypothesis value and the gpa cutoff cutoff to perform the following tasks: • Load the gpa.csv data set. • Find the number of students with a gpa greater than cutoff. . 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 2.0 the ouput is (4.902, 0.000) The two-tailed p-value, 0.000, is less than a. Thus, sufficient evidence exists to support the hypothesis that the proportion is different from 0.5 4360102236122qmay LAB ACTIVITY 3.10.1: One-sample hypothesis test for population proportion 1 import statsmodels.stats as st 2 from statsmodels.stats.proportion import proportions_ztest 3 import pandas as pd 4 5 # Read in gpa.csv 6 gpa = # Your code here 7 3 # Get the value of the proportion for the null hypothesis 9 value float(input()) 10 # Get the gpa cutoff 11 cutoff- float(input ()) 12 13 # Determine the number of students with a gpa higher than cutoff 14 counts Your code here 15 16 # Determine the total number of students 17 nobs # Your code here 18 19 # Perform z-test for counts, nobs, and value 20 ztest = # Your code here 21 print("(", end-"") 22 print("%.3f % ztest[0] +", ", end="") 23 print('%.3f % ztest[1] + ")") 24 25 26 if ztest[1] < 0.01: 27 28 main.py 29 else: 30 peint("The two-tolled c-uslus print("The two-tailed p-value, ", end-"") print('%.3f % ztest[1] +", is less than \u0381. Thus, sufficient evidence exists to support the hypothesis that W and-"") 1/3 Load default template.. 1 import statsmodels.stats as st 2 from statsmodels.stats.proportion import proportions_ztest 3 import pandas as pd 4 5 # Read in gpa.csv 6 gpa = # Your code here 7 8 # Get the value of the proportion for the null hypothesis 9 value = float(input()) 10 # Get the gpa cutoff 11 cutoff = float(input()) main.py 12 13 # Determine the number of students with a gpa higher than cutoff 14 counts = # Your code here 15 16 Determine the total number of students 17 nobs = # Your code here 18 19 # Perform z-test for counts, nobs, and value 20 ztest = # Your code here 21 print("(", end="") 22 print('%.3f' % ztest [0] + ",", end="") 23 print("%.3f % ztest[1] + ")") 24 25 26 if ztest[1] < 0.01: 27 28 29 else: 30 31 Load default template... print("The two-tailed p-value, ", end="") print("%.3f' % ztest[1] + ", is less than \u03B1. Thus, sufficient evidence exists to support the hypothesis that Whon donn print("The two-tailed p-value, ", end="") print('%.3f % ztest [1] + ", is greater than u03B1. Thus, insufficient evidence exists to support the hypothesis the ouput is. (4.902, 0.000) The two-tailed p-value, 0.000, is less than a. Thus, sufficient evidence exists to support the hypothesis that the proportion is different from 0.5 LAB ACTIVITY 1 2 tions_ztest 3 4 S 6 7 8 hypothesis 10 11 12 13 igher than cutoff 14 15 16 17 18 19 20 21 3.10.1 One-sample hypothesis test for population proportion 22 23 24 25 26 main.py Load default template... 27 28 u03B1. Thus, sufficient evidence exists to support the hypothesis that the proportion is different from", value) 2.9 1/3 30 31 n \u93B1. Thus, insufficient evidence exists to support the hypothesis that the proportion is different from", value) I 4 3.10 LAB: One-sample hypothesis test for population proportion The gpa dataset is a toy dataset containing the features height and gpa for 35 students. Use the statsmodels function proportions_ztest and the user defined values for the proportion for the null hypothesis value and the gpa cutoff cutoff to perform the following tasks: • Load the gpa.csv data set. • Find the number of students with a gpa greater than cutoff. . 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 2.0 the ouput is (4.902, 0.000) The two-tailed p-value, 0.000, is less than a. Thus, sufficient evidence exists to support the hypothesis that the proportion is different from 0.5 4360102236122qmay LAB ACTIVITY 3.10.1: One-sample hypothesis test for population proportion 1 import statsmodels.stats as st 2 from statsmodels.stats.proportion import proportions_ztest 3 import pandas as pd 4 5 # Read in gpa.csv 6 gpa = # Your code here 7 3 # Get the value of the proportion for the null hypothesis 9 value float(input()) 10 # Get the gpa cutoff 11 cutoff- float(input ()) 12 13 # Determine the number of students with a gpa higher than cutoff 14 counts Your code here 15 16 # Determine the total number of students 17 nobs # Your code here 18 19 # Perform z-test for counts, nobs, and value 20 ztest = # Your code here 21 print("(", end-"") 22 print("%.3f % ztest[0] +", ", end="") 23 print('%.3f % ztest[1] + ")") 24 25 26 if ztest[1] < 0.01: 27 28 main.py 29 else: 30 peint("The two-tolled c-uslus print("The two-tailed p-value, ", end-"") print('%.3f % ztest[1] +", is less than \u0381. Thus, sufficient evidence exists to support the hypothesis that W and-"") 1/3 Load default template.. 1 import statsmodels.stats as st 2 from statsmodels.stats.proportion import proportions_ztest 3 import pandas as pd 4 5 # Read in gpa.csv 6 gpa = # Your code here 7 8 # Get the value of the proportion for the null hypothesis 9 value = float(input()) 10 # Get the gpa cutoff 11 cutoff = float(input()) main.py 12 13 # Determine the number of students with a gpa higher than cutoff 14 counts = # Your code here 15 16 Determine the total number of students 17 nobs = # Your code here 18 19 # Perform z-test for counts, nobs, and value 20 ztest = # Your code here 21 print("(", end="") 22 print('%.3f' % ztest [0] + ",", end="") 23 print("%.3f % ztest[1] + ")") 24 25 26 if ztest[1] < 0.01: 27 28 29 else: 30 31 Load default template... print("The two-tailed p-value, ", end="") print("%.3f' % ztest[1] + ", is less than \u03B1. Thus, sufficient evidence exists to support the hypothesis that Whon donn print("The two-tailed p-value, ", end="") print('%.3f % ztest [1] + ", is greater than u03B1. Thus, insufficient evidence exists to support the hypothesis the ouput is. (4.902, 0.000) The two-tailed p-value, 0.000, is less than a. Thus, sufficient evidence exists to support the hypothesis that the proportion is different from 0.5 LAB ACTIVITY 1 2 tions_ztest 3 4 S 6 7 8 hypothesis 10 11 12 13 igher than cutoff 14 15 16 17 18 19 20 21 3.10.1 One-sample hypothesis test for population proportion 22 23 24 25 26 main.py Load default template... 27 28 u03B1. Thus, sufficient evidence exists to support the hypothesis that the proportion is different from", value) 2.9 1/3 30 31 n \u93B1. Thus, insufficient evidence exists to support the hypothesis that the proportion is different from", value) I
Expert Answer:
Answer rating: 100% (QA)
import statsmodelsstats as st from statsmodelsstatsproportion import proportionsztest import p... View the full answer
Related Book For
Statistics Unlocking The Power Of Data
ISBN: 9780470601877
1st Edition
Authors: Robin H. Lock, Patti Frazer Lock, Kari Lock Morgan, Eric F. Lock, Dennis F. Lock
Posted Date:
Students also viewed these programming questions
-
If you deposit $1,500 at 7.59% annual interest rate, in how many years will the money in the bank account reach $6,800? (The answer may NOT be a whole number.) Round your answer to TWO decimal places.
-
An all-equity firm has 1 million shares currently priced at $76 per share. The firm is considering issuing $28 million of permanent debt and using the proceeds to repurchase shares. The tax rate is...
-
Basic Hotel Offers Rooms For Guests But Has No Restaurant, Room Service Or Gift Shop. Friendly Sandwiches Is Small Take-Out Restaurant Located Next Door. Would Each Item Listed Be More Likely To...
-
Please answer all questions from 1 to 12 4. Work-Power-Energy 7. A body of mass m, accelerates uniformly from rest to v, in time t,, The instantaneous power delivered to the body as a function of...
-
Suppose that a sphere with a single stagnation hole is to be used as a velocimeter. The pressure at this hole is used to compute the stream velocity U, but there are errors if the stream is not...
-
Professor Bailey has just completed writing the final examination for his course in advanced engineering mathematics. This examination has 12 questions, whose total value is to be 200 points. In how...
-
Air-fuel ratio in petrol engine is controlled by (a) fuel pump (b) injector (c) controller (d) carburettor
-
1. What does the position of enterprise architect entail? What qualifications or experiences would you think a good enterprise architect should have? Support your answer with examples from the case....
-
At January 1, 2024, Caf Med leased restaurant equipment from Crescent Corporation under a nine-year lease agreement. The lease agreement specifies annual payments of $26,000 beginning January 1,...
-
A new edition of a very popular textbook will be published a year from now. The publisher currently has 1,000 copies on hand and is deciding whether to do another printing before the new edition...
-
11. For each pair of objects in the table below, estimate the ratio of the distance between the objects to their size. Obtain the distances for your estimates from the order of magnitude tool shown...
-
Compare the major antitrust acts of the United States. Specify the intent and purpose of each, and draw conclusions about their effectiveness.?
-
How does lean production facilitate effective communication and collaboration across departments?
-
Please answer these questions in SQL statements. The logical model is provided, please answer with SQL statements based on this logical model. Q1 List all endorsements held by pilots where the...
-
Peter, who has a mass of 80 Kg is skateboarding at 5 m/s when he smacks into a brick wall and comes to a dead stop in 0.25 sec. What is his acceleration? What is the force acting on him?
-
What is the maximal static friction that can be created by an object that has a weight of 104 N and a static coefficent of 1.72? Answer to two decimal places
-
Consider a 32% efficient 600 MW power plant burning 10,000 Btu/lb coal containing 60% carbon and 2% sulfur by mass ta) What is the rate of sulfur production at the power plant in lbs S/hr? (b)...
-
The tractor is used to lift the 150-kg load B with the 24-mlong rope, boom, and pulley system. If the tractor travels to the right at a constant speed of 4 m/s, determine the tension in the rope when...
-
In the survey of 2255 US adults described in Exercise 6.39, we also learn that 970 of the respondents use the social networking site Facebook. Of the 970 Facebook users, the survey shows that on an...
-
Find P(X is an even number). Refer to the probability function given in Table 11.10 for a random variable X that takes on the values 1, 2, 3, and 4. Table 11.10 2 4 3 0.1 P(x) 0.2 0.4 0.3
-
The population is all people who visit the website CNN.com. All visitors to the website are invited to take part in the daily online poll. State whether or not the sampling method described produces...
-
What is the value of Brunei Petroleum Companys preferred stock when the dividend rate is 18 percent on a $100 par value? The appropriate discount rate for a stock of this risk level is 14 percent.
-
The preferred stock of the Luxemburg Mining Corporation pays a $3.25 dividend. What is the value of the stock if your required rate of return is 8 percent?
-
You are considering an investment in one of the preferred stocks of either Longines Watch Company or Titoni Watch Company. Longiness preferred stock pays an annual dividend of \($2.73,\) while that...
Study smarter with the SolutionInn App