stats lunch: day 9 intro to factorial anova. review: factorial designs factorial design : any study...

Post on 18-Dec-2015

223 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Stats Lunch: Day 9

Intro to Factorial ANOVA

Review: Factorial Designs

Factorial Design: Any study w/ > 1 Independent Variable

- “Factor” = I.V.

-Allow us to look at the effects of several variables at once

Benefits of the Factorial Design

1. Economical: Can look at several IVs simultaneously

2. Scientific: Allows us to examine:

-Effects of Each IV on the DV

-Effect of the COMBINATION of the IVs on the DV

3. Practical: Can’t really publish papers w/ only 1 IV

Example of a Factorial Design

A researcher is studying depression. Looks at the effects of:

1. Drug Type (Type 1, Type 2)

2. Therapy Type (A, B)

Drug 1 Drug 2Therapy A 10 8Therapy B 2 10

Drug Type

Therapy Type

Cell

The cells in the matrix represent the data from subjects who get a particular combination of the Ivs

EX: Patients who get Drug #2 and Therapy A

Drug1 + TherapyA Drug1 + TherapyB Drug2 + TherapyA Drug2 + TherapyB10 1 6 1111 2 10 1012 2 8 109 3 7 108 2 9 9

Drug 1 Drug 2Therapy A 10 8Therapy B 2 10

Drug Type

Therapy Type

So, really we have four groups of subjects. Our little matrix represents the “cell mean” for each group...

Cell Means: 10 2 8 10

If we changed the design:

1. Drug Type (Type 1, Type 2, Type 3)

2. Therapy Type (Type A, Type B)

It would be a 3 X 2 design (2 IVs: 1 w/ 3 levels, 1 w/ 2)

If we changed the design again:

1. Drug Type (Type 1, Type 2, Type 3)

2. Drug Dose (Dose 1, Dose 2, Dose 3, Dose 4)

3. Therapy Type (Type A, Type B )

It would be a 3 X 4 X 2 design (3 IVs: 1 w/ 3 levels, 1 w/ 4 levels 1 w/ 2)

We call this a 2 X 2 design, because there are two IVs, each with 2 levels (for a total of 4 cells)

• Some alternative names:– Two-way ANOVA (2 IVs)– Three-way ANOVA (3 IVs)

There is no theoretical limit for the # of variables you use, however…

- Statistical Concerns:

-More variables, less power, need more subjects

- Practical Concerns:

- Variables, More difficult to explain what the

hell is going on

Info We Get From Factorial Designs

1. We get the overall effect of each Independent Variable

Mean of Therapy A = 9

Mean of Therapy B = 6

Drug 1 Drug 2Therapy A 10 8Therapy B 2 10

Drug Type

Therapy Type

Mean Of Drug 1 = 9

Mean of Drug 2 = 6

So, we would say there is a Main Effect for both Drug Type and Therapy Type...

Info We Get From Factorial DesignsIn addition to main effects, we also get the effect of combinations of IVS...

0

2

4

6

8

10

12

Drug 1 Drug 2

Drug Type

Dep

ress

ion

Lev

els

Therapy A

Therapy B

The effects of Drug 1 are best when combined w/ Therapy B.

So, the the effect of the IV (Drug) is different at the different levels (Therapy 1 vs. Therapy 2) of the other IV...

Interactions

Interaction: When the effects of an IV are different at the different levels of another IV

-The combined (joint) effects of a pair of IVs on the DV

Important:

So, the effects of 1 IV must be interpreted in terms of the levels of the other IV

THIS DOES NOT MEAN THAT ONE IV DEPENDS ON (INFLUENCES) THE OTHER IV:

THEY ARE STILL INDEPENDENT OF ONE ANOTHER (DRUG TYPE CAN’T INFLUENCE THERAPY TYPE)

Describing Interactions with Graphs

0

2

4

6

8

10

12

Drug 1 Drug 2

Drug Type

Dep

ress

ion

Lev

els

Therapy A

Therapy B

Technically, the correct way to display a factorial design is w/ a bar graph...

If the bars from the two levels of an IV aren’t parallel across the levels of the other IV, there is an interaction

Describing Interactions with Graphs

0

2

4

6

8

10

12

Drug 1 Drug 2

Drug Type

Dep

ress

ion

Lev

els

Therapy A

Therapy B

However, typically people present a line graph

-Doesn’t matter which variable that’s on the X axis

-Usually pick the variable you’re most interested in

-Or the one that makes the most sense

Possible Combinations of Effects From a Factorial Design

1. Only 1 Main Effect Significant

2. Both Main Effects, but not the Interaction

3. Both Main Effects AND the Interaction

4. Only the Interaction is Significant

5. Nothing Significant

Example of 1 Significant Main Effect

Drug 1 Drug 2Therapy A 10 10Therapy B 5 5

0

2

4

6

8

10

12

Drug 1 Drug 2

Therapy A

Therapy B

Example of 2 Significant Main Effect, No Interaction

Drug 1 Drug 2Therapy A 10 5Therapy B 20 15

0

5

10

15

20

25

Drug 1 Drug 2

Therapy A

Therapy B

Example of Sig. Interaction w/ No Main effects

Drug 1 Drug 2Therapy A 10 1Therapy B 1 10

0

2

4

6

8

10

12

Drug 1 Drug 2

Therapy A

Therapy B

So, in this case there is no significant effect of EITHER IV. The interesting findings occur ONLY when you consider the combination of variable

The Morris-Watson Theory of Burger King Safety (2001, 2002, 2003)

Independent Variables:

-Type of Sandwich: Chicken or Hamburger

-Type of Side: Fries or Onion Rings

Interpreting Studies w/ Interactions

Dependent Variable:

-Stomach Pain

EITHER sandwich w/ fries is ok. However, if you get a burger AND onion rings...

Burger X Rings Interaction Effects

Fries RingsChicken 1 1Burger 1 10

Morris-Watson Theory Data

0

2

4

6

8

10

12

Fries Rings

Chicken

Burger

So, there are main effects for both IVs, but..

Interpreting Studies w/ Interactions

If a study has a significant interaction, you must be VERY cautious in interpreting the main effects…

-Sometimes, the Main Effects are important above and beyond the interaction

-Sometimes not...

Example of When Main Effects Still Important

You can typically interpret main effects when the interaction is not a ‘cross-over’ (which is just what it sounds like)

-The overall pattern of results is the same across levels of different variables...

Example

Drug 1 Drug 2Therapy A 5 10Therapy B 2 8

0

2

4

6

8

10

12

Drug 1 Drug 2

Therapy A

Therapy B

But the Interaction

Doesn’t Cross Over

We can interpret the main effects when the interaction effects the magnitude of the results, rather than the overall pattern

Types of Factorial Design

Between Subjects (Completely Randomized Design) : All IVs are Between (Random assignment for all IVs)

-Example: Our 2 X 2 drug study

Within Subjects: All IVs are w/in subjects

-Example: Side effects of our Antidepressants:

-Time of Day: (Morning, Afternoon, Night)

-Time on Drug: (1 month, 2 months, 3 months)

Mixed Design: Some IVs are between subjects, some w/in

-Example:

-Drug Type: Type A or Type B

-Time of Testing: 1 month, 2 months, 3 months

Important Considerations for Factorial Designs

1. Very important to have an equal number of subjects in each cell.

-Particularly w/ a w/in groups design

2. When you Have A Continuous IV

-Not good to do ANOVA (better to do regression)

But if you have to:

-Dichotimize: Splitting a continuous variable at some point

-Median Split: Dichotimize using the median

as your break point

Setting Up a Completely Randomized Design in SPSS

1) Go to Analyze

2) GLM, Univariate

3) Add your DV

4) Add your IVs

Setting Up a Completely Randomized Design in SPSS

5) You’ll probably want to do some plots…

6) And go to “options” for effect sizes, descriptives, etc.

Plots GUI7) Select variable for X axis

8) Select variable for Y axis

9) Click on “add” and then “continue”

Output from a Completely Randomized Design in SPSS

Between-Subjects Factors

10

10

10

10

1

2

Therapy

1

2

Drug

N

Tests of Between-Subjects Effects

Dependent Variable: Score

878.238a 3 292.746 195.164 .000 .973

2989.013 1 2989.013 1992.675 .000 .992

621.613 1 621.613 414.408 .000 .963

255.613 1 255.613 170.408 .000 .914

1.013 1 1.013 .675 .423 .040

24.000 16 1.500

3891.250 20

902.238 19

SourceCorrected Model

Intercept

Therapy

Drug

Therapy * Drug

Error

Total

Corrected Total

Type III Sumof Squares df Mean Square F Sig.

Partial EtaSquared

R Squared = .973 (Adjusted R Squared = .968)a.

Main Effects

Interaction

How to Make a Decent Bar Graph in SPSS (with error bars) You have probably noticed that the figures SPSS automatically spits out are pretty crappy. Hence, you’ll probably want to put a little more effort into it…

Things will be easiest if you set text values to your numeric nominal variables.

1) Go to “Variable View” 2) Click

3) Enter your numeric value here.

4) Enter the text value here, and click “add”

How to Make a Decent Bar Graph in SPSS (with error bars)

1) Go to “Graphs” and then select “Bar”

2) Select “Clustered”

3) And “summaries for groups of cases”

4) Click on “Define”

How to Make a Decent Bar Graph in SPSS (with error bars)

5) Enter your DV (can select if you want to display mean, median, etc.)

6) Enter variable to go on X axis

7) Enter other IV here, and then click on “options”

8) Click to “Display Error Bars”

9) It’s common to have error bars represent one standard error…

How to Make a Decent Bar Graph in SPSS (with error bars)

Hit “Continue” and then “Ok”…

You can double click on the graph in the output file to open the chart editor:

1) Change background color…

2) Font….

3) Move Key, etc.

Can have a bit more control if you go through the “Interactive” modules under graphs.

How to Make a (Sorta) Decent Line Graph in SPSS (with error bars)

1) Same as before, but select Graph…Line

2) Choose “Multiple”

3) Summaries for Groups of Variables

4) Define all your variables, go to options to get your error bars…

5) Same steps as before…

How to Make a (Sorta) Decent Line Graph in SPSS (with error bars)

As you can see, SPSS’s line graphs are pretty crappy no matter what. Better of using Excel for line graphs.

top related