The Two-Sample t-Test - Furman...

40
The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University May 4, 2006 Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 1 / 10

Transcript of The Two-Sample t-Test - Furman...

Page 1: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

The Two-Sample t-TestMathematics 47: Lecture 30

Dan Sloughter

Furman University

May 4, 2006

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 1 / 10

Page 2: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

The two-sample t-test

I Suppose X1, X2, . . . , Xn and Y1, Y2, . . . , Ym are independentrandom samples from N(µX , σ2) and N(µY , σ2), respectively.

I Suppose we wish to test the hypotheses

H0 : µX = µY

HA : µX > µY .

I If H0 is true, and

S2p =

(n − 1)S2X + (m − 1)S2

Y

n + m − 2,

then

T =X − Y

Sp

√1n + 1

m

has a t-distribution with n + m − 2 degrees of freedom.I For an observed value t of T , the p-value of the test is

P(T ≥ t | H0), with appropriate variations for other alternativehypotheses.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 2 / 10

Page 3: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

The two-sample t-test

I Suppose X1, X2, . . . , Xn and Y1, Y2, . . . , Ym are independentrandom samples from N(µX , σ2) and N(µY , σ2), respectively.

I Suppose we wish to test the hypotheses

H0 : µX = µY

HA : µX > µY .

I If H0 is true, and

S2p =

(n − 1)S2X + (m − 1)S2

Y

n + m − 2,

then

T =X − Y

Sp

√1n + 1

m

has a t-distribution with n + m − 2 degrees of freedom.I For an observed value t of T , the p-value of the test is

P(T ≥ t | H0), with appropriate variations for other alternativehypotheses.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 2 / 10

Page 4: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

The two-sample t-test

I Suppose X1, X2, . . . , Xn and Y1, Y2, . . . , Ym are independentrandom samples from N(µX , σ2) and N(µY , σ2), respectively.

I Suppose we wish to test the hypotheses

H0 : µX = µY

HA : µX > µY .

I If H0 is true, and

S2p =

(n − 1)S2X + (m − 1)S2

Y

n + m − 2,

then

T =X − Y

Sp

√1n + 1

m

has a t-distribution with n + m − 2 degrees of freedom.

I For an observed value t of T , the p-value of the test isP(T ≥ t | H0), with appropriate variations for other alternativehypotheses.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 2 / 10

Page 5: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

The two-sample t-test

I Suppose X1, X2, . . . , Xn and Y1, Y2, . . . , Ym are independentrandom samples from N(µX , σ2) and N(µY , σ2), respectively.

I Suppose we wish to test the hypotheses

H0 : µX = µY

HA : µX > µY .

I If H0 is true, and

S2p =

(n − 1)S2X + (m − 1)S2

Y

n + m − 2,

then

T =X − Y

Sp

√1n + 1

m

has a t-distribution with n + m − 2 degrees of freedom.I For an observed value t of T , the p-value of the test is

P(T ≥ t | H0), with appropriate variations for other alternativehypotheses.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 2 / 10

Page 6: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I In 1861, ten essays by Quintus Curtius Snodgrass appeared in theNew Orleans Crescent. People have wondered whether Snodgrass wasreally Mark Twain.

I To test this hypothesis, eight essays known to have been written byTwain around 1861 were studied. In particular, the proportion ofthree letter words in these eight essays were found to be 0.225, 0.262,0.217, 0.240, 0.230, 0.229, 0.235, and 0.217.

I We will assume these data are from N(µX , σ2).

I The proportion of three letter words in the Snodgrass essays werefound to be 0.209, 0.205, 0.196, 0.210, 0.202, 0.207, 0.224, 0.223,0.220, and 0.201, which we assume to be from N(µY , σ2).

I We wish to test

H0 : µX = µY

HA : µX 6= µY ,

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 3 / 10

Page 7: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I In 1861, ten essays by Quintus Curtius Snodgrass appeared in theNew Orleans Crescent. People have wondered whether Snodgrass wasreally Mark Twain.

I To test this hypothesis, eight essays known to have been written byTwain around 1861 were studied. In particular, the proportion ofthree letter words in these eight essays were found to be 0.225, 0.262,0.217, 0.240, 0.230, 0.229, 0.235, and 0.217.

I We will assume these data are from N(µX , σ2).

I The proportion of three letter words in the Snodgrass essays werefound to be 0.209, 0.205, 0.196, 0.210, 0.202, 0.207, 0.224, 0.223,0.220, and 0.201, which we assume to be from N(µY , σ2).

I We wish to test

H0 : µX = µY

HA : µX 6= µY ,

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 3 / 10

Page 8: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I In 1861, ten essays by Quintus Curtius Snodgrass appeared in theNew Orleans Crescent. People have wondered whether Snodgrass wasreally Mark Twain.

I To test this hypothesis, eight essays known to have been written byTwain around 1861 were studied. In particular, the proportion ofthree letter words in these eight essays were found to be 0.225, 0.262,0.217, 0.240, 0.230, 0.229, 0.235, and 0.217.

I We will assume these data are from N(µX , σ2).

I The proportion of three letter words in the Snodgrass essays werefound to be 0.209, 0.205, 0.196, 0.210, 0.202, 0.207, 0.224, 0.223,0.220, and 0.201, which we assume to be from N(µY , σ2).

I We wish to test

H0 : µX = µY

HA : µX 6= µY ,

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 3 / 10

Page 9: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I In 1861, ten essays by Quintus Curtius Snodgrass appeared in theNew Orleans Crescent. People have wondered whether Snodgrass wasreally Mark Twain.

I To test this hypothesis, eight essays known to have been written byTwain around 1861 were studied. In particular, the proportion ofthree letter words in these eight essays were found to be 0.225, 0.262,0.217, 0.240, 0.230, 0.229, 0.235, and 0.217.

I We will assume these data are from N(µX , σ2).

I The proportion of three letter words in the Snodgrass essays werefound to be 0.209, 0.205, 0.196, 0.210, 0.202, 0.207, 0.224, 0.223,0.220, and 0.201, which we assume to be from N(µY , σ2).

I We wish to test

H0 : µX = µY

HA : µX 6= µY ,

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 3 / 10

Page 10: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I In 1861, ten essays by Quintus Curtius Snodgrass appeared in theNew Orleans Crescent. People have wondered whether Snodgrass wasreally Mark Twain.

I To test this hypothesis, eight essays known to have been written byTwain around 1861 were studied. In particular, the proportion ofthree letter words in these eight essays were found to be 0.225, 0.262,0.217, 0.240, 0.230, 0.229, 0.235, and 0.217.

I We will assume these data are from N(µX , σ2).

I The proportion of three letter words in the Snodgrass essays werefound to be 0.209, 0.205, 0.196, 0.210, 0.202, 0.207, 0.224, 0.223,0.220, and 0.201, which we assume to be from N(µY , σ2).

I We wish to test

H0 : µX = µY

HA : µX 6= µY ,

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 3 / 10

Page 11: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I In 1861, ten essays by Quintus Curtius Snodgrass appeared in theNew Orleans Crescent. People have wondered whether Snodgrass wasreally Mark Twain.

I To test this hypothesis, eight essays known to have been written byTwain around 1861 were studied. In particular, the proportion ofthree letter words in these eight essays were found to be 0.225, 0.262,0.217, 0.240, 0.230, 0.229, 0.235, and 0.217.

I We will assume these data are from N(µX , σ2).

I The proportion of three letter words in the Snodgrass essays werefound to be 0.209, 0.205, 0.196, 0.210, 0.202, 0.207, 0.224, 0.223,0.220, and 0.201, which we assume to be from N(µY , σ2).

I We wish to test

H0 : µX = µY

HA : µX 6= µY ,

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 3 / 10

Page 12: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example (cont’d)

I We compute x = 0.2319, s2X = 0.0002121, y = 0.2097,

s2Y = 0.00009334, and

s2p =

7s2X + 9s2

Y

16= 0.0001453.

I Hence the observed value of T is

t =0.2319− 0.2097

0.01205

√1

8+

1

10

= 3.884.

I The p-value for the test is 2(0.000658722) = 0.00131744.

I Thus we have strong evidence for rejecting H0.

I The R command > t.test(x,y,var.equal=TRUE) will perform theabove analysis if the data are in the vectors x and y.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 4 / 10

Page 13: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example (cont’d)

I We compute x = 0.2319, s2X = 0.0002121, y = 0.2097,

s2Y = 0.00009334, and

s2p =

7s2X + 9s2

Y

16= 0.0001453.

I Hence the observed value of T is

t =0.2319− 0.2097

0.01205

√1

8+

1

10

= 3.884.

I The p-value for the test is 2(0.000658722) = 0.00131744.

I Thus we have strong evidence for rejecting H0.

I The R command > t.test(x,y,var.equal=TRUE) will perform theabove analysis if the data are in the vectors x and y.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 4 / 10

Page 14: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example (cont’d)

I We compute x = 0.2319, s2X = 0.0002121, y = 0.2097,

s2Y = 0.00009334, and

s2p =

7s2X + 9s2

Y

16= 0.0001453.

I Hence the observed value of T is

t =0.2319− 0.2097

0.01205

√1

8+

1

10

= 3.884.

I The p-value for the test is 2(0.000658722) = 0.00131744.

I Thus we have strong evidence for rejecting H0.

I The R command > t.test(x,y,var.equal=TRUE) will perform theabove analysis if the data are in the vectors x and y.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 4 / 10

Page 15: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example (cont’d)

I We compute x = 0.2319, s2X = 0.0002121, y = 0.2097,

s2Y = 0.00009334, and

s2p =

7s2X + 9s2

Y

16= 0.0001453.

I Hence the observed value of T is

t =0.2319− 0.2097

0.01205

√1

8+

1

10

= 3.884.

I The p-value for the test is 2(0.000658722) = 0.00131744.

I Thus we have strong evidence for rejecting H0.

I The R command > t.test(x,y,var.equal=TRUE) will perform theabove analysis if the data are in the vectors x and y.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 4 / 10

Page 16: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example (cont’d)

I We compute x = 0.2319, s2X = 0.0002121, y = 0.2097,

s2Y = 0.00009334, and

s2p =

7s2X + 9s2

Y

16= 0.0001453.

I Hence the observed value of T is

t =0.2319− 0.2097

0.01205

√1

8+

1

10

= 3.884.

I The p-value for the test is 2(0.000658722) = 0.00131744.

I Thus we have strong evidence for rejecting H0.

I The R command > t.test(x,y,var.equal=TRUE) will perform theabove analysis if the data are in the vectors x and y.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 4 / 10

Page 17: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example (cont’d)

I We compute x = 0.2319, s2X = 0.0002121, y = 0.2097,

s2Y = 0.00009334, and

s2p =

7s2X + 9s2

Y

16= 0.0001453.

I Hence the observed value of T is

t =0.2319− 0.2097

0.01205

√1

8+

1

10

= 3.884.

I The p-value for the test is 2(0.000658722) = 0.00131744.

I Thus we have strong evidence for rejecting H0.

I The R command > t.test(x,y,var.equal=TRUE) will perform theabove analysis if the data are in the vectors x and y.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 4 / 10

Page 18: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Definition (The F-distribution)

If U and V are independent random variables with distributions χ2(m) andχ2(n), respectively, then we call the distribution of

F =

U

mV

n

an F-distribution with m and n degrees of freedom, which we denoteF (m, n).

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 5 / 10

Page 19: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Notes on the F-distribution

I If X is F (m, n), then 1X is F (n,m).

I We let Fα,m,n denote the α-quantile of F (m, n).I If X is F (m, n), then P(X ≤ Fα,m,n) = α, and so

P

(1

X≥ 1

Fα,m,n

)= α.

I Hence 1Fα,m,n

= F1−α,n,m.I Example: From Table VIIIb, F0.95,4,7 = 4.12; hence

F0.05,7,4 =1

4.12= 0.243.

I Using the R commands > qf(0.95,4,7) and > qf(0.05,7,4),respectively, we find F0.95,4,7 = 4.120312 and F.05,7,4 = 0.2427001.

I It may be shown that, if X is F (m, n), then

E [X ] =n

n − 2.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 6 / 10

Page 20: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Notes on the F-distribution

I If X is F (m, n), then 1X is F (n,m).

I We let Fα,m,n denote the α-quantile of F (m, n).

I If X is F (m, n), then P(X ≤ Fα,m,n) = α, and so

P

(1

X≥ 1

Fα,m,n

)= α.

I Hence 1Fα,m,n

= F1−α,n,m.I Example: From Table VIIIb, F0.95,4,7 = 4.12; hence

F0.05,7,4 =1

4.12= 0.243.

I Using the R commands > qf(0.95,4,7) and > qf(0.05,7,4),respectively, we find F0.95,4,7 = 4.120312 and F.05,7,4 = 0.2427001.

I It may be shown that, if X is F (m, n), then

E [X ] =n

n − 2.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 6 / 10

Page 21: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Notes on the F-distribution

I If X is F (m, n), then 1X is F (n,m).

I We let Fα,m,n denote the α-quantile of F (m, n).I If X is F (m, n), then P(X ≤ Fα,m,n) = α, and so

P

(1

X≥ 1

Fα,m,n

)= α.

I Hence 1Fα,m,n

= F1−α,n,m.I Example: From Table VIIIb, F0.95,4,7 = 4.12; hence

F0.05,7,4 =1

4.12= 0.243.

I Using the R commands > qf(0.95,4,7) and > qf(0.05,7,4),respectively, we find F0.95,4,7 = 4.120312 and F.05,7,4 = 0.2427001.

I It may be shown that, if X is F (m, n), then

E [X ] =n

n − 2.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 6 / 10

Page 22: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Notes on the F-distribution

I If X is F (m, n), then 1X is F (n,m).

I We let Fα,m,n denote the α-quantile of F (m, n).I If X is F (m, n), then P(X ≤ Fα,m,n) = α, and so

P

(1

X≥ 1

Fα,m,n

)= α.

I Hence 1Fα,m,n

= F1−α,n,m.

I Example: From Table VIIIb, F0.95,4,7 = 4.12; hence

F0.05,7,4 =1

4.12= 0.243.

I Using the R commands > qf(0.95,4,7) and > qf(0.05,7,4),respectively, we find F0.95,4,7 = 4.120312 and F.05,7,4 = 0.2427001.

I It may be shown that, if X is F (m, n), then

E [X ] =n

n − 2.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 6 / 10

Page 23: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Notes on the F-distribution

I If X is F (m, n), then 1X is F (n,m).

I We let Fα,m,n denote the α-quantile of F (m, n).I If X is F (m, n), then P(X ≤ Fα,m,n) = α, and so

P

(1

X≥ 1

Fα,m,n

)= α.

I Hence 1Fα,m,n

= F1−α,n,m.I Example: From Table VIIIb, F0.95,4,7 = 4.12; hence

F0.05,7,4 =1

4.12= 0.243.

I Using the R commands > qf(0.95,4,7) and > qf(0.05,7,4),respectively, we find F0.95,4,7 = 4.120312 and F.05,7,4 = 0.2427001.

I It may be shown that, if X is F (m, n), then

E [X ] =n

n − 2.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 6 / 10

Page 24: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Notes on the F-distribution

I If X is F (m, n), then 1X is F (n,m).

I We let Fα,m,n denote the α-quantile of F (m, n).I If X is F (m, n), then P(X ≤ Fα,m,n) = α, and so

P

(1

X≥ 1

Fα,m,n

)= α.

I Hence 1Fα,m,n

= F1−α,n,m.I Example: From Table VIIIb, F0.95,4,7 = 4.12; hence

F0.05,7,4 =1

4.12= 0.243.

I Using the R commands > qf(0.95,4,7) and > qf(0.05,7,4),respectively, we find F0.95,4,7 = 4.120312 and F.05,7,4 = 0.2427001.

I It may be shown that, if X is F (m, n), then

E [X ] =n

n − 2.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 6 / 10

Page 25: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Notes on the F-distribution

I If X is F (m, n), then 1X is F (n,m).

I We let Fα,m,n denote the α-quantile of F (m, n).I If X is F (m, n), then P(X ≤ Fα,m,n) = α, and so

P

(1

X≥ 1

Fα,m,n

)= α.

I Hence 1Fα,m,n

= F1−α,n,m.I Example: From Table VIIIb, F0.95,4,7 = 4.12; hence

F0.05,7,4 =1

4.12= 0.243.

I Using the R commands > qf(0.95,4,7) and > qf(0.05,7,4),respectively, we find F0.95,4,7 = 4.120312 and F.05,7,4 = 0.2427001.

I It may be shown that, if X is F (m, n), then

E [X ] =n

n − 2.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 6 / 10

Page 26: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Graph of the density of F (4, 7)

0 1 2 3 4 5

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 7 / 10

Page 27: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Comparing variances

I Suppose X1, X2, . . . , Xn and Y1, Y2, . . . , Ym are independentrandom samples from N(µX , σ2

X ) and N(µY , σ2Y ), respectively.

I Then(n−1)S2

X

σ2X

is χ2(n − 1) and(m−1)S2

Y

σ2Y

is χ2(m − 1).

I So(n − 1)S2

X

(n − 1)σ2X

(m − 1)S2Y

(m − 1)σ2Y

=σ2

Y S2X

σ2XS2

Y

is F (n − 1,m − 1).

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 8 / 10

Page 28: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Comparing variances

I Suppose X1, X2, . . . , Xn and Y1, Y2, . . . , Ym are independentrandom samples from N(µX , σ2

X ) and N(µY , σ2Y ), respectively.

I Then(n−1)S2

X

σ2X

is χ2(n − 1) and(m−1)S2

Y

σ2Y

is χ2(m − 1).

I So(n − 1)S2

X

(n − 1)σ2X

(m − 1)S2Y

(m − 1)σ2Y

=σ2

Y S2X

σ2XS2

Y

is F (n − 1,m − 1).

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 8 / 10

Page 29: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Comparing variances

I Suppose X1, X2, . . . , Xn and Y1, Y2, . . . , Ym are independentrandom samples from N(µX , σ2

X ) and N(µY , σ2Y ), respectively.

I Then(n−1)S2

X

σ2X

is χ2(n − 1) and(m−1)S2

Y

σ2Y

is χ2(m − 1).

I So(n − 1)S2

X

(n − 1)σ2X

(m − 1)S2Y

(m − 1)σ2Y

=σ2

Y S2X

σ2XS2

Y

is F (n − 1,m − 1).

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 8 / 10

Page 30: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Comparing variances (cont’d)

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X > σ2

Y .

I If we let F =S2

X

S2Y, then, under H0, F is F (n − 1,m − 1).

I Hence we should reject H0 when we observe large values f of F , withp-value P(F ≥ f | H0).

I To test HA : σ2X < σ2

Y , we reject H0 for small observed values f of F ,in which case the p-value of the test is P(F ≤ f | H0).

I For the two-sided alternative HA : σ2X 6= σ2

Y , we double theappropriate one-sided p-value.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 9 / 10

Page 31: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Comparing variances (cont’d)

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X > σ2

Y .

I If we let F =S2

X

S2Y, then, under H0, F is F (n − 1,m − 1).

I Hence we should reject H0 when we observe large values f of F , withp-value P(F ≥ f | H0).

I To test HA : σ2X < σ2

Y , we reject H0 for small observed values f of F ,in which case the p-value of the test is P(F ≤ f | H0).

I For the two-sided alternative HA : σ2X 6= σ2

Y , we double theappropriate one-sided p-value.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 9 / 10

Page 32: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Comparing variances (cont’d)

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X > σ2

Y .

I If we let F =S2

X

S2Y, then, under H0, F is F (n − 1,m − 1).

I Hence we should reject H0 when we observe large values f of F , withp-value P(F ≥ f | H0).

I To test HA : σ2X < σ2

Y , we reject H0 for small observed values f of F ,in which case the p-value of the test is P(F ≤ f | H0).

I For the two-sided alternative HA : σ2X 6= σ2

Y , we double theappropriate one-sided p-value.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 9 / 10

Page 33: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Comparing variances (cont’d)

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X > σ2

Y .

I If we let F =S2

X

S2Y, then, under H0, F is F (n − 1,m − 1).

I Hence we should reject H0 when we observe large values f of F , withp-value P(F ≥ f | H0).

I To test HA : σ2X < σ2

Y , we reject H0 for small observed values f of F ,in which case the p-value of the test is P(F ≤ f | H0).

I For the two-sided alternative HA : σ2X 6= σ2

Y , we double theappropriate one-sided p-value.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 9 / 10

Page 34: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Comparing variances (cont’d)

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X > σ2

Y .

I If we let F =S2

X

S2Y, then, under H0, F is F (n − 1,m − 1).

I Hence we should reject H0 when we observe large values f of F , withp-value P(F ≥ f | H0).

I To test HA : σ2X < σ2

Y , we reject H0 for small observed values f of F ,in which case the p-value of the test is P(F ≤ f | H0).

I For the two-sided alternative HA : σ2X 6= σ2

Y , we double theappropriate one-sided p-value.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 9 / 10

Page 35: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I For our previous example, supppose the sample from Twain’s writingsis from N(µX , σ2

X ) and the sample from the writings of Snodgrass isfrom N(µY , σ2

Y ).

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X 6= σ2

Y .

I We compute

f =s2X

s2Y

=0.0002121

0.00009334= 2.2723.

I Using F (7, 9), this gives a p-value of 2(0.1250608) = 0.2501216,giving us no evidence for rejecting H0.

I Note: If the data are in the vectors x and y, the R command >var.test(x,y) will perform the above analysis.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 10 / 10

Page 36: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I For our previous example, supppose the sample from Twain’s writingsis from N(µX , σ2

X ) and the sample from the writings of Snodgrass isfrom N(µY , σ2

Y ).

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X 6= σ2

Y .

I We compute

f =s2X

s2Y

=0.0002121

0.00009334= 2.2723.

I Using F (7, 9), this gives a p-value of 2(0.1250608) = 0.2501216,giving us no evidence for rejecting H0.

I Note: If the data are in the vectors x and y, the R command >var.test(x,y) will perform the above analysis.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 10 / 10

Page 37: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I For our previous example, supppose the sample from Twain’s writingsis from N(µX , σ2

X ) and the sample from the writings of Snodgrass isfrom N(µY , σ2

Y ).

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X 6= σ2

Y .

I We compute

f =s2X

s2Y

=0.0002121

0.00009334= 2.2723.

I Using F (7, 9), this gives a p-value of 2(0.1250608) = 0.2501216,giving us no evidence for rejecting H0.

I Note: If the data are in the vectors x and y, the R command >var.test(x,y) will perform the above analysis.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 10 / 10

Page 38: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I For our previous example, supppose the sample from Twain’s writingsis from N(µX , σ2

X ) and the sample from the writings of Snodgrass isfrom N(µY , σ2

Y ).

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X 6= σ2

Y .

I We compute

f =s2X

s2Y

=0.0002121

0.00009334= 2.2723.

I Using F (7, 9), this gives a p-value of 2(0.1250608) = 0.2501216,giving us no evidence for rejecting H0.

I Note: If the data are in the vectors x and y, the R command >var.test(x,y) will perform the above analysis.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 10 / 10

Page 39: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I For our previous example, supppose the sample from Twain’s writingsis from N(µX , σ2

X ) and the sample from the writings of Snodgrass isfrom N(µY , σ2

Y ).

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X 6= σ2

Y .

I We compute

f =s2X

s2Y

=0.0002121

0.00009334= 2.2723.

I Using F (7, 9), this gives a p-value of 2(0.1250608) = 0.2501216,giving us no evidence for rejecting H0.

I Note: If the data are in the vectors x and y, the R command >var.test(x,y) will perform the above analysis.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 10 / 10

Page 40: The Two-Sample t-Test - Furman Universitymath.furman.edu/~dcs/courses/math47/lectures/lecture-31.pdf · The Two-Sample t-Test Mathematics 47: Lecture 30 Dan Sloughter Furman University

Example

I For our previous example, supppose the sample from Twain’s writingsis from N(µX , σ2

X ) and the sample from the writings of Snodgrass isfrom N(µY , σ2

Y ).

I Suppose we wish to test

H0 : σ2X = σ2

Y

HA : σ2X 6= σ2

Y .

I We compute

f =s2X

s2Y

=0.0002121

0.00009334= 2.2723.

I Using F (7, 9), this gives a p-value of 2(0.1250608) = 0.2501216,giving us no evidence for rejecting H0.

I Note: If the data are in the vectors x and y, the R command >var.test(x,y) will perform the above analysis.

Dan Sloughter (Furman University) The Two-Sample t-Test May 4, 2006 10 / 10