0% found this document useful (0 votes)
40 views

Module3 Part5 Two Sample T Procedure

The data appear to be approximately normally distributed based on the histograms and qq plots. The sample sizes are equal (n=30) so the assumption of equal variances is reasonable. Overall, the assumptions appear reasonable to proceed with a two-sample t-test.

Uploaded by

Daniel Rios
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Module3 Part5 Two Sample T Procedure

The data appear to be approximately normally distributed based on the histograms and qq plots. The sample sizes are equal (n=30) so the assumption of equal variances is reasonable. Overall, the assumptions appear reasonable to proceed with a two-sample t-test.

Uploaded by

Daniel Rios
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Two-Sample t Procedure

Two-sample Problems
q Compare the means of some quantitative variable for two
populations, Population 1 and Population 2
q Compare the means of some response or outcome variable
under two treatments, Treatment 1 and Treatment 2
q Parameters: µ1 and µ2
§ Population mean for Population 1 and Population 2
§ Mean response for Treatment 1 and Treatment 2
Two-sample Data
q Draw separate SRSs of size 𝑛Q and 𝑛[ from Normal
population N(µ1, σ1) and N(µ2, σ2) respectively.
q An SRS of 𝑛Q + 𝑛[ is randomly assigned to two treatment
groups. The response or outcome variable measured on all
the possible experiment units in the two treatment groups
follow N(µ1, σ1) and N(µ2, σ2) respectively.
q Random; Normal; Independence
Two-sample Data

Population
Sample
or Parameter Sample Size Sample SD
Mean
Treatment
1 N(µ1, σ1) 𝑛Q 𝑋#Q 𝑆Q
2 N(µ2, σ2) 𝑛[ 𝑋#[ 𝑆[
Two-Sample vs Matched Pairs
Example: Does the job satisfaction of assembly-line workers differ when their work is
machine-paced rather than self-paced?

Study 1: Choose an SRS of 18 workers, and each worker’s satisfaction was assessed
after working in each setting.
This is a matched pairs problem.

Study 2: Choose an SRS of 36 workers. Half of these works (18 workers) are allowed
to pace themselves while the other half (18 workers) use an assembly line that moved
at a fixed pace.
This is a two-sample problem.
Matched Pairs t Procedures
q Study designs that involve making two observations on
the same individual, or one observation on each of two
similar individuals, result in paired data.
q For pared data, we can make comparisons by analyzing
the differences in each pair.
q If the conditions for inference are met, we can use one-
sample t procedures to perform inference about the mean
difference µd.
Example
Insurance adjusters are concerned about the high estimates
they are receiving for auto repairs from garage I compared to
garage II. To verify their suspicion, each of 15 cars recently
involved in an accident was taken to both garages for
separate estimates of repair costs.
Example
22
20
18
16
14
12

Garage 1 Garage 2
Hypothese
q Insurance adjusters are concerned about the high
estimates they are receiving for auto repairs from garage I
compared to garage II.
q Let 𝜇^ denote the difference of the average estimate from
garage 1 minus the average estimate from garage 2
q We want to perform a test at the α = 0.05 significance
level of H0: 𝜇^ = 0 versus Ha: 𝜇^ > 0
q Take the difference: d = garage 1 – garage 2
One-sample t test on the difference

Histogram of Difference Boxplot of Difference QQ Plot of Difference

● ● ●

1.0

1.0
1.2

● ● ●

0.8

0.8

1.0

0.6

0.6
Sample Quantiles

0.8
Density

0.4

0.4
0.6

● ● ●

0.2

0.2
0.4

0.0

0.0
0.2

−0.2

−0.2
0.0

−0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 −1 0 1

Garage 1 − Garage 2 Garage 1 − Garage 2 Theoretical Quantiles


One-sample t test on the differences
q Take the difference: d = garage 1 – garage 2
q H0: 𝜇^ = 0 versus Ha: 𝜇^ > 0
q The sample mean and sample standard deviation of
differences are 𝑑̅ = 0.613 and 𝑠^ = 0.394
q Sample size n = 15
#
^GC C.ZQY
q Test statistic: 𝑡 = N` = I.abc = 6.02
J L J de
One-sample t test on the differences
q Take the difference: d = garage 1 – garage 2
q H0: 𝜇^ = 0 versus Ha: 𝜇^ > 0
#
^GC C.ZQY
q Test statistic: 𝑡 = N` = I.abc = 6.02
J L J de

q The P-value is the area to the right of t=6.02 under the t


distribution curve with df = 15 – 1 = 14.
q From the t table, the P-value is less than .0005.
One-sample t test on the differences
q Take the difference: d = garage 1 – garage 2
q H0: 𝜇^ = 0 versus Ha: 𝜇^ > 0
q The P-value is less than .0005.
q At the α = 0.05 significance level, we reject H0, which
indicates significant evidence to show the high estimates
they are receiving for auto repairs from garage I compared
to garage II.
Two-sample t statistic
When the Random, Norma, and Independence conditions are met,
q Parameter of interest: µ1 - µ2
q Estimate: 𝑋#Q − 𝑋#[

@df @ff
q Standard deviation of 𝑋#Q − 𝑋#[ is +
Ad Af

q Since we don’t know σ1 and σ2, we replace them in the


standard deviation formula with the sample standard deviation

Udf Uff
q Standard error of 𝑋#Q − 𝑋#[ is Ad
+ Af
Two-sample t statistic
q Parameter of interest: µ1 - µ2
q Two-sample t statistic

𝑋#Q − 𝑋#[ − 𝜇Q − 𝜇[
𝑇=
𝑠Q[ 𝑠[[
𝑛Q + 𝑛[

q Approximately a t distribution
q DF: use a conservative approach, using the smaller of n1 – 1 and n2 –
1 for the degrees of freedom.
Confidence Interval for µ1 - µ2
When the Random, Norma, and Independence conditions are
met, a level C confidence interval for µ1 - µ2 is

𝑠Q[ 𝑠[[
𝑋#Q − 𝑋#[ ± 𝑡 ∗ +
𝑛Q 𝑛[

where t* is the critical value corresponding to the confidence


level C from the t distribution with degrees of freedom equal
to the smaller of n1 – 1 and n2 – 1.
Example
The Wade Tract Preserve in Georgia is an old-growth forest of
longleaf pines that has survived in a relatively undisturbed state
for hundreds of years. One question of interest to foresters who
study the area is “How do the sizes of longleaf pine trees in the
northern and southern halves of the forest compare?” To find out,
researchers took random samples of 30 trees from each half and
measured the diameter at breast height (DBH) in centimeters.
Construct and interpret a 90% confidence interval for the
difference in the mean DBH for longleaf pines in the northern and
southern halves of the Wade Tract Preserve.
Example: Data
Example: Checking Assumptions
ü Random: The data come from random samples of 30
trees, one from the northern half and one from the
southern half of the forest.
ü Independent: Researchers took independent samples
from the northern and southern halves of the forest.
Example: Checking Assumptions
ü Normal: Skewness seen
in the boxplots gives us
reason to believe that the
population distributions
of DBH measurements
may not be Normal.
However, since both
sample sizes are at least
30, we are safe using t
procedures.
Example
q µ1: the true mean DBH of all trees in the southern half of the
forest
q µ2: the true mean DBH of all trees in the north half of the forest
q A 90% confidence interval for µ1 - µ2

𝑠Q[ 𝑠[[
𝑋#Q − 𝑋#[ ± 𝑡 ∗ +
𝑛Q 𝑛[
q t* is obtained from the t distribution with df = 30-1 = 29
Example
q A 90% confidence interval for
µ1 - µ2

𝑠Q[ 𝑠[[
𝑋#Q − 𝑋#[ ± 𝑡 ∗ +
𝑛Q 𝑛[

q t* = 1.699
Example
q A 90% confidence interval for µ1 - µ2

𝑠Q[ 𝑠[[ 14.26[ 17.50[


𝑋#Q − 𝑋#[ ± 𝑡 ∗ + = 34.53 − 23.70 ± 1.699 + = (3.83,17.83)
𝑛Q 𝑛[ 30 30

q We are 90% confident that the interval from 3.83 to 17.83


centimeters captures the difference in the actual mean DBH of
the southern trees and the actual mean DBH of the northern
trees. This interval suggests that the mean diameter of the
southern trees is between 3.83 and 17.83 cm larger than the
mean diameter of the northern trees.
Two-sample t test
Suppose the Random, Normal, and Independence conditions
are met. To test 𝐻C : 𝜇Q − 𝜇[ = 0, compute the t statistic

𝑋#Q − 𝑋#[
𝑇=
𝑠Q[ 𝑠[[
+
𝑛Q 𝑛[

The P-value is calculated using the t distribution with


degrees of freedom equal to the smaller of n1 – 1 and n2 – 1.
Two-sample t test
Let tobs be the observed value of the t test statistic
q If Ha: µ1 - µ2 >0, the P-value is the area under the t curve to the right of tobs
q If Ha: µ1 - µ2 <0, the P-value is the area under the t curve to the left of tobs
q If Ha: µ1 - µ2 >0, the P-value is the area under the t curve to the right of
|tobs | and to the left of - |tobs |
Two-sample t test
Suppose the Random, Normal, and Independence conditions
are met. To test 𝐻C : 𝜇Q − 𝜇[ = 𝑑C , compute the t statistic

(𝑋#Q −𝑋#[ ) − 𝑑C
𝑇=
𝑠Q[ 𝑠[[
+
𝑛Q 𝑛[

The P-value is calculated using the t distribution with


degrees of freedom equal to the smaller of n1 – 1 and n2 – 1.
Example
Does increasing the amount of calcium in our diet reduce blood
pressure?
Researchers designed a randomized comparative experiment. The
subjects were 21 healthy men who volunteered to take part in the
experiment. They were randomly assigned to two groups: 10 of the men
received a calcium supplement for 12 weeks, while the control group of
11 men received a placebo pill that looked identical. The experiment
was double-blind.
The response variable is the change in the systolic (top number) blood
pressure (after – before) during the 12 weeks in millimeters of mercury.
Example: Hypotheses
q µ1 = true mean change in systolic blood pressure for
healthy men like the ones in this study who take a placebo
q µ2 = true mean change in systolic blood pressure for
healthy men like the ones in this study who take a calcium
supplement
q We test
H0: µ1 – µ2 = 0 versus Ha: µ1 – µ2 > 0
Example: Checking Assumptions
ü Random: The 21 subjects were randomly assigned to the two treatments.
ü Normal: Boxplots show no clear evidence of skewness and no outliers. With no
outliers or clear skewness, the t procedures should be pretty accurate.
Normal Q−Q Plot Normal Q−Q Plot

● ●

5
10

10


5

0

5
0

● ●

Sample Quantiles

Sample Quantiles
−5
response

● ● ●

0
−5

−10



−10

−5

−15
−15

−10
● ●

calcium placebo −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5

group Theoretical Quantiles Theoretical Quantiles

ü Independence: Due to the random assignment, the two samples may be


regarded as independent of each other.
Example
Sample Size Sample Mean Sample SD
Placebo 𝑛Q = 11 𝑥̅Q = −0.45 𝑠Q = 5.50
Calcium 𝑛[ = 10 𝑥̅[ = −5 𝑠[ = 8.74

q Test statistic

𝑋#Q − 𝑋#[ (−0.45) − (−5) 4.55


𝑇= = = = 1.41
𝑠Q[ 𝑠[[ 5.50[ 8.74[ 5.50[ 8.74[
+ +
+ 11 10 11 10
𝑛Q 𝑛[
Example
q H0: µ1 – µ2 = 0 versus Ha: µ1 – µ2 > 0
q Test statistic t=1.41
q P-value:
§ Use conservative df=10-1=9
§ The area under t9 curve to the right of 1.41
§ It is between 0.05 and 0.1.
§ If using software, the P-value is 0.096. Assuming H0: µ1 – µ2 = 0 is true, the
probability of getting a difference in mean blood pressure change for the two
groups (placebo-calcium) of 4.55 or greater just by the chance involved in the
random assignment is 0.096.
Example
q H0: µ1 – µ2 = 0 versus Ha: µ1 – µ2 > 0
q Test statistic t=1.41
q P-value is between 0.05 and 0.1.
q At the significance level 0.05, because the P-value is greater than α
= 0.05, we fail to reject H0. The experiment provides some evidence
that calcium reduces blood pressure, but the evidence is not
convincing enough to conclude that calcium reduces blood pressure
more than a placebo.
Robustness of the two-sample t
procedure
q The two-sample t procedures are more robust than the
one-sample t methods, particularly when the distributions
are not symmetric.
q Except in the case of small samples, the condition that the
data are SRSs from the populations of interest is more
important than the condition that the population
distributions are Normal.
Robustness of the two-sample t
procedure
q The two-sample t procedures are more robust than the
one-sample t methods, particularly when the distributions
are not symmetric.
q Except in the case of small samples, the condition that the
data are SRSs from the populations of interest is more
important than the condition that the population
distributions are Normal.
Robustness of the two-sample t
procedure
q Sum of the sample sizes less than 15: Use t procedures if the data
appear close to Normal. If the data are clearly skewed or if outliers
are present, do not use t.
q Sum of the sample size at least 15: The t procedures can be used
except in the presence of outliers or strong skewness.
q Large samples: The t procedures can be used even for clearly
skewed distributions when the sum of the sample sizes is large.
What if there are outliers
q Deletion
q Nonparametric tests
§ Sign test
§ Mann-Whitney U-test
§ Kolmogorov-Smirnov Test
§ However, usually nonparametric tests are not powerful.
Approximation to the distribution of
the two-sample t statistic
q The exact distribution of the two-sample t statistic is not a
t distribution.
q A more accurate approximation: use a t distribution with
2
! s12 s22 $
# + &
" n1 n2 %
df = 2 2
1 s1! 2$ !
1 s22 $
# & + # &
n1 −1 " n1 % n2 −1 " n2 %

§ This approximation is accurate when both sample sizes are 5 or


larger.
Pooled two-sample procedure
There are two versions of the two-sample t-test:
q one not assuming equal variance (“unequal” variance,
as we have studied) for the two populations.
q one assuming equal variance (“pooled two-sample
test”)
q They have slightly different formulas and degrees of
freedom.
Pooled two-sample procedure
q Suppose both populations are Normal and they have the
same standard deviations, i.e. 𝑁 𝜇Q , 𝜎 and 𝑁 𝜇[ , 𝜎
q Pooled two-sample t statistic
F#d GF#f G Hd GHf
𝑇jkklm^ = d d
~𝑡AdoAfG[ exactly
Un o
Ld Lf

[ [
𝑛Q − 1 𝑠Q + 𝑛[ − 1 𝑠[
𝑠j[ =
𝑛Q + 𝑛[ − 2
Pooled two-sample procedure
q A level C confidence interval for µ1 − µ2 is

Q Q
𝑋#Q − 𝑋#[ ± 𝑡 ∗ 𝑠j +
Ad Af

§ 𝑡 ∗ is obtained from the 𝑡Ad oAf G[ distribution


q Test H0: µ1 = µ2 , the pooled two-sample t test statistic is

𝑋#Q − 𝑋#[
𝑇=
1 1
𝑠j +
𝑛Q 𝑛[
§ The P-value is calculated under a 𝑡Ad oAf G[ curve
Test H0: σ1=σ2
q Suppose both populations are 𝑁 𝜇Q, 𝜎Q and 𝑁 𝜇[, 𝜎[ . Draw two
independent SRSs of sizes n1 and n2
Udf
q F statistic: F = JUf
f

§ Always takes positive values.


§ If H0 is true, F statistic value is close to 1.
§ Use the larger sample standard deviation as the numerator and
use the smaller sample standard deviation as the denominator
§ The P-value is the upper-tail area under the F distribution with
𝑛Q − 1 and 𝑛[ − 1
Why Pooled Two-sample t Procedure
q If the conditions are met, pooled two-sample t confidence
intervals are narrower, and pooled two-sample t tests are
more powerful.
q The F test for equal variances is not robust against
deviations from Normality. So the assumption of equal
variances is hard to check, and thus the unequal variance
test is safer.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy