This document is prepared automatically using the following R command.
This lesson explains how to conduct a hypothesis test of a mean, when the following conditions are met:
The sampling method is simple random sampling.
The sampling distribution is normal or nearly normal.
Generally, the sampling distribution will be approximately normally distributed if any of the following conditions apply.
The population distribution is normal.
The population distribution is symmetric, unimodal, without outliers, and the sample size is 15 or less.
The population distribution is moderately skewed, unimodal, without outliers, and the sample size is between 16 and 40.
The sample size is greater than 40, without outliers.
state the hypotheses
formulate an analysis plan
analyze sample data
interpret results.
The first step is to state the null hypothesis and an alternative hypothesis.
Null hypothesis(H0):μ=23 Alternative hypothesis(H1):μ≠23
Note that these hypotheses constitute a two-tailed test. The null hypothesis will be rejected if the sample mean is too big or if it is too small..
For this analysis, the significance level is 95%. The test method is a one-sample t-test.
Using sample data, we compute the standard error (SE), degrees of freedom (DF), and the t statistic test statistic (t).
SE=s√n=6.0269481√32=1.07 DF=n−1=32−1=31
t=(ˉx−μ)/SE=(20.090625−23)/1.07=−2.731
where s is the standard deviation of the sample, ˉx is the sample mean, μ is the hypothesized population mean, and n is the sample size.
We can visualize the confidence interval of mean.
plot(x)
Since we have a two-tailed test, the P-value is the probability that the t statistic having 31 degrees of freedom is less than -2.73 or greater than 2.73.
We use the t Distribution curve to find p value.
draw_t(DF=x$result$DF,t=x$result$t,alternative=x$result$alternative)
pt(−2.731,31)=0.01
Since the P-value (0.01) is less than the significance level (0.05), we can reject the null hypothesis.
call: meanCI.data.frame(x = mtcars, mpg, mu = 23)
method: One sample t-test
alternative hypothesis:
true mean is not equal to 23
Results
# A tibble: 1 × 7
m se DF lower upper t p
<chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 20.09062 1.0654 31 17.91768 22.26357 -2.7307 0.01033
The contents of this document are modified from StatTrek.com. Berman H.B., “AP Statistics Tutorial”, [online] Available at: https://stattrek.com/hypothesis-test/mean.aspx?tutorial=AP URL[Accessed Data: 1/23/2022].