Professional Documents
Culture Documents
Lecture 9 - T-Tests
Lecture 9 - T-Tests
t-Tests
• Single Sample
• Paired Samples
• Independent Samples
t Distributions
• t dist. are used when we
know the mean of the
population but not the SD of
the population from which
our sample is drawn
• t dist. are useful when we
have small samples.
• t dist is flatter and has fatter • Same Three Assumptions
tails • Dependent Variable is scale
• As sample size approaches • Random selection
30, t looks like z (normal) • Normal Distribution
dist.
Fat Tails Lose Weight With Larger
Sample Size
The Robust Nature of the t
Statistics
Unfortunately, we very seldom know the if the population is
normal because usually all the information we have about a
population is in our study, a sample of 10-20.
Fortunately,
1) distributions in social sciences often approximate a normal
curve, and
2) according to Central Limit Theorem the sample mean you
have gathered is part of a normal distribution of sample
means, and
3) in practice t tests statisticians have found the test is accurate
even with populations far from normal
The Robust Nature of the t
Statistics
• The only situation in which using a t test is
likely to give a seriously distorted result is
when you are using a one-tailed test and the
population is highly skewed.
When To Use Single Sample
t-Statistic
• 1 Nominal Independent Variable
• 1 Scale Dependent Variable
• Population Mean, No Population Standard
Deviation
Check Assumptions
• Random Selection
• Normal Shape Distribution
z Statistic Versus t Statistic
z Statistic t Statistic
• When you know the Mean • When you do not know the
and Standard deviation of a Mean and Standard
population. Deviation of the population
– E.g., a farmer picks 200,000 – E.g., a farmer picks 30 out of
apples, the mean weight is his 200,000 apples, and finds
112 grams, the SD is the sample has a Mean of 112
12grams. grams.
• Calculate the Standard Error • Calculate the Estimate of
of the sample mean the Standard Error of the
sample mean
Scenarios When you would use a
Single Sample t test
• A newspaper article reported that the typical American family spent an
average of $81 for Halloween candy and costumes last year. A sample of
N = 16 families this year reported spending a mean of M = $85, with s =
$20. What statistical test would we use to determine whether these data
indicate a significant change in holiday spending?
s Standard Error of a
m sm Sample: estimates
N N
the Sample Error of
the Population
(M M ) (M m ) t Statistic
z t for Single-
M sm Sample t
Test
Estimating Population from a
Sample
• Main difference between t Tests and z score:
– use the standard deviation of the sample to estimate the
standard deviation of the population.
• How? Subtract 1 from sample size! (called degrees of
freedom)
X
Standard Deviation
2
( X M ) 2
SD s of a Sample:
N N 1 Estimates the
Population
Standard Deviation
• A distribution of
• Two distribution of scores.
differences between
scores.
• Central Limit Theorem Revisited. If you plot the mean of
randomly sampled observations, the plot will approach a
normal distribution. This is true for scores and for
differences between matched scores.
Difference Between Calculating
Single-Sample t and Paired-Sample t Statistic
Single Sample t Statistic Paired Sample t Statistic
( X M ) 2 Standard
SS ( D x y M x y ) 2 SS
s Deviation s
N 1 N 1 of a N 1 N 1
Sample
Standard Deviation of Sample
Standard Error of a Differences
s
sm Sample
N s Standard Error of
sm Sample
Differences
(M m ) t Statistic for N
t Single-
sm Sample t
Test (M x y x y ) t Statistic for
t Paired-Sample t
sm Test
Paired Sample t Test Example
• We need to know if there is a difference in the salary for the same job in
Boise, ID, and LA, CA. The salary of 6 employees in the 25 th percentile in
the two cities is given .
Profession Boise Los Angeles
Executive Chef 53,047 62,490
Genetics Counselor 49,958 58,850
Grants Writer 41,974 49,445
Librarian 44,366 52,263
School teacher 40,470 47,674
Social Worker 36,963 43,542
• Step 6 Decide
(M x y x y ) (7914.333 0)
t 18.04
sm 438.333
How to Write Results
• t(5) = 18.04, p < .00001, d = xxxx.
• t Indicates that we are using a t-Test
• (5) Indicates the degrees of freedom associated with this t-Test
• 18.04 Indicates the obtained t statistic value
• p < .000001 Indicates the probability of obtaining the given t
value by chance alone
• d = xxxx Indicates the effect size for the significant effect (the
magnitude of the effect is measured in units of standard
deviations)
Independent t-Test
Independent t Test
• Compares the difference between two means of
two independent groups.
• You are comparing a difference between means to
a distribution of differences between means.
– Sample means from Group 1 and Group 2 compared to
a Population of differences between means of Group 1
and Group 2
Independent t Test
Paired-Sample Independent t Test
• Two observations from each • Single observation from each
participant participant from two
• The second observation is independent groups
dependent upon the first • The observation from the
since they come from the second group is independent
same person. from the first since they come
from different subjects.
• Comparing a mean
difference to a distribution • Comparing the difference
of mean difference scores between two means to a
distribution of differences
between mean scores .
Independent t Test: Steps
Calculate the corrected ( X M ) 2
(Y M ) 2
Step 1
variance for each sample s x2 s y2
N 1 N 1
df x 2 df y 2
Step 3 Calculate the pooled s 2
pooled s x s y
variance df total df total
In a z test you find SD, for ind.
t, you take weighted avg of SD2
s 2pooled s 2pooled Like the
Step 4 Calculate the squared
2 2
s s My
estimate of the standard Mx
Nx Ny Standard
error for each sample error in a
z test
Step 5 Calculate estimated variance
2
s Difference s Mx
2
s My
2
of the dist. of mean
differences
Independent t Test: Steps
Calculate the squared s 2pooled s 2pooled
Step 4
2
s Mx 2
s My
estimate of the standard Nx Ny
error for each sample
differences
differences
Step 7
t Statistic for an independent- (M X M Y )
Samples t Test t
s Difference
Confidence Interval
( M X M Y ) Lower t ( s Difference ) ( M X M Y ) Sample
for Independent
Samples t-test ( M X M Y )Upper t ( s Difference ) ( M X M Y ) Sample
s
2 sample t Paired-Sample t
sm Test
N 1
df df ( x) df ( y ) Degrees of Freedom for
Independent Samples t Test
s 2
Difference s 2
Mx s 2 Variance for a Distribution of
My Differences between Means
SD of the distribution of
s Difference s 2
Difference
Differences Between Means
( X M ) Y2 M ) 2
SS s 760 760 SS 272 272 136.333
( 2
sx
2
190
y
N 1 df 5 1 N 41 df 3 1 2
2
s Difference s Mx
2
s My
2
34.422 57.37 91.792
df x 2 df y 2
s y 190 136.333 172.11
4 2
s 2
pooled s x
df total df total 6 6
df total df x df y 4 2 6
s 2pooled 172.11
s 2
My 57.37
11.333 .1235
Ny 3
2
s
s 2
( M X 172
pooled
47 58.333
M.Y11) 34.422
t Mx
Nx 5
s Difference 91.792 91.792
ssm
s ( M
5
x
.
y
804862 x y )
5 2
.804862 SS 2.052329
61.09
2
N 8 2 .
82843
N 1 N 1 6 1
( M m ) 29.86 30
t -0.2171
sm .645
( M x y x y ) 2 SS
s
N 1 Ns 13.49543
sm
N 6
( M x y x y ) 2 SS
s 12.218
N 1 N 1
( X M ) 2 SSx 760
s 2
x 190
N 1 N 1 4 s 2
s 2pooled
172.1
57.37
s 2pooled
My
172.1 Ny 3
df 2 df y 2
s y 190 136.3 172.1
4 2
s 2
pooled x s x
df total df total 6 6
s 2
pooled s 2
pooled
s Difference s Difference
2
91.7926 9.580845
s 2
Mx s 2
My
Nx Ny
( M X M Y ) 47 58.333 11 .333
t 1.18292
s Difference 9.580845 9.580845
2
s Difference s Mx
2
s My
2