T-tests
-
Review of hypothesis testing
-
T-tests for one sample
-
Comparing means
-
Comparing means from independent groups
Review of Hypothesis Testing
-
For one sample mean with known population standard deviation
-
Set a null hypothesis (H0)
-
Create an alternative hypothesis as well (H1)
-
Collect a sample
-
Find z-score of sample mean relative to mean in H0
-
Find probability (p) associated with z-score
-
If p < a, then reject the null hypothesis
-
Otherwise, do not reject H0
Extension to Hypothesis Testing
-
What if the standard deviation is not known?
-
In any sample, you have an estimate of the population standard
deviation
-
The sample standard deviation!
-
Maybe you could just use the sample standard deviation and
follow the same procedure as before.
-
This will not work straightforwardly.
Standard Error and the Mean
-
If we estimate the standard deviation of the sampling distribution
of the mean using the data, we are using the standard error of the mean
-
some people call both the standard error (so don't get confused),
just concentrate on what you know and what you need to estimate and you
will always do the right thing.
-
It looks like the statistic we have been using.
standard deviation of the sampling mean: sigma/n1/2
standard error of the mean: s/n1/2
Z and t distributions
Recall:
z=(x bar - mu)/(sigma/n1/2)
if we don't know the population standard deviation:
t=(x bar-mu)/(s/n1/2)
t and Z distributions
-
They are not the same.
-
t is actually a whole family of distributions (no standard
t)
How is t related to z (normal distribution)?
-
same in the limit (df=infinity)
-
more uncertainty for lower df
-
t is different for smaller degrees of freedom
-
use t for normal populations of unknown sigma.
-
so, you need to use a t table instead of a z table!
N(0,1) and t(5)
Degrees of Freedom
-
The shape of the t distribution changes with the sample size
-
Has to do with the fact that the mean and standard deviation
are not independent
-
Specific curve is identified by the number of degrees of
freedom
-
As the sample size gets larger, the t distribution looks
more like the Normal distribution.
-
The family of curves appears in tables in the book.
Demo on comparing t and normal distribution
The logic of the one sample t-test
-
Same as the tests using the z distribution
-
Population standard deviation is unknown
-
Use standard error of the mean
-
Use the t distribution
-
N-1 degrees of freedom
-
Mean must be estimated to know standard error
Doing a confidence interval with t's
- Same logic as with the normal distribution
- just use t instead of z
- use t when sigma is unknown and must be estimated
An Example - find the 95% confidence interval for x bar.
- Four music fans from Boston are asked to rate how much they like
Helium on a 1-123 scale.
- The four ratings are 98, 45, 78, and 67.
- What is x bar?
- What is the stadard error of x bar?
- sqrt(var(98,45,78,67))/sqrt(4)=11.1
- What t value should we use?
- degrees of freedom equals 3
- t(95%,df=3)=3.18
- The confidence interval is 72 ± 3.18*11.1=35.3
Doing a one sample t-test
-
If a morning class drinks caffeine, they will average an
80 on the final exam.
-
H0: m = 80
-
H1: m <> 80
-
mean = 86
-
s.d. = 5.4
-
32 students taking the exam
-
standard error of the mean = .955
-
t (31) = (86 - 80)/.955 = 6.285
-
Reject H0