My goal is to learn hypothesis testing one sample one sided
. Honestly, I don't get it.
Hypothesis testing one sample RIGHT SIDED
H0: μ <= x̄
H1: μ > x̄
For example, I have a pg_df = pd.DataFrame([10,9,9,10,11,9,8])
The pg_df.mean()
is 9.4
Questions:
- Google have been saying μ is mean population. But why do we compare it with imaginary mean population e.g
H0: μ <= 15
instead of the actual mean sample e.gH0: μ <= 9.4
?
statistic, pvalue = stats.ttest_1samp(a = pg_df, popmean=15, alternative="greater")statistic, pvalue
The p-value is 0.9, which is larger than the significance level of 0.05. Thus, we fail to reject null hypothesis. Which we can conclude that the mean population is lower than 15.
- If we fail to reject
H0: : μ <= 15
, is the conclusion "the mean population is lower than 15"?
because a mean of 15 is meaningful for what is being studied
. Can I randomly change the pop mean until I getp-value
below 0.05? By doing so, I can reject the null hypothesis and have enough evidence to use the alternative hypothesis, e.g withpopmean = 10
, let's say the p-value is0.04
, does it mean I can say,because the p-value is below 0.05, we have sufficient evidence to reject the null hypothesis and conclude that the mean population is above 10
? $\endgroup$