Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Let's hypothesize that the mean tip percentage in the population is 1 7 % . Use sample _ mean, standard _ error, and the hypothesized
Let's hypothesize that the mean tip percentage in the population is Use samplemean, standarderror, and the hypothesized value to calculate the tstatistic. Then use scipy.stats's norm.cdf function to calculate the pvalue. Finally, decide whether you reject or fail to reject the hypothesis. Store your answers in the variables tstat, pval, and rejectornot. The variable rejectornot should either be the string 'reject' or the string 'fail to reject'. Remember to look at the units of the variable tippercentage in the output of taxi.head above in order to set the hypothesized value correctly. my code is wrong: import numpy as np
import pandas as pd
from scipy.stats import norm
taxi pdreadcsvassetstaxicsv
tippercentages taxitippercentage'
hypothesizedmean
samplemean npmeantippercentages
samplesize lentippercentages
samplevar npvartippercentages, ddof
standarderror npsqrtsamplevar samplesize
tstat samplemean hypothesizedmean standarderror
pval norm.cdfnpabststat
alpha # Significance level
rejectornot 'reject' if pval alpha else 'fail to reject'
printftstatistic: tstat
printfpvalue: pval
printfDecision: rejectornot error code: 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: Problem :Your answer for tstat does not match the official answer.
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