Professional Documents
Culture Documents
11paired T
11paired T
n = 1,000,000 trials
x = 501,823 successes
0 e+00 2 e -0 4 4 e -0 4 6 e -0 4 8 e -0 4
498000
499000
x
500000
501000
Test statistic
502000
Binomial test
• P = 2*Pr[X≥501,823]
P = 2*(Pr[X = 501,823] + Pr[X = 501,824] +
Pr[X = 501,825] + Pr[X = 501,826] +
...
+ Pr[X = 999,999] + Pr[X = 1,000,000]
Central limit theorem
Y −m
Z=
s
Z-score
Y −m
Z=
s
501,823−500,000
Z= =3.646
500
Normal Chi-squared
Binomial test goodness of fit
approximation
test
Normal Chi-squared
Binomial test goodness of fit
approximation
test
Y −m
Z=
s
Z-score
t distribution
mean under Ho
Y −m
t=
s/ n
estimated
standard error
How do we use this?
• t has a Student's t distribution
• Find confidence limits for the mean
• Carry out one-sample t-test
t has a Student’s t distribution*
t has a Student’s t distribution*
Uncertainty
makes the null
distribution
FATTER
Y ± SE Y t 2 , df
95 % Confidence interval:
Use α(2) = 0.05
Confidence interval for a mean
c % Confidence interval:
Use α(2) = 1-c/100
One-sample t-test
Null hypothesis
Sample
The population mean
is equal to o
Y − o
t=
s / n
Comparing means
• Goal: to compare the mean of a numerical
variable for different groups.
• Tests one categorical vs. one numerical
variable
Example:
gender (M, F) vs. height
32
Paired vs. 2 sample comparisons
33
Paired designs
• Data from the two groups are paired
• There is a one-to-one correspondence
between the individuals in the two groups
34
More on pairs
• Each member of the pair shares much in
common with the other, except for the
tested categorical variable
• Example: identical twins raised in different
environments
• Can use the same individual at different
points in time
• Example: before, after medical treatment
35
Paired design: Examples
• Same river, upstream and downstream of a
power plant
• Tattoos on both arms: how to get them off?
Compare lasers to dermabrasion
36
Paired comparisons - setup
• We have many pairs
37
Paired comparisons
• To compare two groups, we use the mean of
the difference between the two members of
each pair
38
Example: National No Smoking
Day
• Data compares injuries at work on National
No Smoking Day (in Britain) to the same
day the week before
39
data
Year Injur ies before No Injur ies on No
Smoking Day Smoking Day
1987 516 540
1988 610 620
1989 581 599
1990 586 639
1991 554 607
1992 632 603
1993 479 519
1994 583 560
1995 445 515
1996 522 556
40
Calculate differences
Injur ies before No Injur ies on No Differ ence
Smoking Day Smoking Day (d)
516 540 24
610 620 10
581 599 18
586 639 53
554 607 53
632 603 -29
479 519 40
583 560 -23
445 515 70
522 556 34 41
Paired t test
• Compares the mean of the differences to a
value given in the null hypothesis
42
Hypotheses
43
Calculate differences
Injur ies before No Injur ies on No Differ ence
Smoking Day Smoking Day (d)
516 540 24
610 620 10
581 599 18
586 639 53
554 607 53
632 603 -29
479 519 40
583 560 -23
445 515 70
522 556 34 44
Calculate t using d’s
d = 25
2
s = 1043 .78
d
n =10
25 - 0
t= = 2.45
1043 .78 /10
45
Caution!
• The number of data points in a paired t test
is the number of pairs. -- Not the number
of individuals
Here, df = 10-1 = 9
46
Critical value of t
48
Quick reference summary:
Paired t-test
• What is it for? To test whether the mean difference in a
population equals a null hypothesized value, μdo
• What does it assume? Pairs are randomly sampled from a
population. The differences are normally distributed
• Test statistic: t
• Distribution under Ho: t-distribution with n-1 degrees of
freedom, where n is the number of pairs
• Formula:
d − do
t=
SE d