Fixed Random and Mixed Effects ANOVA And Nesting

  • Slides: 20
Download presentation
Fixed, Random, and Mixed Effects ANOVA And Nesting and Crossing of Factors

Fixed, Random, and Mixed Effects ANOVA And Nesting and Crossing of Factors

Sampling Fractions • Sampling fraction, sf, for classification variable = levels in the sample

Sampling Fractions • Sampling fraction, sf, for classification variable = levels in the sample divided by levels in the population. • If the sample includes every level in the population of interest, sf = 1. This is a fixed effect. • If the sample has a random set of levels, then sf = integer/ =0. This is a random effect.

Fixed Effect • Diagnosis given to patient – Melancholic depression – Postpartum depression –

Fixed Effect • Diagnosis given to patient – Melancholic depression – Postpartum depression – Seasonal affective disorder • There are no other levels of diagnosis in which I am interested. • sf = 3/3 = 1.

Random Effect • Dose of experimental therapeutic drug • Population of interest = all

Random Effect • Dose of experimental therapeutic drug • Population of interest = all values from 0 to 100 units of the drug • I randomly select 5 values, using SAS – Do Value=1 To 5; Dose=round(100*Uniform(0)); Output; End; • sf =5/ = 0.

Mixed Effects • Factorial Design: Group (fixed) x Dose (random) • When there are

Mixed Effects • Factorial Design: Group (fixed) x Dose (random) • When there are random effects in the model, one need carefully consider how to compute the F ratios. • It will not always be MSeffect / MSerror

How to Compute F • You want F to be • See page 433

How to Compute F • You want F to be • See page 433 of Howell for the expected values of the mean squares for models that include random factors.

Expected Values for MS • Main effect of group (fixed) – Group + Interaction

Expected Values for MS • Main effect of group (fixed) – Group + Interaction + Error • Main effect of dose (random) – Dose + Error • Interaction of group and dose – Interaction + Error • Within cells error (MSE) – Error

F for Main Effect of Group • If the null is true, group has

F for Main Effect of Group • If the null is true, group has no effect, and we expect the F to equal

F for Main Effect of Dose • If the null is true, dose has

F for Main Effect of Dose • If the null is true, dose has no effect, and we expect the F to equal

F for Main Effect of Interaction • If the null is true, the interaction

F for Main Effect of Interaction • If the null is true, the interaction has no effect, and we expect the F to equal

GLM’s Test Statement Use Test to specify the denominator for any effect where it

GLM’s Test Statement Use Test to specify the denominator for any effect where it should be other than MSE. proc glm; class group dose; model score = group|dose / ss 3; Test H = group E = group*dose; title 'Mixed Effects ANOVA: Group is fixed, dose is random'; run;

Power Considerations • Interaction mean squares typically have few degrees of freedom • This

Power Considerations • Interaction mean squares typically have few degrees of freedom • This can lower power, because MS = SS/df, so the interaction MS tends to be large. • You may be able to enhance power by dropping the interaction term from the model.

Pooled Interaction and Error • If the p for the interaction term ≥. 25,

Pooled Interaction and Error • If the p for the interaction term ≥. 25, drop it from the model. • Its SS and df are now pooled with the error SS and df. • You then use this pooled error term in the denominator of F. proc glm; class group dose; model score = group dose / ss 3; title 'Main Effects Only, Interaction Pooled Within-Cells Error'; run;

Subjects as a Random Factor • What we call “error” is really the effect

Subjects as a Random Factor • What we call “error” is really the effect of subjects (nested within groups). • We pretend that the values for the subjects variable are a random sample of the population of interest. • If we considered subjects to be a fixed factor, we would not need ANOVA, we would have the entire population of interest.

Nested Factors • Suppose one factor was Households and another was Neighborhoods. • Households

Nested Factors • Suppose one factor was Households and another was Neighborhoods. • Households would be nested within Neighborhoods – each household is in only one neighborhood. • If you know the identity of the household, you also know the identity of the neighborhood.

Households Nested Within Neighborhoods Nborhd 1 Nborhd 2 Nborhd 3 H 1 H 6

Households Nested Within Neighborhoods Nborhd 1 Nborhd 2 Nborhd 3 H 1 H 6 H 11 H 2 H 7 H 12 H 3 H 8 H 13 H 4 H 9 H 14 H 5 H 10 H 15

Crossed Factors • Here we have each possible combination of level of Factor A

Crossed Factors • Here we have each possible combination of level of Factor A and level of Factor B. • For example, suppose that one factor is Teachers, the other is Schools, and each teacher taught at each of the three schools. School 1 School 2 School 3 T 1 T 1 T 2 T 2 T 3 T 3

Between Subjects With this design, the subjects factor is nested within each level of

Between Subjects With this design, the subjects factor is nested within each level of the grouping factor(s). Group 1 Group 2 Group 3 S 1 S 4 S 7 S 2 S 5 S 8 S 3 S 6 S 9

Within Subjects With this design, the subjects factor is crossed with the other factor.

Within Subjects With this design, the subjects factor is crossed with the other factor. Condition 1 Condition 2 Condition 3 S 1 S 1 S 2 S 2 S 3 S 3

Omega Squared • Its computation in model with random factors is different than in

Omega Squared • Its computation in model with random factors is different than in models with only fixed effects. • See pages 438 -440 in Howell.