Estimating the population mean by using the sample mean is called point estimation. It is also possible to do another type of estimation, interval estimation. In interval estimation, also called confidence intervals, one gives a range of values along with a level of confidence.
With a 95% confidence interval for a sample mean, 95% of all sample of the same size will contain the true population mean. Which is very close to saying that the true population mean has a 95% chance of falling within the confidence interval (close but not exactly the same).
A confidence interval has the form:
Or more simply:
use df = n-1
Construct a 95% confidence interval using the sample mean.
Next, compute the standard error of the mean:
se = s/SQRT(n) =5.083/SQRT(64) = 0.635
Construct the confidence interval:
Xbar ± CVt * se = 27.75 ± 2.00*0.635 = 27.75 ± 1.27
(26.48, 29.03)
cii 64 27.75 5.083 Variable | Obs Mean Std. Err. [95% Conf. Interval] ---------+------------------------------------------------------------- | 64 27.75 .635375 26.4803 29.0197
Test the hypothesis that the sample comes from a population with a mean of 33.02.
The hypothesized popluation mean is 33.02 which falls outside of the 95% confidence interval.
Therefore, reject the null hypothesis at alpha = 0.05.
Use df = n1 + n2 - 2
Remember:
Construct a 95% confidence interval on the difference in means.
Next, compute the standard error of the differences in means:
se = sp*SQRT(1/n1 + 1/n2) = 7.34*SQRT(1/15 + 1/17) = 2.6
Construct the confidence interval:
Test the hypothesis that the two samples come from a populations with equal means.
The hypothesized difference in popluation means, zero, does not fall outside the 95% confidence interval.
Therefore, fail to reject reject the null hypothesis at alpha = 0.05.
Intro Home PageExample
Experimental Group: Phonics, n = 15, mean = 50, s = 8.7
Control Group: Whole Language, n = 17, mean 45, s = 5.9
First, find the Critical Value of t with
df = n1 + n2 - 2 = 15 + 17 - 2 = 30:
CVt = 2.04
sp2 = ((15-1)*8.72+(17-1)*5.92)/(15+17-2)=
(1,059.66+556.96)/30 = 1,616.62/30 = 53.89
sp = SQRT(sp2) = SQRT(53.89) = 7.34
Xbar1 - Xbar2 ± CVt * se = 50 - 45 ±
2.042*2.6 = 5 ± 5.31
(-0.31, 10.31)
Example Using Stata
ttesti 15 50 8.7 17 45 5.9
Two-sample t test with equal variances
------------------------------------------------------------------------------
| Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
x | 15 50 2.24633 8.7 45.1821 54.8179
y | 17 45 1.43096 5.9 41.9665 48.0335
---------+--------------------------------------------------------------------
combined | 32 47.34375 1.352953 7.65346 44.58438 50.10312
---------+--------------------------------------------------------------------
diff | 5 2.600448 -.3108242 10.31082
------------------------------------------------------------------------------
Degrees of freedom: 30
Ho: mean(x) - mean(y) = diff = 0
Ha: diff < 0 Ha: diff ~= 0 Ha: diff > 0
t = 1.9227 t = 1.9227 t = 1.9227
P < t = 0.9680 P > |t| = 0.0641 P > t = 0.0320
Confidence Intervals and Hypothesis Testing Again
A 95% confidence interval is equivalent to a two-tail test of hypotheses at alpha = 0.05. If zero,
the hypothesized difference in population means, falls outside of the confidence
then the null hypothesis is rejected.
The confidence interval is (-0.31, 10.31).
More Stata Examples
use http://www.philender.com/courses/data/hsb2, clear
ci read write math science socst
Variable | Obs Mean Std. Err. [95% Conf. Interval]
---------+-------------------------------------------------------------
read | 200 52.23 .7249921 50.80035 53.65965
write | 200 52.775 .6702372 51.45332 54.09668
math | 200 52.645 .6624493 51.33868 53.95132
science | 200 51.85 .7000987 50.46944 53.23056
socst | 200 52.405 .7591352 50.90802 53.90198
ci read write math science socst, level(90)
Variable | Obs Mean Std. Err. [90% Conf. Interval]
---------+-------------------------------------------------------------
read | 200 52.23 .7249921 51.03192 53.42808
write | 200 52.775 .6702372 51.6674 53.8826
math | 200 52.645 .6624493 51.55027 53.73973
science | 200 51.85 .7000987 50.69305 53.00695
socst | 200 52.405 .7591352 51.15049 53.65951
ci read write math science socst, level(99)
Variable | Obs Mean Std. Err. [99% Conf. Interval]
---------+-------------------------------------------------------------
read | 200 52.23 .7249921 50.34447 54.11553
write | 200 52.775 .6702372 51.03187 54.51813
math | 200 52.645 .6624493 50.92213 54.36787
science | 200 51.85 .7000987 50.02921 53.67079
socst | 200 52.405 .7591352 50.43067 54.37933
ttest write, by(female)
Two-sample t test with equal variances
------------------------------------------------------------------------------
Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
male | 91 50.12088 1.080274 10.30516 47.97473 52.26703
female | 109 54.99083 .7790686 8.133715 53.44658 56.53507
---------+--------------------------------------------------------------------
combined | 200 52.775 .6702372 9.478586 51.45332 54.09668
---------+--------------------------------------------------------------------
diff | -4.869947 1.304191 -7.441835 -2.298059
------------------------------------------------------------------------------
Degrees of freedom: 198
Ho: mean(male) - mean(female) = diff = 0
Ha: diff < 0 Ha: diff ~= 0 Ha: diff > 0
t = -3.7341 t = -3.7341 t = -3.7341
P < t = 0.0001 P > |t| = 0.0002 P > t = 0.9999
Phil Ender, 30Jun98