# What is hypothesis testing one sample one sided?

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:

1. 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.g H0: μ <= 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.

1. If we fail to reject H0: : μ <= 15, is the conclusion "the mean population is lower than 15"?
• A couple of comments toward an answer: a) The test is done against a theoretical mean of 15, because a mean of 15 is meaningful for what is being studied. For example, maybe the national average is 15, and you want to compare your sample from your population to this national average to see if your population is different. b) If you were to accept the null hypothesis, the conclusion would be mu <= 15, not that mu < 15. However, by failing to reject the null hypothesis, you don't necessarily accept it. You just conclude that you don't have sufficient evidence to reject it. <cont> Commented Oct 17, 2022 at 18:31
• <cont>. A usual analogy on c) is that it is like finding someone not guilty of a crime. It isn't the case that you are saying that they are innocent. You are just saying that there is not sufficient evidence to conclude that they are guilty. (In this analogy not guilty works like a null hypothesis and guilty works like the alternate hypothesis. Commented Oct 17, 2022 at 18:34
• @SalMangiafico because a mean of 15 is meaningful for what is being studied. Can I randomly change the pop mean until I get p-value below 0.05? By doing so, I can reject the null hypothesis and have enough evidence to use the alternative hypothesis, e.g with popmean = 10, let's say the p-value is 0.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 ? Commented Oct 18, 2022 at 2:32
• Well, why would you want to do this ? ... You could always come up with some hypothesis that would return a significant result. But there's no point in testing hypotheses that you don't care about. Commented Oct 18, 2022 at 20:16
• Mulling over your question , I'm wondering if your terminology is causing some of the confusion. With these kind of statistical tests, we assume there is a larger population that we get our sample from. So in your example you have a sample with an average of 9.4, which is an estimate of the true population mean, which you don't know. 15 could be the mean of a population, but it's not the same population. But in any case, I think it's clearer to think of the 15 as a theoretical mean. <cont> Commented Oct 19, 2022 at 0:55