Question: B 2 [ 1 pt ] Let's do a slightly different hypothesis test and let's do it in one step. Use the ttest _ 1
B pt Let's do a slightly different hypothesis test and let's do it in one step. Use the ttestsamp function to test the hypothesis that the mean tip percentage in the population is
Store the results of the ttestsamp function in the variable hyporesults. Use hyporesults and an ifelse structure to define the variable rejectornot. Again, the
variable rejectornot should either be the string 'reject' or the string 'fail to reject'.
:
Student's answer
hyporesults None
rejectornot Noneimport pandas as pd
import numpy as np
from scipy.stats import ttestsamp
import scipy.stats as stats
hyporesults stats.ttestsamptipsdftippercentage' # Test against the population mean of
if hyporesults.pvalue : # Standard significance level
rejectornot 'reject'
else:
rejectornot 'fail to reject'
printfHypothesis test result: rejectornot
#raise NotImplementedError
NameError
Traceback most recent call last
Cell In line
from scipy.stats import ttestsamp
import scipy.stats as stats
hyporesults stats.ttestsamptipsdftippercentage' # Test against the population mean of
if hyporesults.pvalue : # standard significance level
rejectornot 'reject'
NameError: name 'tipsdf is not defined
ln :
#Hidden tests for Question B are within this cell.
You have failed this test due to an error. The traceback has been removed because it may contain hidden tests. This is the exception that was thrown:
AssertionError: Question B: Your answer for rejectornot does not match the official answer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
