General Factorial Models -...

34
General Factorial Models In Chapter 8 in Oehlert STAT:5201 Week 9 - Lecture 2 1 / 34

Transcript of General Factorial Models -...

Page 1: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

In Chapter 8 in Oehlert

STAT:5201

Week 9 - Lecture 2

1 / 34

Page 2: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

It is possible to have many factors in a factorial experiment.

In DDD we saw an example of a 3-factor study with ball size, height,and surface affecting bounce time (Chapter 2 Example 2.2).

2 / 34

Page 3: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

The general set-up can be extended to many factors, but higher-orderinteractions can be bothersome to deal with. Recall that a 3-factorinteraction, like (αβγ)ijk , describes how a 2-factor interaction changesdepending on the level of the third factor.

3 / 34

Page 4: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

Three-Factor Factorial Effects Models

Full Model (includes interaction):

Yijkl = µ+ αi + βj + γk + (αβ)ij + (αγ)ik + (βγ)jk + (αβγ)ijk + εijk

with εijkiid∼ N(0, σ2) for i = 1, . . . , a

j = 1, . . . , bk = 1, . . . , c

and l = 1, . . . , n for a balanced design.

Restriction for estimation of parameters as sum-to-zero constraints:

0 =a∑

i=1

αi =b∑

j=1

βj =c∑

i=1

γk =a∑

i=1

(αβ)ij =b∑

j=1

(αβ)ij = . . . =k∑

i=1

(αβγ)ijk

4 / 34

Page 5: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

Three-Factor Factorial Effects Models

The degrees of freedom work as before:

Source df

A a-1B b-1C c-1AB (a-1)(b-1)AC (a-1)(c-1)BC (b-1)(c-1)ABC (a-1)(b-1)(c-1)error[1] abc(n-1)

c. total[1] abcn-1

[1] Above df for error and c. total are from a balanced design with ‘n’observations in each of the a×b×c cells.

5 / 34

Page 6: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

Three-Factor Factorial Effects Models

If there is 3-way interaction, then the 2-way interaction for a givenlevel of the 3rd factor differs from the 2-way interaction at a differentlevel of the 3rd factor.

6 / 34

Page 7: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

As we’ve mentioned before, you should check (i.e. test) forhigher-order interactions first before considering lower levelinteractions or main effects.

If the higher-order interaction is significant, then you shouldn’t lookat the tests for lower-order effects because these tests won’tnecessarily be meaningful.

One way to think about it, if there is interaction, then by doing amain effects test, you are essentially ‘pooling’ things that should notbe pooled (are not similar), and you can get some false impressions ofwhat’s going on with the effects.

7 / 34

Page 8: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

If the higher-order interaction is significant, one option is to fit thefull model, then perform a kind of ‘slice’ analysis (a special contrast)which will perform a separate hypothesis test for differing levels of afactor (see graphic below). We saw this in an earlier 2-way interactionexample...

Or you could also physically partition the data into parts and doseparate analyses, but some power is lost because you’ll have fewer dffor error in each separate analysis compared to when the data are alltogether.

8 / 34

Page 9: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

The simplest scenario is when no higher-order interactions arepresent, and we can just consider a main effects model. In that case,we can fit a model where the interactions terms are removed from themodel and are placed in the error term.

9 / 34

Page 10: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

The next example is a special case of the general factorial design withk factors, all at two levels, or a 2k design.

Graphical representation of a 23 design.

From Montgomery, D.C. (2014) Applied statistics and probability for engineers.

10 / 34

Page 11: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

An engineer is interested in the effects of the following factors on life (inhours) of a machine tool:

cutting angle (0=low, 1=high)tool geometry (0=first shape, 1=second shape)cutting speed (0=low,1=high).

Three runs are done for each combination of factor levels, and all runs aredone in random order. This is a completely randomized design (CRD).

Eight treatment groups with n = 3, so N = 24

From D.C. Montgomery (2005). Design and analysis of experiments. John Wiley & Sons: USA.

11 / 34

Page 12: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

12 / 34

Page 13: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

13 / 34

Page 14: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

Diagnostic plots for contant variance and normality.

The diagnostic plots look OK, and the 3-way interaction was notsignificant here (previous slide), so that term could be removed from themodel (which places it in the error term). Or we can leave the 3-wayinteraction term in the model and look at the tests for the 2-wayinteractions in the ANOVA table.

14 / 34

Page 15: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

According to the ANOVA table, the only significant 2-way interaction isbetween angle and speed or angle*speed.

We will visually look at the ‘marginal’ 2-way interaction plot (averagedacross the 3rd factor) for each combination of factors: angle*speed,angle*geometry, and geometry*speed. These plots average overreplicates in a cell and over the levels of the unplotted factor...

15 / 34

Page 16: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

Marginal 2-way interaction plot for angle*geometry (not significant)

This was not a significant interaction in the model.16 / 34

Page 17: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

Marginal 2-way interaction plot for geometry*speed (not significant)

This was not a significant interaction in the model.17 / 34

Page 18: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

Marginal 2-way interaction plot for angle*speed (significant)

This WAS a significant interaction in the model. 18 / 34

Page 19: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

The type of interaction in the angle*speed plot causes concern formaking global statements about the main effects for angle and speed.When angle is low (far left side), speed has a positive effect on life, andwhen angle is high (far right side), speed has a negative effect on life. Theminimal model should include: geometry, angle, speed, angle*speed(following the hierarchy principle).

19 / 34

Page 20: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

Most parsimonious model following hierarchical principle.

We will consider the main effects for geometry and the interaction effectbetween angle*speed with a ‘slice’ option.

20 / 34

Page 21: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

The geometry factor has a simple a main effect.

Averaged over all angles and all speeds, the average lifetime for a tool ofshape=0 is 35.2 hours, while the average lifetime of a tool of shape=1 is46.5 hours.

Holding the speed and angle constant, changing from shape=0 toshape=1 is associated with an increased lifetime of about 11.5 hours.

21 / 34

Page 22: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

Example (SAS: 23 design)

For each angle level (low and high), speed

makes a significant difference on tool

lifetime (slices significant). When angle is

set to low, a high speed gives a longer

lifetime (9.2 hours). When angle is set to

high, then a low speed gives a longer

lifetime (8.5 hours). 22 / 34

Page 23: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models

What if the 3-way interaction had been significant?

How should we proceed?

We’ll consider two options:

1 Subset the data and do separate analyses.

2 Fit the full model to the complete data set and perform a ‘slice’analysis.

23 / 34

Page 24: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Partition data

Let’s partition the data into two parts by the angle factor (low, high),and do an analysis on the factors of geometry and speed for eachpart.

Example (SAS: subset to angle=0)

24 / 34

Page 25: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Partition data

Example (SAS: subset to angle=0)

There is no significant interaction, only main effects.

25 / 34

Page 26: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Partition data

Example (SAS: subset to angle=0)

When angle is set to the low level (angle=0), there is no significantinteraction between geometry and speed.

There is a significant positive speed effect, and a significant positivegeometry effect (both main effects).

26 / 34

Page 27: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Partition data

Example (SAS: subset to angle=1)

27 / 34

Page 28: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Partition data

Example (SAS: subset to angle=1)

There is no significant interaction, only main effects.

28 / 34

Page 29: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Partition data

Example (SAS: subset to angle=1)

When angle is set to the high level (angle=1), there is no significantinteraction between geometry and speed.

There is a significant negative speed effect, and a significant positivegeometry effect (both main effects).

29 / 34

Page 30: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Use ‘slice’ option

One could get a very similar analysis (with more degrees of freedomfor error) by fitting the full model and then ‘slicing’ by angle.

We will approach it that way here.

Example (SAS: full model, slice by angle)

30 / 34

Page 31: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Use ‘slice’ option

Example (SAS: full model, slice by angle)

↑If you compare the Mean Squares in the above ‘slice’ output, they matchthe Mean Squares for the two models we fit in the two subsetted analyses(with 4 separate means), but the F -statistics are different. Why?

31 / 34

Page 32: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Use ‘slice’ option

Example (SAS: full model, slice by angle)

The full model (using all the data and all possible terms) providesσ̂2 = 30.17 with 16 d .f . for the error (output below):

When we subsetted the data into the Angle low, we found σ̂2 = 45.00with 8 d .f . for the error.

When we subsetted the data into the Angle high, we found σ̂2 = 15.33with 8 d .f . for the error.

As we have made the assumption that σ2 is the same across all cell means,the full model estimate of σ2 is a pooled estimate taken from the twosubsetted data sets. They are all estimating the same constant varianceσ2, but we gain in d .f . for the error when we use the pooled estimate.

32 / 34

Page 33: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Use ‘slice’ option

Example (SAS: full model, slice by angle)

Test for a difference in the four means where Angle held constantat either low or high with α = 0.05

H0 : µa11 = µa12 = µa21 = µa22 vs. H1 : not H0

Using the slice option (i.e. using all the data), the threshold forsignificance is F(0.05,3,16) = 3.23

Using the subsetted data, the threshold for significance is F(0.05,3,8) = 4.07

→ The threshold for significance is lower when we have more degrees offreedom for error.

33 / 34

Page 34: General Factorial Models - homepage.stat.uiowa.eduhomepage.stat.uiowa.edu/~rdecook/stat5201/notes/3-23_3-way_factorial.pdf · General Factorial Models Example (SAS: 23 design) According

General Factorial Models: Use ‘slice’ option

Example (SAS: full model, slice by angle)

Plot of residuals vs. predicted from full model colored by angle level.

34 / 34