Docsity

Lecture 3. Experiments with a Single Factor: ANOVA ..., Lecture notes of Statistics

Partial preview of the text

Download Lecture 3. Experiments with a Single Factor: ANOVA ... and more Lecture notes Statistics in PDF only on Docsity!

Lecture 3. Experiments with a Single Factor: ANOVA

Montgomery 3-1 through 3-

Fall, 2005

levels.percent of cotton used in the blend of the materials for the fiber and it has five Investigate the tensile strength of a new synthetic fiber. The factor is the weight Tensile Strength Experiment

weight

tensile strength

of cotton

1

2

3

4

5

total

average

15

7

7

11

15

9

49

20

12

17

12

18

18

77

25

14

18

18

19

19

88

30

19

25

22

19

23

108

35

7

10

11

15

11

54

Fall, 2005

Analysis of Variance

Interested in comparing several treatments.

equality of all treatments at once.Could do numerous two-sample t-tests but this approach does not test

ANOVA provides method of joint inference.

Statistical Model:

y ij

= μ + τ i + 

ij

i

= 1

... a

j

= 1

,... n

i

μ

  • grand mean;

τ i

i th treatment effect;

ij

N

, σ

2 )

  • error

Constraint:

i a

τ i

= 0

.

H Hypotheses:

0 : τ 1 = τ 2 =

τ a

= 0

vs

H 1 : τ i 6

for at least one

i

Fall, 2005

Partitioning

y ij

Notation

-

y i.

n i

j

y ij

y i.

y i. /n

i (treatment sample mean, or row

mean)

-

y ..

=

y ij

y ..

y .. /N

(grand sample mean)

Decomposition of

y ij (^) :

y ij

y ..

  • (

y i.

y .. ) + (

y ij

y i. )

Estimates for parameters:

ˆμ

y ..

ˆτ i

= (

y i.

y .. )

ij

y ij

y i.

residual

So

y ij

as

ˆμ

  • ˆ

τ i

  • ˆ

ij

(^).

-

It can be verified that

i a

n i (^) ˆτ i

= 0

n i

j

ij

for all

i

Fall, 2005

Test Statistic

F

0

=

SS

Treatments

a

−

SS

E / ( N − a ) = ∑

n^

i ( y i.

y .. ) 2 / ( a −

y ij

y i. ) 2 / ( N − a )

MS Mean squares:

Treatments

SS

Treatments

a

−

;

MS

E

SS

E / ( N − a )

E(MSCan show that the expected values are

E )=

σ 2

E(MS

Treatment

) =

σ 2 + ∑ n i τ

i (^2) / ( a

−

Hence, MS

E

is always a good estimator for

σ 2 , that is,

ˆσ 2

=

MS

E

.

Under

H

0 , MS

Treatment

is also an estimator for

σ

2 . F

0

is the ratio of the

mean squares, under

H

0 , it should be around

. Large

F

0

implies deviation

from

H

0 .

What is the sampling distribution of

F

0

under

H

0 ?

Fall, 2005

Sampling Distribution for

F

0

under

H

0

y Based on model: ij

N(

μ

τ i , σ

2 )

and

y i.

N(

μ

τ i , σ

2 /n

i )

j ( y ij

y i. ) 2 /σ

2

∼

χ n 2 i −

1

Therefore

:

SS

E / σ 2 = ∑ i ∑ j ( y

ij

y i. ) 2 /σ

2

∼

χ N 2

(^) −

a

Under

H

0 :

SS

Treatment

/σ

2 = ∑ i n i ( y

i.

−

y .. ) 2 /σ

2

∼

χ

a 2 −

1

SS

E

and SS

Treatment

are independent. So

F

0

=

SS

Treatment

/σ

2 ( a

−

SS

E /σ

2 ( N − a ) = χ 2 ( a −

a

−

χ 2 ( N − a ) / ( N − a ) ∼ F a − 1

,N

(^) −

a

F

(^) -distribution with numerator df

a

−

and denominator df

N

a .

Fall, 2005

Connection to Two-Sample t-Test

a=

Consider the square of the t-test statistic

t 0 2

=

y 1 . −

¯y 2 . ) 2

s pool

/n

1

  • 1

/n

2 ) 2 = n 1 n 2

n 1

n 2 (¯ y 1 . −

¯y 2 . ) 2

s pool 2

n 1 n 2

n 1

n 2 (^) [(¯

y 1 . −

¯y .. )

−

y 2 . −

¯y .. )]

2

s pool 2

n 1 n 2

n 1

n 2 (^) (¯ y 1 . −

¯y .. ) 2 + n 1 n 2

n 1

n 2 (¯ y 2 . −

¯y .. ) 2 − 2 n 1 n 2

n 1

n 2 (^) (¯ y 1 . −

¯y .. )(¯

y 2 . −

¯y .. )

s pool 2

Fall, 2005 Page 10

Consider

¯y ..

n 1 + n 2 ( n 1

j ∑

y 1 j + n 2

j ∑

y 2 j (^) ) =

n 1

n

1

n

2

¯y 1 .

n 2

n 1

n 2

¯y 2 .

One has

t 0 2

=

[

n

1 (¯ y 1 . −

¯y .. ) 2

n

2 (¯ y 2 . −

¯y .. ) 2 ] / (

[

n 1

j

y 1 j

−

¯y

  1. ) 2 + ∑ n 2

j

y 2 j

−

¯y 2 . ) 2 ] / ( n 1 + n 2 −

MS

MSTreatment

E

When

a

, t 02

=

F

0

When

a

, F

(^) -test and two-sample two-sided test are equivalent.

Fall, 2005

option Using SAS (lambs.sas)

nocenter

ps=

ls=80;

data

lambs;

input

diet

wtgain;

cards; 1

8

1 1 16

9

2

9

3 3 173 103 152 182 112 212 16

6

;

Fall, 2005

symbol

bwidth=

i=box;

axis

offset=(5);

proc

gplot;

plot

wtgain*diet

/

frame

haxis=axis1;

proc

glm;

class

diet;

model

wtgain=diet;

output

out=diag

r=res

p=pred;

proc

gplot;

plot

res*diet

/frame

haxis=axis1;

proc

sort;

by pred;

symbol

v=circle

i=sm50;

proc

gplot;

plot

res*pred

/

haxis=axis1;

run;

Fall, 2005

Side-by-Side Boxplot

Fall, 2005

Residual Plot

Fall, 2005

plot

strength*percent/boxstyle=skeletal

pctldef=4;

proc glm; class

percent;

model

strength=percent;

output

out=oneres

p=pred

r=res;

run;

proc sort;

by

pred;

symbol

v=circle

i=sm50;

title

’Residual

Plot’;

proc gplot;

plot res*pred/frame;

run;

proc univariate

data=oneres

normal;

var res;

qqplot

res

/ normal

(L=

mu=est

sigma=est);

histogram

res

/ normal;

run;

symbol

v=circle

i=none;

title

’Plot

of residuals

vs time’;

proc gplot;

plot

res*time

/ vref=

vaxis=-

to

6 by

1;

run;

Fall, 2005

Obs Tensile Strength Example

percent

strength

time

1

15

7

15

2

15

7

19

3

15

15

25

4

15

11

12

5

15

9

6

6

20

12

8

7

20

17

14

8

20

12

1

9

20

18

11

:

:

:

:

16

30

19

22

17

30

25

5

18

30

22

2

19

30

19

24

20

30

23

10

21

35

7

17

22

35

10

21

23

35

11

4

24

35

15

16

25

35

11

23

Fall, 2005