Factorial ANOVA 2 or More IVs.

Slides:



Advertisements
Similar presentations
Multiple-choice question
Advertisements

One-Way BG ANOVA Andrew Ainsworth Psy 420. Topics Analysis with more than 2 levels Deviation, Computation, Regression, Unequal Samples Specific Comparisons.
Class Exercise. Hays (5 th ed) p. 520  A study involved children of three age groups:  A1=5yrs, A2= 6 years, A3 = 7 years.  Second Factor was formal.
ANOVA With More Than One IV. 2-way ANOVA So far, 1-Way ANOVA, but can have 2 or more IVs. IVs aka Factors. Example: Study aids for exam  IV 1: workbook.
Random Effects & Repeated Measures Alternatives to Fixed Effects Analyses.
Chapter Fourteen The Two-Way Analysis of Variance.
Factorial and Mixed Factor ANOVA and ANCOVA
Two Factor ANOVA.
Analysis – Regression The ANOVA through regression approach is still the same, but expanded to include all IVs and the interaction The number of orthogonal.
Chapter 10 - Part 1 Factorial Experiments.
One-way Between Groups Analysis of Variance
Introduction to Analysis of Variance (ANOVA)
1 Two Factor ANOVA Greg C Elvers. 2 Factorial Designs Often researchers want to study the effects of two or more independent variables at the same time.
If = 10 and = 0.05 per experiment = 0.5 Type I Error Rates I.Per Comparison II.Per Experiment (frequency) = error rate of any comparison = # of comparisons.
ANOVA Chapter 12.
Factorial ANOVA 2 or More IVs. Questions (1)  What are main effects in ANOVA?  What are interactions in ANOVA? How do you know you have an interaction?
Chapter 11 HYPOTHESIS TESTING USING THE ONE-WAY ANALYSIS OF VARIANCE.
Chapter 13 Analysis of Variance (ANOVA) PSY Spring 2003.
Multivariate Analysis. One-way ANOVA Tests the difference in the means of 2 or more nominal groups Tests the difference in the means of 2 or more nominal.
Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way.
Chapter 10: Analyzing Experimental Data Inferential statistics are used to determine whether the independent variable had an effect on the dependent variance.
Psych 5500/6500 Other ANOVA’s Fall, Factorial Designs Factorial Designs have one dependent variable and more than one independent variable (i.e.
General Linear Model 2 Intro to ANOVA.
Lecture 9-1 Analysis of Variance
Chapter 13 - ANOVA. ANOVA Be able to explain in general terms and using an example what a one-way ANOVA is (370). Know the purpose of the one-way ANOVA.
Chapter 14 Repeated Measures and Two Factor Analysis of Variance
Stats/Methods II JEOPARDY. Jeopardy Compare & Contrast Repeated- Measures ANOVA Factorial Design Factorial ANOVA Surprise $100 $200$200 $300 $500 $400.
Chapter 13 Repeated-Measures and Two-Factor Analysis of Variance
Smith/Davis (c) 2005 Prentice Hall Chapter Fifteen Inferential Tests of Significance III: Analyzing and Interpreting Experiments with Multiple Independent.
Simple ANOVA Comparing the Means of Three or More Groups Chapter 9.
1 G Lect 13b G Lecture 13b Mixed models Special case: one entry per cell Equal vs. unequal cell n's.
Factorial BG ANOVA Psy 420 Ainsworth. Topics in Factorial Designs Factorial? Crossing and Nesting Assumptions Analysis Traditional and Regression Approaches.
©2013, The McGraw-Hill Companies, Inc. All Rights Reserved Chapter 4 Investigating the Difference in Scores.
ANOVA: Analysis of Variation
One-Way Between-Subjects Design and Analysis of Variance
ANOVA: Analysis of Variation
ANOVA: Analysis of Variation
SPSS Homework SPSS Homework 12.1 Practice Data from exercise ) Use linear contrasts to compare 5 days vs 20 and 35 days 2) Imagine you.
ANOVA: Analysis of Variation
Statistics for Managers Using Microsoft Excel 3rd Edition
Why is this important? Requirement Understand research articles
Factorial Experiments
Comparing several means: ANOVA (GLM 1)
Between-Subjects, within-subjects, and factorial Experimental Designs
Applied Business Statistics, 7th ed. by Ken Black
Comparing Three or More Means
Chapter 10: Analysis of Variance: Comparing More Than Two Means
Statistics for the Social Sciences
Lesson ANOVA - D Two-Way ANOVA.
Cohen – chapter 13 textbook example
POSC 202A: Lecture Lecture: Substantive Significance, Relationship between Variables 1.
ANalysis Of VAriance (ANOVA)
Random Effects & Repeated Measures
Planned Comparisons & Post Hoc Tests
BIBD and Adjusted Sums of Squares
INTEGRATED LEARNING CENTER
Interactions & Simple Effects finding the differences
CHAPTER 29: Multiple Regression*
Comparing Several Means: ANOVA
Chapter 11 Analysis of Variance
Analysis of Variance (ANOVA)
Introduction to ANOVA.
Main Effects and Interaction Effects
I. Statistical Tests: Why do we use them? What do they involve?
Chapter 12 A Priori and Post Hoc Comparisons Multiple t-tests Linear Contrasts Orthogonal Contrasts Trend Analysis Bonferroni t Fisher Least Significance.
Analysis of Variance: repeated measures
What if. . . You were asked to determine if psychology and sociology majors have significantly different class attendance (i.e., the number of days a person.
Experiments with More Than Two Groups
Exercise 1 Use Transform  Compute variable to calculate weight lost by each person Calculate the overall mean weight lost Calculate the means and standard.
STATISTICS INFORMED DECISIONS USING DATA
Presentation transcript:

Factorial ANOVA 2 or More IVs

Questions (1) What are main effects in ANOVA? What are interactions in ANOVA? How do you know you have an interaction? What does it mean for a design to be completely crossed? Balanced? Orthogonal? Describe each term in a linear model like this one:  

Questions (2) Correctly interpret ANOVA summary tables. Identify mistakes in such tables. What’s the matter with this one? Source SS Df MS F A 512 2 (J-1) 128 B 108 1 (K-1) 54 AxB 96 2 (J-1)(K-1) 48 24 Error 12 5 N-JK 2

Questions (3) Find correct critical values of F from a table or software for a given design. How does post hoc testing for factorial ANOVA differ from post hoc testing in one-way ANOVA? Describe a concrete example of a two-factor experiment. Why is it interesting and/or important to consider both factors in one experiment?

2-way ANOVA So far, 1-Way ANOVA, but can have 2 or more IVs. IVs aka Factors. Example: Study aids for exam IV 1: workbook or not IV 2: 1 cup of coffee or not Workbook (Factor A) Caffeine (Factor B) No Yes Caffeine only Both Neither (Control) Workbook only

Main Effects (R & C means) N=30 per cell Workbook (Factor A) Row Means Caffeine (Factor B) No Yes Caff =80 SD=5 Both =85 82.5 Control =75 Book 77.5 Col Means 80

Main Effects and Interactions Main effects seen by row and column means; Slopes and breaks. Interactions seen by lack of parallel lines. Interactions are a main reason to use multiple IVs

Single Main Effect for B (Coffee only)

Single Main Effect for A (Workbook only)

Two Main Effects; Both A & B Both workbook and coffee

Interaction (1) Interactions take many forms; all show lack of parallel lines. Coffee has no effect without the workbook.

Interaction (2) People with workbook do better without coffee; people without workbook do better with coffee.

Interaction (3) Coffee always helps, but it helps more if you use workbook.

Labeling Factorial Designs Levels – each IV is referred to by its number of levels, e.g., 2X2, 3X2, 4X3 designs. Two by two factorial ANOVA. Cell – treatment combination. Completely Crossed designs –each level of each factor appears at all levels of other factors (vs. nested designs or confounded designs). Balanced – each cell has same n. Orthogonal design – random sampling and assignment to balanced cells in completely crossed design.

Review What are main effects in ANOVA? What are interactions in ANOVA? How do you know you have an interaction? What does it mean for a design to be completely crossed? Balanced? Orthogonal?

Population Effects for 2-way Population main effect associated with the treatment Aj (first factor): Population main effect associated with treatment Bk (second factor): The interaction is defined as , so the linear model is: Each person’s score is a deviation from a cell mean (error). The cell means vary for 3 reasons. The interaction is a residual:

Expected Mean Squares (Factor A has J levels; factor B has K levels; there are n people per cell.) E(MS error) = Note how all terms estimate error. E(MS A) = E(MS B) = E(MS Interaction) =

F Tests Effect F df A J-1, N-JK B K-1, AxB Interaction For orthogonal designs, F tests for the main effects and the interaction are simple. For each, find the F ratio by dividing the MS for the effect of interest by MS error. Effect F df A J-1, N-JK B K-1, AxB Interaction (J-1)(K-1), N-JK

Example Factorial Design (1) Effects of fatigue and alcohol consumption on driving performance. Fatigue Rested (8 hrs sleep then awake 4 hrs) Fatigued (24 hrs no sleep) Alcohol consumption None (control) 2 beers Blood alcohol .08 % DV - performance errors on closed driving course rated by driving instructor.

Cells of the Design M=13 M=7 M=2 M=10 M=18 M=10 Alcohol (Factor A) Orthogonal design; n=2 Fatigue (Factor B) None (J=1) 2 beers (J=2) .08 % (J=3) Tired (K=1) Cell 1 2, 4 M=3 Cell 2 16, 18 M=17 Cell 3 18, 20 M=19 Rested (K=2) Cell 4 0, 2 M=1 Cell 5 Cell 6 M=13 M=7 M=2 M=10 M=18 M=10

Factorial Example Results Main Effects? Interactions? Both main effects and the interaction appear significant. Let’s look.

Data Person DV Cell A alc B rest 1 2 4 3 16 18 5 6 20 7 8 9 10 11 12 8 9 10 11 12 Mean

Total Sum of Squares Person DV Mean D D*D 1 2 10 -8 64 4 -6 36 3 16 6 18 8 5 20 100 7 -10 9 11 12 Total 728

SS Within Cells Person DV Cell Mean D*D 1 2 3 4 16 17 18 5 19 6 20 7 8 8 9 10 11 12 Total

SS A – Effects of Alcohol Person M Level (A) Mean (A) D*D 1 10 2 64 3 4 5 18 6 7 8 9 11 12 Total 512

SS B – Effects of Fatigue Person M Level (B) Mean (B) D*D 1 10 13 9 2 3 4 5 6 7 8 11 12 Total 108

SS Cells – Total Between Person M Cell Mean (Cell) D*D 1 10 3 49 2 17 4 5 19 81 6 7 8 9 11 12 Total 716

Summary Table Source SS df MS F A 512 2 (J-1) 256 128 B 108 1(K-1) 54 Check: Total=Within+Between 728 = 716+12  Source SS Total 728 Between 716 A 512 B 108 Within 12 Interaction = Between – (A+B). Interaction = 716-(512+108) = 96. Source SS df MS F A 512 2 (J-1) 256 128 B 108 1(K-1) 54 AxB 96 2 (J-1)(K-1) 48 24 Error 12 6 (N-JK) 2

Interactions Choose the factor with more levels for X, the horizontal axis. Plot the means. Join the means by lines representing the other factor. The size of the interaction SS is proportional to the lack of parallel lines. If interactions exist, the main effects must be qualified for the interactions. Here, effect of alcohol depends on the amount of rest of the participant.

Software skills Run the drink & drive problem in R Data and code are in Canvas

Review Correctly interpret ANOVA summary tables. Identify mistakes in such tables. What’s the matter with this one? Source SS Df MS F A 512 2 (J-1) 128 B 108 1 (K-1) 54 AxB 96 2 (J-1)(K-1) 48 24 Error 12 5 N-JK 2

Proportions of Variance We can compute R-squared for magnitude of effect, but it’s biased, so the convention is to use omega-squared.

Planned Comparisons Cell Mean C1 C2 1 A1B1 3 -1/3 1/2 2 A2B1 17 -1/4 19 4 A1B2 1 1/3 5 A2B2 6 A3B2 -6 -12 B1 v B2 No alc v others

Planned Comparisons (2) The first comparison (B1 v B2) has a value of –6. For any comparison, Note this is the same as SS for B in the ANOVA. Note 7.348 squared is 54, which is our value of F from the ANOVA. (critical t has dfe)

Planned Comparisons (3) We can substitute planned comparisons for tests of main effects; they are equivalent (if you choose the relevant means). We can also do the same for interactions. In general, there are a total of (Cells-1) independent comparisons we can make (6-1 or 5 in our example). Our second test compared no alcohol to all other conditions. This looks to be the largest comparison with these data.

Post Hoc Tests For post hoc tests about levels of a factor, we pool cells. The only real difference for Tukey HSD and Newman –Keuls is accounting for this difference. For interactions, we are back to comparing cells. Don’t test unless F for the effect is significant. For comparing cells in the presence of an interaction:

Post Hoc (2) In our example A has 3 levels, B has 2. Both were significant. No post hoc for B (2 levels). For A, the column means were 2, 10, and 18. Are they different? A: Yes, all are different because the differences are larger than 3.07. But because of the interaction, the interpretation of differences in A or B are tricky.

Post Hoc (3) For the rested folks, is the difference between no alcohol and 2 beers significant for driving errors? The means are 1 and 3. A: They are not significantly different because 2 is less than 5.63. Note: data are fictitious. Do not drink and drive.

Review Describe each term in a linear model like this one: How does post hoc testing for factorial ANOVA differ from post hoc testing in one-way ANOVA? Describe a concrete example of a two-factor experiment. Why is it interesting and/or important to consider both factors in one experiment?

Higher Order Factorials If you can do ANOVA with 2 factors, you can do it with as many as you like. For 3 factors, you have one 3-way interaction and three 2-way interactions. Computations are simple but tedious. For orthogonal, between-subject designs, all F tests have same denominator. We generally don’t do designs with more than 3 factors. Complex & expensive.

Review R code Download and run R code for driving (post hoc tests), run chocolate example

Hays (5th ed) p. 520 A study involved children of three age groups: A1=5yrs, A2= 6 years, A3 = 7 years. Second Factor was formal preschool experience B1=none, B2=1 year, B3 = more than 1 year Five children were sampled from each combination and given a score on ‘social maturity’ (high scores are more mature)

B1 B2 B3 A1 2 4 6 7 8 11 10 5 9 3 A2 14 15 12 A3 13 18 21

Enter the data into R Print the data to be sure they are correct Be sure the data are arranged in the way R needs to analyze the problem

Run a 2-Way ANOVA on the data What terms are significant What is the interpretation at the level of main effects and interactions from the printout?

Graph the means What is the interpretation of the means according to the graph?

What is the magnitude of effect What is R-square for A, B, and A*B? What is estimated omega-squared for each?

Unbalanced Designs When you can assign to treatment, assign equal numbers in each cell If unequal, unbalanced, and problems with tests Participant mortality, design flaw, population characteristics (e.g., some types of cows more common in the herd) Can delete or impute (but still problem)

All SS Types same if balanced Type I SS – simply sequential in terms of model entry (two-factor study: A, B, AxB) Test A; test B|A ; test AxB|A, B Type II SS- partly sequential, considers terms at the same ‘level’ e.g., A, B test of A considers B but not AxB (A|B; B|A; AxB|A, B) Type III SS – last in – regression SS (A|B, AxB; B|A, AxB; AxB|A, B) Dispute about best approach. SAS uses Type III, R uses Type II. Arguments are difficult to understand (hypotheses tested and model selection).