Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 19: The Two-Factor ANOVA for Independent Groups An extension of the One-Factor ANOVA experiment has more than one independent variable, or ‘factor’.

Similar presentations


Presentation on theme: "Chapter 19: The Two-Factor ANOVA for Independent Groups An extension of the One-Factor ANOVA experiment has more than one independent variable, or ‘factor’."— Presentation transcript:

1 Chapter 19: The Two-Factor ANOVA for Independent Groups An extension of the One-Factor ANOVA experiment has more than one independent variable, or ‘factor’. For example, suppose we were interested in how both caffeine and beer influence response times. You could run two separate studies, one comparing caffeine to a control group, and another comparing beer to another control group. However, a more interesting experiment would be a ‘two-factor’ design and put subjects into one of four categories, which includes beer only, caffeine only and beer and caffeine. Note that for two-factor ANOVAS, the sample size in each group is always the same. Note: we’ll be skipping sections 19.8, 19.9, 19.10 and 19.13 from the book

2 Chapter 19: The Two-Factor ANOVA for Independent Groups Here’s are some summary statistics for an example data set for n=12 subjects in each group (or cell) SS W is the sums of squared deviations from the means within each cell, just like for the 1-Factor ANOVA No BeerBeer No CaffeineMean: 1.08 SS W = 0.66 Mean: 1.16 SS W = 0.54 CaffeineMean: 0.80 SS W = 0.67 Mean: 1.02 SS W = 0.32 Grand mean: 1.02 SS total = 3.07

3 No BeerBeer 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 Response Time (sec) No Caffeine Caffeine It is common to plot the results of Two-Way experiments like this, with error bars representing the standard error of the mean. No BeerBeer No CaffeineMean: 1.08 SS W = 0.66 Mean: 1.16 SS W = 0.54 CaffeineMean: 0.80 SS W = 0.67 Mean: 1.02 SS W = 0.32 Grand mean: 1.02 SS total = 3.07

4 No BeerBeer 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 Response Time (sec) No Caffeine Caffeine What statistical tests can we conduct on these results? 1)Effect of Beer on response times, averaged across Caffeine levels – a ‘main effect’ for Beer 2)Effect of Caffeine on response times, averaged across Beer levels – a ‘main effect for Caffeine 3)Interaction between Caffeine and Beer. A significant interaction means that the main effects do not collectively explain all of the influence of the factors on the dependent variable. Graphically, interactions happen when the lines are not parallel.

5 No BeerBeer 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 Response Time (sec) No Caffeine Caffeine The main effect for rows the difference between the means for the rows, averaging across the columns. No BeerBeer No CaffeineMean: 1.08 SS W = 0.66 Mean: 1.16 SS W = 0.54 CaffeineMean: 0.80 SS W = 0.67 Mean: 1.02 SS W = 0.32 Main effect for ROWS In this example, it is used to test for the effect of Caffeine on response times, averaging across the No Beer and Beer groups. Statistically, its significance is determined by a One-Factor ANOVA, ‘collapsing’ across the columns Graphically, it is a test if to see if the middle of the blue line is different than the middle of the green line.

6 No BeerBeer 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 Response Time (sec) No Caffeine Caffeine The main effect for columns the difference between the means for the columns, averaging across the rows. No BeerBeer No CaffeineMean: 1.08 SS W = 0.66 Mean: 1.16 SS W = 0.54 CaffeineMean: 0.80 SS W = 0.67 Mean: 1.02 SS W = 0.32 Main effect for COLUMNS In this example, it is used to test for the effect of Beer on response times, averaging across the No Caffeine and Caffeine groups. Graphically, it is a test if to see if the midpoint between the blue and green lines differs across the groups (or columns). Statistically, its significance is determined by a One-Factor ANOVA, ‘collapsing’ across the rows

7 No BeerBeerRow means No CaffeineMean: 1.08 SS W = 0.66 Mean: 1.16 SS W = 0.54 Mean: 1.12 CaffeineMean: 0.80 SS W = 0.67 Mean: 1.02 SS W = 0.32 Mean: 0.91 Column meansMean: 0.94Mean: 1.09Grand mean: 1.02 SS total = 3.07 No BeerBeer 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 Response Time (sec) No Caffeine Caffeine Main effects for rows and columns are calculated by averaging the data across rows and columns.

8 We can partition the total variance into these components: SS total SS within cell SS between SS rows SS cols SS rows x cols With degrees of freedom: df total =n total -1 df within cell =n total -RxC SS between df rows =R-1df cols =C-1 df rows x cols =(R-1)(C-1) C (R) is the total number of scores for that column (row)

9 We can partition the total variance into these components: Three F-tests can then be conducted by computing the following four variances: s 2 wc estimates the variance within each cell, or ‘inherent variance’. This is also an estimate of the population variance  2. s 2 wc is used as the denominator for all of the F-tests – just like the 1-way ANOVA s 2 R estimates the inherent variance plus the main effect for the row factor. It increases with variance across the row means. s 2 C estimates the inherent variance plus the main effect for the column factor. It increases with variance across the column means. s 2 RxC estimates the inherent variance plus the interaction effect. If s 2 RxC is small (near s 2 wc ) then the total variance is completely explained by the inherent variance plus the effects of the row and column factors alone. Hence, no interaction between the two factors.

10 The four variances are used to compute the three F-ratios to make the three hypothesis tests about the row factor, column factor and the interaction: tests for the main effect of the row factor and has dfs of (R-1) and (n total – RxC) tests for the main effect of the column factor and has dfs of (C-1) and (n total – RxC) tests for the interaction between the row and column factors and has dfs of (R-1)x(C-1) and (n total – RxC) SourceSSdfs2s2 F RowsSS R R-1SS R /df R s 2 R /s 2 wc ColumnsSS C C-1SS C /df C s 2 C /s 2 wc RxCSS RxC (R-1)x(C-1)SS RxC /df RxC s 2 RxC /s 2 wc Within cellsSS wc n total -RxCSS wc /df wc TotalSS total n total -1 Typically, we conduct a two-factor ANOVA by filling in a table like this:

11 No BeerBeerRow means No CaffeineMean: 1.08 SS W = 0.66 Mean: 1.16 SS W = 0.54 Mean: 1.12 CaffeineMean: 0.80 SS W = 0.67 Mean: 1.02 SS W = 0.32 Mean: 0.91 Column meansMean: 0.94Mean: 1.09Grand mean: 1.02 SS total = 3.07 SourceSSdfs2s2 F RowsSS R 1SS R /df R s 2 R /s 2 wc ColumnsSS C 1SS C /df C s 2 C /s 2 wc RxCSS RxC 1SS RxC /df RxC s 2 RxC /s 2 wc Within cellsSS wc 44SS wc /df wc Total3.0747 We can start filling in the table from our example about beer and caffeine.

12 No BeerBeerRow means No CaffeineMean: 1.08 SS W = 0.66 Mean: 1.16 SS W = 0.54 Mean: 1.12 CaffeineMean: 0.80 SS W = 0.67 Mean: 1.02 SS W = 0.32 Mean: 0.91 Column meansMean: 0.94Mean: 1.09Grand mean: 1.02 SS total = 3.07 SS within = SourceSSdfs2s2 F RowsSS R 1SS R /df R s 2 R /s 2 wc ColumnsSS C 1SS C /df C s 2 C /s 2 wc RxCSS RxC 1SS RxC /df RxC s 2 RxC /s 2 wc Within cells2.18440.0495 Total3.0747 SourceSSdfs2s2 F RowsSS R 1SS R /df R s 2 R /s 2 wc ColumnsSS C 1SS C /df C s 2 C /s 2 wc RxCSS RxC 1SS RxC /df RxC s 2 RxC /s 2 wc Within cellsSS wc 44SS wc /df wc Total3.0747

13 No BeerBeerRow means No CaffeineMean: 1.08 SS W = 0.66 Mean: 1.16 SS W = 0.54 Mean: 1.12 CaffeineMean: 0.80 SS W = 0.67 Mean: 1.02 SS W = 0.32 Mean: 0.91 Column meansMean: 0.94Mean: 1.09Grand mean: 1.02 SS total = 3.07 SourceSSdfs2s2 F Rows0.541 10.98 ColumnsSS C 1SS C /df C s 2 C /s 2 wc RxCSS RxC 1SS RxC /df RxC s 2 RxC /s 2 wc Within cells2.18440.0495 Total3.0747 SS rows =

14 No BeerBeerRow means No CaffeineMean: 1.08 SS W = 0.66 Mean: 1.16 SS W = 0.54 Mean: 1.12 CaffeineMean: 0.80 SS W = 0.67 Mean: 1.02 SS W = 0.32 Mean: 0.91 Column meansMean: 0.94Mean: 1.09Grand mean: 1.02 SS total = 3.07 SS cols = SourceSSdfs2s2 F Rows0.541 10.98 Columns0.281 5.62 RxCSS RxC 1SS RxC /df RxC s 2 RxC /s 2 wc Within cells2.18440.0495 Total3.0747

15 No BeerBeerRow means No CaffeineMean: 1.08 SS W = 0.66 Mean: 1.16 SS W = 0.54 Mean: 1.12 CaffeineMean: 0.80 SS W = 0.67 Mean: 1.02 SS W = 0.32 Mean: 0.91 Column meansMean: 0.94Mean: 1.09Grand mean: 1.02 SS total = 3.07 SS rows x cols = SourceSSdfs2s2 F Rows0.541 10.98 Columns0.281 5.62 RxC0.0641 1.30 Within cells2.18440.0495 Total3.0747

16 SourceSSdfs2s2 FF crit Rows0.541 10.984.06 Columns0.281 5.624.06 RxC0.0641 1.304.06 Within cells2.18440.0495 Total3.0747 We can either use our F-tables (Table E) to find the critical values of F SourceSSdfs2s2 FP-value Rows0.541 10.980.0019 Columns0.281 5.620.0214 RxC0.0641 1.300.2604 Within cells2.18440.0495 Total3.0747 Or, more commonly, we can use our F-calculator to calculate the corresponding p-value for our observed values of F.

17 SourceSSdfs2s2 FP-value Rows0.541 10.980.0019 Columns0.281 5.620.0214 RxC0.0641 1.300.2604 Within cells2.18440.0495 Total3.0747 No BeerBeer 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 Response Time (sec) No Caffeine Caffeine We show a significant main effect for rows (Caffeine) and for Columns (Beer), but not a significant interaction between rows and columns (Caffeine x Beer).

18 12 80 90 100 110 120 130 140 Columns Score Row 1 Row 2 SourceSSdf s 2 Fp-value Rows2629.4201 11.5190.0015 Columns6306.4921 27.6280.0000 RxC779.2601 3.4140.0714 Within10043.67244228.265 Total19758.84447 Let’s play “guess that significance!”

19 Row 1 Row 2 12 70 80 90 100 110 120 130 Columns Score SourceSSdf s 2 Fp-value Rows5431.3091 19.3400.0001 Columns366.7981 1.3060.2593 RxC3354.8651 11.9460.0012 Within12356.37744280.827 Total21509.34947 Guess that significance!

20 Row 1 Row 2 SourceSSdf s 2 Fp-value Rows3946.5961 21.6850.0000 Columns68.6461 0.3770.5423 RxC442.5861 2.4320.1261 Within8007.83844181.996 Total12465.66647 12 90 95 100 105 110 115 120 125 Columns Score Guess that significance!

21 Row 1 Row 2 12 85 90 95 100 105 110 115 Columns Score SourceSSdf s 2 Fp-value Rows7.1431 0.0270.8707 Columns8.7731 0.0330.8568 RxC2547.6901 9.5650.0034 Within11719.07644266.343 Total14282.68247 Guess that significance!

22 Row 1 Row 2 12 95 100 105 110 115 120 125 130 Columns Score SourceSSdf s 2 Fp-value Rows402.8061 1.9060.1743 Columns4266.7561 20.1930.0001 RxC13.7401 0.0650.7999 Within9296.99944211.295 Total13980.29947 Guess that significance!

23 Row 1 Row 2 SourceSSdf s 2 Fp-value Rows4677.5601 20.2830.0000 Columns0.6531 0.0030.9578 RxC6777.1321 29.3870.0000 Within10147.20844230.618 Total21602.55447 12 70 80 90 100 110 120 130 Columns Score Guess that significance!

24 Row 1 Row 2 123 80 85 90 95 100 105 Columns Score SourceSSdf s 2 Fp-value Rows1717.9571 7.2820.0088 Columns4.77322.3860.0100.9899 RxC508.4782254.2391.0780.3463 Within15569.68866235.904 Total17800.89671 Guess that significance!

25 Row 1 Row 2 SourceSSdf s 2 Fp-value Rows439.1491 2.0110.1609 Columns9877.89624938.94822.6190.0000 RxC324.2472162.1230.7420.4799 Within14411.48466218.356 Total25052.77671 Guess that significance!

26 Row 1 Row 2 SourceSSdf s 2 Fp-value Rows608.9761 2.7100.1045 Columns818.7242409.3621.8220.1698 RxC4498.79422249.39710.0100.0002 Within14830.73866224.708 Total20757.23371 Guess that significance! 123 70 80 90 100 110 120 Columns Score

27 n = 12Exercise NoneA littleA lot Diet AMean: 20.73 SS W = 20.01 Mean: 20.12 SS W = 37.86 Mean: 19.21 SS W = 29.84 Diet BMean: 20.83 SS W = 13.14 Mean: 20.57 SS W = 44.59 Mean: 18.08 SS W = 20.27 Grand mean: 19.92 SS total = 235.90 Suppose you wanted to test the effects of diet and exercise on body mass index. You choose two diets (A and B) and three levels of exercise (none, a little, a lot). You then find 12 subjects for each group and obtain the following descriptive statistics: Conduct a two factor ANOVA to determine if there is a main effect for diet, exercise and if there is an interaction between diet and exercise.

28 noneA littleA lot 17.5 18 18.5 19 19.5 20 20.5 21 21.5 Exercise BMI Diet A Diet B First, let’s plot the data with error bars as the standard error of the means.

29 n = 12Exercise NoneA littleA lot Diet AMean: 20.73 SS W = 20.01 Mean: 20.12 SS W = 37.86 Mean: 19.21 SS W = 29.84 Mean: 20.02 Diet BMean: 20.83 SS W = 13.14 Mean: 20.57 SS W = 44.59 Mean: 18.08 SS W = 20.27 Mean: 19.83 Mean: 20.78Mean: 20.35Mean: 18.64 Grand mean: 19.92 SS total = 235.90 SourceSSdfs2s2 Fp-value Rows SS R R-1SS R /df R s 2 R /s 2 wc Columns SS C C-1SS C /df C s 2 C /s 2 wc RxC SS RxC (R-1)x(C-1)SS RxC /df RxC s 2 RxC /s 2 wc Within cells SS wc n total -RxCSS wc /df wc Total SS total n total -1

30 n = 12Exercise NoneA littleA lot Diet AMean: 20.73 SS W = 20.01 Mean: 20.12 SS W = 37.86 Mean: 19.21 SS W = 29.84 Mean: 20.02 Diet BMean: 20.83 SS W = 13.14 Mean: 20.57 SS W = 44.59 Mean: 18.08 SS W = 20.27 Mean: 19.83 Mean: 20.78Mean: 20.35Mean: 18.64 Grand mean: 19.92 SS total = 235.90 SourceSSdfs2s2 Fp-value Rows 0.701 0.280.5999 Columns 61.23230.6112.190.0000 RxC 8.2624.131.650.2007 Within cells 165.7166 2.51 Total 235.9071

31 No main effect for Rows (Diet) Main effect for Columns (Exercise) No interaction between rows and columns (Diet and Exercise) SourceSSdfs2s2 Fp-value Rows 0.701 0.280.5999 Columns 61.23230.6112.190.0000 RxC 8.2624.131.650.2007 Within cells 165.7166 2.51 Total 235.9071 noneA littleA lot 17.5 18 18.5 19 19.5 20 20.5 21 21.5 Exercise BMI Diet A Diet B


Download ppt "Chapter 19: The Two-Factor ANOVA for Independent Groups An extension of the One-Factor ANOVA experiment has more than one independent variable, or ‘factor’."

Similar presentations


Ads by Google