Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Step 8: Confidence Intervals for the Average Relative Skill of All Teams in Your Team's Years The management wants to you to calculate a 95%
Step 8: Confidence Intervals for the Average Relative Skill of All Teams in Your Team's Years The management wants to you to calculate a 95% confidence interval for the average relative skill of all teams in 2013-2015. You will use the variable 'elo_n' to respresent the relative skill of the teams. To construct a confidence interval, you will need the mean and standard error of the relative skill level in these years. The code block below calculates the mean and the standard deviation. Your edits will calculate the standard error and the confidence interval. Make the following edits to the code block below: 1. Replace ??SD_VARIABLE?? with the variable name representing the standard deviation of relative skill of all teams from your years. (Hint: the standard deviation variable is in the code block below) 2. Replace ??CL?? with the confidence level of the confidence interval. 3. Replace ??MEAN_VARIABLE?? with the variable name representing the mean relative skill of all teams from your years. (Hint: the mean variable is in the code block below) 4. Replace ??SE_VARIABLE?? with the variable name representing the standard error. (Hint: the standard error variable is in the code block below) The management also wants you to calculate the probability that a team in the league has a relative skill level less than that of the team that you picked. Assuming that the relative skill of teams is Normally distributed, Python methods for a Normal distribution can be used to answer this question. The code block below uses two of these Python methods. Your task is to identify the correct Python method and report the probability. After you are done with your edits, click the block of code below and hit the Run button above. In [16]: print("Confidence Interval for Average Relative Skill in the years 2013 to 2015") print (" - - - - # Mean relative skill of all teams from the years 2013-2015 mean = your_years_leagues_df ['elo_n' ]. mean() # Standard deviation of the relative skill of all teams from the years 2013-2015 stdev = your_years_leagues_df [ 'elo_n' ]. std( ) n = len(your_years_leagues_df) #Confidence interval ---- TODO: make your edits here - --- stderr = stdev / (n ** 0.5) conf_int_95 = st. norm. interval (0.95, mean, stderr) print ("95% confidence interval (unrounded) for Average Relative Skill (ELO) in the years 2013 to 2015 =", conf_int_95) print("95% confidence interval (rounded) for Average Relative Skill (ELO) in the years 2013 to 2015 = (", round(conf_int_95[0], 2), ",", round (conf_int_95 [1], 2), ")") print ("\ ") print("Probability a team has Average Relative Skill LESS than the Average Relative Skill (ELO) of your team in the years 2013 t 0 2015") print (" - - mean_elo_your_team = your_team_df ['elo_n' ]. mean( ) choice1 = st. norm. sf(mean_elo_your_team, mean, stdev) choice2 = st. norm. cdf(mean_elo_your_team, mean, stdev) # Pick the correct answer. print("Which of the two choices is correct?") print ("Choice 1 =", round(choice1, 4) ) print ( "Choice ? =". round (choice).4)) Confidence Interval for Average Relative Skill in the years 2013 to 2015 95% confidence interval (unrounded) for Average Relative Skill (ELO) in the years 2013 to 2015 = (1502. 0236894390478, 1507.1824 625533618) 95% confidence interval (rounded) for Average Relative Skill (ELO) in the years 2013 to 2015 = ( 1502.02 , 1507.18 ) Probability a team has Average Relative Skill LESS than the Average Relative Skill (ELO) of your team in the years 2013 to 2015 Which of the two choices is correct? Choice 1 = 0.4214 Choice 2 = 0.5786
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