Size: 1910
Comment:
|
Size: 7472
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
When considering the relationship among three or more variables, an '''interaction''' may arise. Interactions describe a situation in which the simultaneous influence of two variables on a third is not additive. Most commonly, interactions are considered in the context of regression analyses, but they may also be evaluated using two-way ANOVA. | = Situations with more than two variables of interest = |
Line 3: | Line 3: |
A simple setting in which interactions can arise is a two-factor experiment analyzed using Analysis of Variance (ANOVA). Suppose we are interested in studying the effects of cocaine on sleep. We might design an experiment to simultaneously test whether both the use of cocaine and the duration of usage affect the number of hours a squirrel will sleep in a night. We might give half of the squirrels we test cocaine, and the other half a placebo (control) substance (the ''substance'' variable). And we might vary the duration of usage by administering cocaine or placebo for one of two possible durations before test, 4 weeks or 12 weeks (the ''duration'' variable). We can then consider the average treatment response (e.g. number of hours slept) for each squirrel, as a function of the treatment combination that was administered (e.g. substance and duration). The following table shows one possible situation: | When considering the relationship among three or more variables, an '''interaction''' may arise. Interactions describe a situation in which the simultaneous influence of two variables on a third is not additive. Most commonly, interactions are considered in the context of '''Multiple Regression'' analyses, but they may also be evaluated using '''Two-Way ANOVA'''. |
Line 5: | Line 5: |
|| 4-Week Control || 4-Week Cocaine || 12-Week Control || 12-Week Cocaine || | == Two-Way ANOVA == [BASIC INFO ABOUT TWO-WAY ANOVA] === An Example Problem === A simple setting in which interactions can arise is a two-factor experiment analyzed using Analysis of Variance (ANOVA). Suppose we are interested in studying the effects of cocaine on sleep. We might design an experiment to simultaneously test whether both the use of cocaine and the duration of usage affect the number of hours a squirrel will sleep in a night. We might give half of the squirrels we test cocaine, and the other half a placebo substance (the ''substance'' variable). And we might vary the duration of usage by administering cocaine or placebo for one of two possible durations before test, 4 weeks or 12 weeks (the ''duration'' variable). We can then consider the average treatment response (e.g. number of hours slept) for each squirrel, as a function of the treatment combination that was administered (e.g. substance and duration). The following table shows one possible situation: ||||||||HOURS SLEPT IN SINGLE NIGHT|| || '''4-Week Placebo (Control)''' || '''4-Week Cocaine''' || '''12-Week Placebo (Control)''' || '''12-Week Cocaine''' || |
Line 12: | Line 19: |
There are '''three null hypotheses''' to be tested. The first two test the effects of each factor under investigation: | |
Line 13: | Line 21: |
have two binary factors A and B. For example, these factors might indicate whether a treatment was administered to a patient, and for how long the treatment was used. We can then consider the average treatment response (e.g. the symptom levels following treatment) for each patient, as a function of the treatment combination that was administered. The following table shows one possible situation: | * H,,01,,: Both substance groups sleep for the same number of hours on average. * H,,02,,: Both treatment duration groups sleep for the same number of hours on average. And the third tests for an interaction between these two factors: * H,,03,,: The two factors are independent or there is no interaction effect. We can start by computing the '''group means''' (for each cell, row, and column): ||||||||GROUP MEANS|| || || '''4-Week''' || '''12-Week''' || '''''All Durations''''' || || '''Placebo''' || 7 || 9.7|| ''8.35'' || || '''Cocaine''' || 4.9 || 4.7 || ''4.8'' || || '''''All Substances''''' || ''5.95'' || ''7.2'' || ''6.575'' || And by calculating the sum of squares (SS) for each group (cell): 4-Week Placebo Dataset = {7 8 6 7 6.5}, ''M'' = 7<<BR>> '''''SS,,4-Wk Placebo,,''''' = (7-7)^2^ + (8-7)^2^ + (6-7)^2^ + (7-7)^2^ + (6.5-7)^2^ = '''2.25'''<<BR>><<BR>> 4-Week Cocaine = {5.5 3.5 4.5 6 5}, ''M'' = 4.9<<BR>> '''''SS,,4-Wk Cocaine,,''''' = (5.5-4.9)^2^ + (3.5-4.9)^2^ + (4.5-4.9)^2^ + (6-4.9)^2^ + (5-4.9)^2^ = '''3.7'''<<BR>><<BR>> 12-Week Placebo = {8 10 13 9 8.5}, ''M'' = 9.7<<BR>> '''''SS,,12-Wk Placebo,,''''' = (8-9.7)^2^ + (10-9.7)^2^ + (13-9.7)^2^ + (9-9.7)^2^ + (8.5-9.7)^2^ = '''15.8'''<<BR>><<BR>> 12-Week Cocaine = {5 4.5 4 6 4}, ''M'' = 4.7<<BR>> '''''SS,,12-Wk Cocaine,,''''' = (5-4.7)^2^ + (4.5-4.7)^2^ + (4-4.7)^2^ + (6-4.7)^2^ + (4-4.7)^2^ = '''2.8'''<<BR>><<BR>> Now, we'll calculate the ''SS,,B,,'':<<BR>> '''''SS,,B,,''''' = ''n'' [( ''M,,4-Wk Placebo,,'' - ''M,,Group,,'' )^2^ + ( ''M,,4-Wk Cocaine,,'' - ''M,,Group,,'')^2^ + ( ''M,,12-Wk Placebo,,'' - ''M,,Group,,'' )^2^ + ( ''M,,12-Wk Cocaine,,'' - ''M,,Group,,'')^2^]<<BR>> = 5 [(7 - 6.575 )^2^ + (4.9 - 6.575)^2^ + (9.7 - 6.575)^2^ + (4.7 - 6.575)^2^]<<BR>> = 5 [0.180625 + 2.805625 + 9.765625 + 3.515625]<<BR>> = 5 [16.2675]<<BR>> = '''81.3375'''<<BR>><<BR>> Now, we'll calculate the ''SS,,W,,'':<<BR>> '''''SS,,W,,''''' = ''SS,,4-Wk Placebo,,'' + ''SS,,4-Wk Cocaine,,'' + ''SS,,12-Wk Placebo,,'' + ''SS,,12-Wk Cocaine,,''<<BR>> = 2.25 + 3.7 + 15.8 + 2.8<<BR>> = '''24.55'''<<BR>><<BR>> '''''df,,W,,''''' = ''N - rc ''<<BR>> = 20 - (2 * 2)<<BR>> = 16<<BR>><<BR>> '''''s,,W,,^2^''''' = ''SS,,W,,'' / ''df,,W,,''<<BR>> = 24.55 / 16<<BR>> = '''1.534375'''<<BR>><<BR>> Now, we'll calculate the ''SS,,R,,'':<<BR>> '''''SS,,R,,''''' = ''n'' [( ''M,,Placebo,,'' - ''M,,Group,,'' )^2^ + ( ''M,, Cocaine,,'' - ''M,,Group,,'')^2^]<<BR>> = 10 [(8.35 - 6.575)^2^ + (4.8 - 6.575)^2^]<<BR>> = 10 [3.150625 + 3.150625]<<BR>> = 10 [6.30125]<<BR>> = '''63.0125'''<<BR>><<BR>> '''''df,,R,,''''' = ''r'' - 1<<BR>> = 2-1<<BR>> = '''1'''<<BR>><<BR>> '''''s,,R,,^2^''''' = ''SS,,R,,'' / ''df,,R,,''<<BR>> = 63.0125 / 1<<BR>> = '''63.0125'''<<BR>><<BR>> Now, we'll calculate the ''SS,,C,,'':<<BR>> '''''SS,,C,,''''' = ''n'' [( ''M,,4-Week,,'' - ''M,,Group,,'' )^2^ + ( ''M,, 12-Week,,'' - ''M,,Group,,'')^2^]<<BR>> = 10 [(5.95 - 6.575)^2^ + (7.2 - 6.575)^2^]<<BR>> = 10 [0.390625 + 0.390625]<<BR>> = 10 [0.78125]<<BR>> = '''7.8125'''<<BR>><<BR>> '''''df,,C,,''''' = ''c'' - 1<<BR>> = 2-1<<BR>> = '''1'''<<BR>><<BR>> '''''s,,C,,^2^''''' = ''SS,,C,,'' / ''df,,C,,''<<BR>> = 7.8125 / 1<<BR>> = '''7.8125'''<<BR>><<BR>> Now, we'll calculate the ''SS,,RC,,'':<<BR>> '''''SS,,RC,,''''' = ''SS,,B,,'' - ''SS,,R,,'' - ''SS,,C,,''<<BR>> = 81.3375 - 63.0125 - 7.8125<<BR>> = 10.5125<<BR>><<BR>> '''''df,,RC,,''''' = (''r'' - 1)(''c'' - 1)<<BR>> = (2-1)(2-1)<<BR>> = '''1'''<<BR>><<BR>> '''''s,,RC,,^2^''''' = ''SS,,RC,,'' / ''df,,RC,,''<<BR>> = 10.5125 / 1<<BR>> = '''10.5125'''<<BR>><<BR>> Now, we'll calculate the ''SS,,T,,'':<<BR>> '''''SS,,T,,''''' = ''SS,,B,,'' + ''SS,,W,'' + ''SS,,R,,'' + ''SS,,C,,''+ ''SS,,RC,,''<<BR>> = 81.3375+ 24.55 + 63.0125 + 7.8125 + 10.5125<<BR>> = 187.225<<BR>><<BR>> '''''df,,T,,''''' = ''N'' - 1<<BR>> = 20-1<<BR>> = '''19'''<<BR>><<BR>> Now, we'll calculate the ''F'' values: '''''F,,R,,''''' = ''s,,R,,^2^'' / ''s,,W,,^2^''<<BR>> = 63.0125 / 1.534375<<BR>> = '''41.06721'''<<BR>><<BR>> '''''F,,C,,''''' = ''s,,C,,^2^'' / ''s,,W,,^2^''<<BR>> = 7.8125 / 1.534375<<BR>> = '''5.09165'''<<BR>><<BR>> '''''F,,RC,,''''' = ''s,,RC,,^2^'' / ''s,,W,,^2^''<<BR>> = 10.5125 / 1.534375<<BR>> = '''6.851324'''<<BR>><<BR>> And, finally, we can organize all of the above into a table, along with the appropriate '''F,,CRIT,,''' values (looked up in a table like [[http://www.medcalc.org/manual/f-table.php|this one]]) that we'll use for comparison and interpretation of our computations: '''F,,CRIT,,''' (1, 16) ,,α=0.5,, = '''4.49''' |||||||||||||| ANOVA TABLE || || '''''Source''''' || '''''SS''''' || '''''df''''' || '''''s^2^''''' || '''''F,,obt,,''''' || '''''F,,crit,,''''' || '''''p''''' || || rows || 63.0125 || 1 || 63.0125 || 41.06721 || 4.49 || ''p'' < 0.05 || || columns || 7.8125 || 1 || 7.8125 || 5.09165 || 4.49 || ''p'' < 0.05 || || r * c || 10.5125 || 1 || 10.5125 || 6.851324 || 4.49 || ''p'' < 0.05 || || within || 24.55 || 16 || 1.534375 || -- || -- || -- || || total || 187.225 || 19 || -- || -- || -- || -- || [INTERPRETATION HERE] == Multiple Regression == [BASIC INFO ABOUT MULTIPLE REGRESSION] |
Situations with more than two variables of interest
When considering the relationship among three or more variables, an interaction may arise. Interactions describe a situation in which the simultaneous influence of two variables on a third is not additive. Most commonly, interactions are considered in the context of Multiple Regression analyses, but they may also be evaluated using Two-Way ANOVA.
[BASIC INFO ABOUT TWO-WAY ANOVA]
A simple setting in which interactions can arise is a two-factor experiment analyzed using Analysis of Variance (ANOVA). Suppose we are interested in studying the effects of cocaine on sleep. We might design an experiment to simultaneously test whether both the use of cocaine and the duration of usage affect the number of hours a squirrel will sleep in a night. We might give half of the squirrels we test cocaine, and the other half a placebo substance (the substance variable). And we might vary the duration of usage by administering cocaine or placebo for one of two possible durations before test, 4 weeks or 12 weeks (the duration variable). We can then consider the average treatment response (e.g. number of hours slept) for each squirrel, as a function of the treatment combination that was administered (e.g. substance and duration). The following table shows one possible situation: HOURS SLEPT IN SINGLE NIGHT 4-Week Placebo (Control) 4-Week Cocaine 12-Week Placebo (Control) 12-Week Cocaine 7.5 5.5 8.0 5.0 8.0 3.5 10.0 4.5 6.0 4.5 13.0 4.0 7.0 6.0 9.0 6.0 6.5 5.0 8.5 4.0 There are H01: Both substance groups sleep for the same number of hours on average. H02: Both treatment duration groups sleep for the same number of hours on average. And the third tests for an interaction between these two factors: H03: The two factors are independent or there is no interaction effect. We can start by computing the GROUP MEANS 4-Week 12-Week All Durations Placebo 7 9.7 8.35 Cocaine 4.9 4.7 4.8 All Substances 5.95 7.2 6.575 And by calculating the sum of squares (SS) for each group (cell): 4-Week Placebo Dataset = {7 8 6 7 6.5}, M = 7 4-Week Cocaine = {5.5 3.5 4.5 6 5}, 12-Week Placebo = {8 10 13 9 8.5}, 12-Week Cocaine = {5 4.5 4 6 4}, Now, we'll calculate the = 5 [(7 - 6.575 )2 + (4.9 - 6.575)2 + (9.7 - 6.575)2 + (4.7 - 6.575)2] Now, we'll calculate the SSW: = 2.25 + 3.7 + 15.8 + 2.8 = 20 - (2 * 2) = 24.55 / 16 Now, we'll calculate the SSR: = 10 [(8.35 - 6.575)2 + (4.8 - 6.575)2] = 2-1 = 63.0125 / 1 Now, we'll calculate the SSC: = 10 [(5.95 - 6.575)2 + (7.2 - 6.575)2] = 2-1 = 7.8125 / 1 Now, we'll calculate the SSRC: = 81.3375 - 63.0125 - 7.8125 = (2-1)(2-1) = 10.5125 / 1 Now, we'll calculate the SST: = 81.3375+ 24.55 + 63.0125 + 7.8125 + 10.5125 = 20-1 Now, we'll calculate the F values: = 63.0125 / 1.534375 = 7.8125 / 1.534375 = 10.5125 / 1.534375 And, finally, we can organize all of the above into a table, along with the appropriate ANOVA TABLE Source SS df s2 Fobt Fcrit p rows 63.0125 1 63.0125 41.06721 4.49 p < 0.05 columns 7.8125 1 7.8125 5.09165 4.49 p < 0.05 r * c 10.5125 1 10.5125 6.851324 4.49 p < 0.05 within 24.55 16 1.534375 -- -- -- total 187.225 19 -- -- -- -- [INTERPRETATION HERE]
[BASIC INFO ABOUT MULTIPLE REGRESSION] Two-Way ANOVA
An Example Problem
SS4-Wk Placebo = (7-7)2 + (8-7)2 + (6-7)2 + (7-7)2 + (6.5-7)2 = 2.25
SS4-Wk Cocaine = (5.5-4.9)2 + (3.5-4.9)2 + (4.5-4.9)2 + (6-4.9)2 + (5-4.9)2 = 3.7
SS12-Wk Placebo = (8-9.7)2 + (10-9.7)2 + (13-9.7)2 + (9-9.7)2 + (8.5-9.7)2 = 15.8
SS12-Wk Cocaine = (5-4.7)2 + (4.5-4.7)2 + (4-4.7)2 + (6-4.7)2 + (4-4.7)2 = 2.8
SSB = n [( M4-Wk Placebo - MGroup )2 + ( M4-Wk Cocaine - MGroup)2 + ( M12-Wk Placebo - MGroup )2 + ( M12-Wk Cocaine - MGroup)2]
81.3375
= 5 [0.180625 + 2.805625 + 9.765625 + 3.515625]
= 5 [16.2675]
=
24.55
=
dfW = N - rc
sW2 = SSW / dfW
= 16
1.534375
=
63.0125
= 10 [3.150625 + 3.150625]
= 10 [6.30125]
=
dfR = r - 1
1
=
sR2 = SSR / dfR
63.0125
=
7.8125
= 10 [0.390625 + 0.390625]
= 10 [0.78125]
=
dfC = c - 1
1
=
sC2 = SSC / dfC
7.8125
=
= 10.5125
dfRC = (r - 1)(c - 1)
1
=
sRC2 = SSRC / dfRC
10.5125
=
= 187.225
dfT = N - 1
19
=
41.06721
=
FC = sC2 / sW2
5.09165
=
FRC = sRC2 / sW2
6.851324
=
FCRIT (1, 16) α=0.5 = 4.49
Multiple Regression