Question
Step 4: Hypothesis Test for the Population Mean (II) A team averaging 110 points is likely to do very well during the regular season. The
Step 4: Hypothesis Test for the Population Mean (II)
A team averaging 110 points is likely to do very well during the regular season. The coach of your team has hypothesized that your team scored at an average of less than 110 points in the years 2013-2015. Test this claim at a 1% level of significance. For this test, assume that the population standard deviation for relative skill level is unknown.
You are to write this code block yourself.
Use Step 3 to help you write this code block. Here is some information that will help you write this code block. Reach out to your instructor if you need help.
- The dataframe for your team is called your_team_df.
- The variable 'pts' represents the points scored by your team.
- Calculate and print the mean points scored by your team during the years you picked.
- Identify the mean score under the null hypothesis. You only have to identify this value and do not have to print it.(Hint: this is given in the problem statement)
- Assuming that the population standard deviation is unknown, use Python methods to carry out the hypothesis test.
- Calculate and print the test statistic rounded to two decimal places.
- Calculate and print the P-value rounded to four decimal places.
Write your code in the code block section below. After you are done, click this block of code and hit theRunbutton above. Reach out to your instructor if you need more help with this step.
In[6]:
I received a name error code, can you lead me to what might be the name error code?
from scipy.stats import ttest_1samp import numpy as np mean_pts = your_team_df['elo_n'].mean() print("Mean Points =",mean_pts) tstat, pval = ttest_1samp(your_team_df['pts'], 110) print('T Stat = %.2f, P Value = %.4f' % (tstat, pval)) if pval < 0.01: print("Reject the null hypothesis") else: print("Accept the null hypothesis") --------------------------------------------------------------------------- NameError Traceback (most recent call last)-6-6ee83b0642e2> in <module> 1 from scipy.stats import ttest_1samp 2 import numpy as np ----> 3 mean_pts = your_team_df['elo_n'].mean() 4 print("Mean Points =",mean_pts) 5 tstat, pval = ttest_1samp(your_team_df['pts'], 110) NameError: name 'your_team_df' is not defined
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