Question: I need help with steps 4 through 6 Hero x Project Two Jupyter Script * G Step 4: Hypothesis Test for the Pc x C
I need help with steps 4 through 6






Hero x Project Two Jupyter Script * G Step 4: Hypothesis Test for the Pc x C NEED HELP WRITING THE CODE x M Inbox (29) - kyleborgailo@gmail x + ownloads/Project%20Two%20Jupyter%20Script.html Resource... SP STEM | science | IT... DG Object Oriented Pr... 1 My orders Metal Gear Solid 1... Apporto | App and. Oop assignment | I.. Calorie Calculator -.. 2019 Form 8962 Order Nationally | C.. Shop 1 test_statistic, p_value = proportions_ztest (??|COUNT_VAR? ?], ??NOBS_VAR??], ??NULL_HYPOTHESIS_VALUE??) print ("Hypothesis Test for the Population Proportion") print ("Test Statistic =", round(test_statistic, 2)) print ("P-value =", round(p_value, 4)) Step 6: Hypothesis Test for the Difference Between Two Population Means The management of your team wants to compare the team with the assigned team (the Bulls in 1996-1998). They claim that the skill level of your team in 2013- 2015 is the same as the skill level of the Bulls in 1996 to 1998. In other words, the mean relative skill level of your team in 2013 to 2015 is the same as the mean relative skill level of the Bulls in 1996-1998. Test this claim using a 1% level of significance. Assume that the population standard deviation is unknown. Make the following edits to the code block below: 1. Replace ??DATAFRAME_ASSIGNED_TEAM?? with the name of assigned team's dataframe. See Step 1 for the name of assigned team's dataframe . Replace ??DATAFRAME_YOUR_TEAM?? with the name of your team's dataframe See Step 2 for the name of your team's dataframe- 1. Replace ??RELATIVE_SKILL?? with the name of the variable for relative skill. See the table included in Project Two instructions above to pick the variable name. Enclose this variable in single quotes. For example, if the variable name is var2 then replace ??RELATIVE_SKILL?? with "var2' After you are done with your edits, click the block of code below and hit the Run button above. In [ ]: import scipy . stats as st mean_elo_n_project_team = assigned_team_df[ 'elo_n' ] . mean( ) print ("Mean Relative Skill of the assigned team in the years 1996 to 1998 =", round(mean_elo_n_project_team, 2) ) mean_elo_n_your_team = your_team_df [ 'elo_n' ]. mean( ) print ("Mean Relative Skill of your team in the years 2013 to 2015 =", round (mean_elo_n_your_team, 2) ) # Hypothesis Test # ---- TODO: make your edits here -- -- test_statistic, p_value = st. ttest_ind(??DATAFRAME_ASSIGNED_TEAM??|[? ?|RELATIVE_SKILL??]], ??DATAFRAME_YOUR_TEAM? ?) [2?RELATIVE_SKI LL ? ? ]) print ("Hypothesis Test for the Difference Between Two Population Means") print("Test , round(test_statistic, 2)) print ("P-value =", round(p_value, 4) ) End of Project Two Download the HTML output and submit it with your summary report for Project Two. The HTML output can be downloaded by clicking File, then Download as, then HTML. Do not include the Python code within your summary report. TEST F 10 F11 F 12 PRT SCR LOCK PAUSE GERT FG F7 FB 2 SYS RO BREAK P1arse Hero x Project Two Jupyter Script x G Step 4: Hypothesis Test for the Pc x | NEED HELP WRITING THE CODE x M Inbox (29) - kyleborgailo@gmail x |+ Downloads/Project%20Two%%20/upyter%%20Script.html ie Resource... STEM | science | IT... G Object Oriented Pr... My orders Metal Gear Solid 1... Apporto | App and... Oop assignment | I... Calorie Calculator -... ) 2019 Form 8962 @ Order Nation Step 5: Hypothesis Test for the Population Proportion Suppose the management claims that the proportion of games that your team wins when scoring 80 or more points is 0.50. Test this claim using a 5% level of significance. Make the following edits to the code block below 1. Replace ??COUNT_VAR?? with the variable name that represents the number of games won when your team scores over 80 points. (Hint: this variable is in the code block below). 1. Replace ??NOBS_VAR?? with the variable name that represents the total number of games when your team scores over 80 points. (Hint: this variable is in the code block below). 1. Replace ??NULL_HYPOTHESIS_VALUE?? with the proportion under the null hypothesis. After you are done with your edits, click the block of code below and hit the Run button above In [ ]: from statsmodels. stats . proportion import proportions_ztest your_team_gt_80_df = your_team_of [ (your_team_of [ 'pts' ] > 80) ] # Number of games won when your team scores over 80 points counts = (your_team_gt_80_df [ 'game_result' ] == 'W' ). sum() # Total number of games when your team scores over 80 points nobs = len(your_team_gt_80_of [ 'game_result' ]) p = counts*1.0obs print ("Proportion of games won by your team when scoring more than 80 points in the years 2013 to 2015 -", round (p, 4) ) # Hypothesis Test # - - - - TODO: make your edits here - --- test_statistic, p_value = proportions_ztest(??)COUNT_VAR??], ??NOBS_VAR??], ??NULL_HYPOTHESIS_VALUE? ?]) print("Hypothesis Test for the Population Proportion") print("Test Statistic =", round(test_statistic, 2) ) print ("P-value =", round(p_value, 4) ) Step 6: Hypothesis Test for the Difference Between Two Population Means The management of your team wants to compare the team with the assigned team (the Bulls in 1996-1998). They claim that the skill level of your team in 2013- 2015 is the same as the skill level of the Bulls in 1996 to 1998. In other words, the mean relative skill level of your team in 2013 to 2015 is the same as the mean relative skill level of the Bulls in 1996-1998. Test this claim using a 1% level of significance. Assume that the population standard deviation is unknown. Make the following edits to the code block below: 1. Replace ??DATAFRAME_ASSIGNED_TEAM?? with the name of assigned team's dataframe. See Step 1 for the name of assigned team's dataframe. O x FS F7 FB F 10 F12 RT SER LOCK BYBRO BREPx Project Two Jupyter Script x G Step 4: Hypothesis Test for the Pc X C NEED HELP WRITING THE CODE X M Inbox (29) - kyleborgailo@gmail. x + ject%20Two%20Jupyter%20Script.html D STEM | science | IT... DG Object Oriented Pr... IG My orders Metal Gear Solid 1... Apporto | App and... Oop assignment | 1... Calorie Calculator -... 2019 Form 8962 Order Nationally | C... S_VALUE' ) 11 12 print( "Hypothesis Test for the Population Mean") TypeError: string indices must be integers 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 relative skill level is unknown. 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 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. 1. The dataframe for your team is called your_team_df. 2. The variable 'pts' represents the points scored by your team. 3. Calculate and print the mean points scored by your team during the years you picked 4. 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 6. Calculate and print the test statistic rounded to two decimal places. 7. 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 the Run button above. Reach out to your instructor if you need more help with this step. In [ ]: import scipy. stats as st Mean relative skill Level of your team mean_elo_your_team = your_team_df['elo_n' ].mean( ) print ("Mean Relative Skill of your team 2013 to 2015 round (mean elo your team,2)) est_statistic, p_valuek st. ttest_1samp(Lakers) Step 5: Hypothesis Test for the Population Proportion Suppose the management claims that the proportion of games that your team wins when scoring 80 or more points is 0.50. Test this claim using a 5% level of significance. Make the following edits to the code block below: . Replace ??COUNT_VAR?? with the variable name that represents the number of games won when your team scores over 80 points. (Hint: this variable is in the code block below). O e F12 PRT SCR SCROLL PAUSE FS F6 F7 FB FS F10 LOCK 2 SYS RO BREAKHero x Project Two Jupyter Script x G Step 4: Hypothesis Test for the Pc x @ NEED HELP WRITING THE CODE x M Inbox (29) - kyleborgailo@gmail. x + Downloads/Project%20Two%20Jupyter%20Script.html Resource ... SD STEM | science | IT... G Object Oriented Pr... I My orders s Metal Gear Solid 1... Apporto | App and... Oop assignment | |... Calorie Calculator -... 2019 Form 8962 & Or Number UI rows In1 the uataset = 240 Step 3: Hypothesis Test for the Population Mean (1) A relative skill level of 1420 represents a critically low skill level in the league. The management of your team has hypothesized that the average relative skill level of your team in the years 2013-2015 is greater than 1420. Test this claim using a 5% level of significance. For this test, assume that the population standard deviation for relative skill level is unknown. Make the following edits to the code block below 1. Replace ??DATAFRAME_YOUR_TEAM?? with the name of your team's dataframe. See Step 2 for the name of your team's dataframe. 1. Replace ??RELATIVE_SKILL?? with the name of the variable for relative skill. See the table included in the Project Two instructions above to pick the variable name. Enclose this variable in single quotes. For example, if the variable name is var2 then replace ??RELATIVE_SKILL?? with 'var2'. 1. Replace ??NULL_HYPOTHESIS_VALUE?? with the mean value of the relative skill under the null hypothesis. After you are done with your edits, click the block of code below and hit the Run button above. In [6]: import scipy . stats as st # Mean relative skill level of your team mean_elo_your_team = your_team_df ['elo_n' ]. mean( ) print ("Mean Relative Skill of your team in the years 2013 to 2015 =", round(mean_elo_your_team, 2) ) # Hypothesis Test ---- TODO: make your edits here test_statistic, p_value = st. ttest_1samp(' Lakers DATAFRAME_YOUR_TEAM' [ ' Lakers RELATIVE_SKILL' ], ' Lakers NULL_HYPOTHESIS_VALUE. ) print("Hypothesis Test for the Population Mean") print("Test Statistic =", round(test_statistic, 2) ) print ("P-value =", round(p_value, 4) ) Mean Relative Skill of your team in the years 2013 to 2015 = 1440.49 TypeError Traceback (most recent call last)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
