08 two sample tests
TRANSCRIPT
-
8/6/2019 08 Two Sample Tests
1/41
Overview
Two paired samples: Within-Subject Designs-Hypothesis test
-Confidence Interval
-Effect Size
Two independent samples: Between-Subject Designs-Hypothesis test-Confidence interval
-Effect Size
-
8/6/2019 08 Two Sample Tests
2/41
-
8/6/2019 08 Two Sample Tests
3/41
Two kinds of studies
There are two general research strategies that can be used toobtain the two sets of data to be compared:
1. The two sets of data could come from two independent populations (e.g. women and men, or students fromsection A and from section B)
2. The two sets of data could come from related
populations (e.g. before treatment and after treatment)
-
8/6/2019 08 Two Sample Tests
4/41
Part I
Two paired samples: Within-Subject Designs-Hypothesis test
-Confidence Interval
-Effect Size
-
8/6/2019 08 Two Sample Tests
5/41
Paired T-Test for Within-Subjects Designs
Our hypotheses:
Ho: QD = 0
HA: QD { 0
To test the null hypothesis, well again compute a tstatistic and look it up in the t table.
Paired Samples t
t = D - QD sD =s
D
sn
-
8/6/2019 08 Two Sample Tests
6/41
Steps for Calculating a Test Statistic
Paired Samples T
1. Calculate difference scores
2. Calculate D
3. Calculate s d
4. Calculate T and d.f.
5. Use Table E.6
-
8/6/2019 08 Two Sample Tests
7/41
Confidence Intervals for Paired Samples
Paired Samples t
D s t (s D)
General formula
X s t (SE)
-
8/6/2019 08 Two Sample Tests
8/41
Effect Size for Dependent Samples
Paired Samples d
One Sample d
s
X d H 0
Q!
D s
Dd !
-
8/6/2019 08 Two Sample Tests
9/41
ExerciseIn Everitts study (1994), 17 girls being treated for anorexia were weighed before and after treatment.Difference scores were calculated for each participant.
Change in Weightn = 17
= 7.26sD = 7.16
D
Test the null hypothesis that there was no change in weight.
Compute a 95% confidence interval for the mean difference.
Calculate the effect size
-
8/6/2019 08 Two Sample Tests
10/41
ExerciseChange in Weightn = 17
= 7.26sD = 7.16
D
74.1
17
16.7!!SE
17.474.1
026.7)16( !!t
01. p
T-test
-
8/6/2019 08 Two Sample Tests
11/41
ExerciseChange in Weightn = 17
= 7.26sD = 7.16
D
12.2!crit t
)74.1(12.226.7 s!CI
)95.10,57.3(
ConfidenceInterval
-
8/6/2019 08 Two Sample Tests
12/41
ExerciseChange in Weightn = 17
= 7.26sD = 7.16
D
16.726.7
!d
01.1!d
Effect Size
-
8/6/2019 08 Two Sample Tests
13/41
Part II
Two independent samples: Between-Subject Designs-Hypothesis test
-Confidence Interval
-Effect Size
-
8/6/2019 08 Two Sample Tests
14/41
T-Test for Independent SamplesThe goal of a between-subjects research study is to evaluatethe mean difference between two populations (or betweentwo treatment conditions).
Ho: Q1 = Q2
HA: Q1 { Q 2
We cant compute difference scores, so
-
8/6/2019 08 Two Sample Tests
15/41
T-Test for Independent Samples
We can re-write these hypotheses as follows:
Ho: Q1 - Q2 = 0
HA: Q1 - Q2 { 0
To test the null hypothesis, well again compute a tstatistic and look it up in the t table.
-
8/6/2019 08 Two Sample Tests
16/41
T-Test for Independent Samples
General t formula
t = sample statistic - hypothesized population parameter
estimated standard error
?21
! X X s
Independent samples t
21
)()( 2121
X X s X X
t ! Q Q
One Sample t
X
H test s
X t 0
Q!
-
8/6/2019 08 Two Sample Tests
17/41
T-Test for Independent Samples
Standard Error for a Difference in Means
The single-sample standard error ( s x ) measures howmuch error expected between X and Q.
The independent-samples standard error (s x1-x2 )measures how much error is expected when you areusing a sample mean difference (X 1 X2) to represent a
population mean difference.
21 X X s
-
8/6/2019 08 Two Sample Tests
18/41
T-Test for Independent Samples
Standard Error for a Difference in Means
Each of the two sample means represents its own population mean, butin each case there is some error.
The amount of error associated with each sample mean can be measured by computing the standard errors.
To calculate the total amount of error involved in using two samplemeans to approximate two population means, we will find the error fromeach sample separately and then add the two errors together.
2
22
1
21
21
n
s
n
s s X X !
-
8/6/2019 08 Two Sample Tests
19/41
T-Test for Independent Samples
Standard Error for a Difference in Means
But
This formula only works when n 1 = n 2. When the twosamples are different sizes, this formula is biased .
This comes from the fact that the formula above treats thetwo sample variances equally. But we know that thestatistics obtained from large samples are better estimates,so we need to give larger sample more weight in our
estimated standard error.
2
22
1
21
21
n
s
n
s s X X !
-
8/6/2019 08 Two Sample Tests
20/41
T-Test for Independent Samples
Standard Error for a Difference in Means
We are going to change the formula slightly so that we usethe pooled sample variance instead of the individual samplevariances.
This pooled variance is going to be a weighted estimate of the variance derived from the two samples.
s p2
!SS 1 SS 2
df 1 df 2
2
2
1
2
21
n
s
n
s s p p X X !
-
8/6/2019 08 Two Sample Tests
21/41
Steps for Calculating a Test Statistic
One-Sample T
1. Calculate sample mean
2. Calculate standard error
3. Calculate T and d.f.
4. Use Table D
-
8/6/2019 08 Two Sample Tests
22/41
Independent Samples T
1. Calculate X 1-X2
2. Calculate pooled variance
3. Calculate standard error
4. Calculate T and d.f.
5. Use Table E.6
s p2
!
SS 1 SS 2df 1 df 2
s p2
1
s p2
n2
t !( X X 2) ( Q Q 2 )
s x
1x
2 d.f. = (n 1 - 1) + (n 2 - 1)
Steps for Calculating a Test Statistic
-
8/6/2019 08 Two Sample Tests
23/41
IllustrationA developmental psychologist would like to examine thedifference in verbal skills for 8-year-old boys versus 8-year-old girls. A sample of 10 boys and 10 girls isobtained, and each child is given a standardized verbal
abilities test. The data for this experiment are as follows:
Girls Boys
n1 = 10= 37
SS1 = 150 X 1
n2 = 10= 31
SS2 = 210 X 2
-
8/6/2019 08 Two Sample Tests
24/41
STEP 1: get mean difference
621 ! X X
Girls Boys
n1
= 10= 37
SS 1 = 150 X 1
n2
= 10= 31
SS 2 = 210 X 2
Illustration
-
8/6/2019 08 Two Sample Tests
25/41
STEP 2: Compute Pooled Variance
s p2
!SS 1 SS 2
df 1 df 2!
150 2 10
(10 1) (10 1)
!360
18
! 2 0
Girls Boys
n1
= 10= 37
SS 1 = 150 X 1
n2
= 10= 31
SS 2 = 210 X 2
Illustration
-
8/6/2019 08 Two Sample Tests
26/41
STEP 3: Compute Standard Error
Girls Boys
n1
= 10= 37
SS 1 = 150 X 1
n2
= 10= 31
SS 2 = 210 X 2
SE ! s p
2
n 1
s p2
n 2!
20
10
20
10! 4 ! 2
Illustration
-
8/6/2019 08 Two Sample Tests
27/41
-
8/6/2019 08 Two Sample Tests
28/41
STEP 5: Use table E.6
Girls Boys
n1 = 10= 37
SS 1 = 150 X 1
n2 = 10= 31
SS 2 = 210 X 2
T = 3 with 18 degrees of freedom
For alpha = .01, critical value of t is 2.878
Our T is more extreme, so we reject the null
There is a significant difference between boys and girls
Illustration
-
8/6/2019 08 Two Sample Tests
29/41
T-Test for Independent Samples
SampleData
HypothesizedPopulationParameter
SampleVariance
EstimatedStandard
Error
t-statistic
Singlesample
t-statistic
Independent
samplest-statistic
X 1 X 2 Q1 Q 2 s p2
n1
s p2
n2
s p2
!
SS 1
SS 2
d f 1 d f 2
X Qs
2
n s
2 !SS f t !
X Q s x
t !( X 1 X 2 ) ( Q1 Q 2 )
s x1 x2
-
8/6/2019 08 Two Sample Tests
30/41
Confidence Intervals for Independent Samples
One Sample t
X s t (s x)
General formula
X s t (SE)
Independent Sample t
(X1-X 2) s t (s x1-x2 )
-
8/6/2019 08 Two Sample Tests
31/41
Effect Size for Independent Samples
One Sample d
Independent Samples d
s
X d H 0
Q!
p s X X d 21!
-
8/6/2019 08 Two Sample Tests
32/41
Exercise
Subjects are asked to memorize 40 noun pairs. Ten subjectsare given a heuristic to help them memorize the list, theremaining ten subjects serve as the control and are given nohelp. The ten experimental subjects have a X-bar = 21 and aSS = 100. The ten control subjects have a X-bar = 19 and a SS= 120.
Test the hypothesis that the experimental group differs fromthe control group.
Give a 95% confidence interval for the difference betweengroups
Give the effect size
-
8/6/2019 08 Two Sample Tests
33/41
ExerciseExperimental Control
n1 = 10= 21SS 1 = 100
X 1n2 = 10= 19SS 2 = 120
X 2
221 !X X
2.1218220
)110()110(120100
21
212 !!!!d f d f
SS SS s p
56.144.210
2.1210
2.12
2
2
1
2
!!!!n
s
n
sSE p p
T-test
-
8/6/2019 08 Two Sample Tests
34/41
Exercise
28.156.1
02)()(
21
2121 !!! x x s
X X t Q Q
d.f. = (n 1 - 1) + (n 2 - 1) = (10-1) + (10-1) = 18
20." p
T-test
Experimental Control
n1 = 10= 21SS 1 = 100
X 1n2 = 10= 19SS 2 = 120
X 2
-
8/6/2019 08 Two Sample Tests
35/41
Exercise
101.2!crit t
)56.1(101.22 s!C I
ConfidenceInterval
)28.5,28.1(
Experimental Control
n1 = 10= 21SS 1 = 100
X 1n2 = 10= 19SS 2 = 120
X 2
-
8/6/2019 08 Two Sample Tests
36/41
Exercise
57.!d
Effect Size
p s X X
d 21!
2.12
2!d
Experimental Control
n1 = 10= 21SS 1 = 100
X 1n2 = 10= 19SS 2 = 120
X 2
-
8/6/2019 08 Two Sample Tests
37/41
Summary
Hypothesis Tests
Confidence Intervals
Effect Sizes
1 Sample
2 Paired Samples
2 Independent Samples
-
8/6/2019 08 Two Sample Tests
38/41
R eview
-
8/6/2019 08 Two Sample Tests
39/41
SampleData
HypothesizedPopulationParameter
SampleVariance
EstimatedStandard
Error
t-statistic
One samplet-statistic
Pairedsamples t-
statistic
Independent
samplest-statistic
X
X 1 X 2
Q
Q1 Q2
s2
n
s p
2
n1
s p
2
n2
s2
!SS f
s p2
!
SS 1
SS 2
d f 1 d f 2
t ! Q
s x
t !( X 1 X 2 ) ( Q1 Q 2 )
s x1 x2
D D Q s
2
ndf
SS s D!2
D
D
s
Dt
Q!
-
8/6/2019 08 Two Sample Tests
40/41
Confidence Intervals
Paired Samples t
D s t (s D)
One Sample t
X s t (SE)
Independent Sample t
(X1-X 2) s t (s x1-x2 )
-
8/6/2019 08 Two Sample Tests
41/41
Effect Sizes
Paired Samples d
One Sample d
Independent Samples d
D s D
d !
s
X d 0
Q!
p s X X
d 21!