3324
Comment:
|
3623
|
Deletions are marked like this. | Additions are marked like this. |
Line 24: | Line 24: |
/* Calculate 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>> |
And by calculating the sum of squares (SS) for each group (cell): |
Line 38: | Line 26: |
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>> |
|
Line 39: | Line 29: |
To calculate ''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>> |
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,,''''' |
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.
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:
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 three null hypotheses to be tested:
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.
H03: 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):
|
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
SS4-Wk Placebo = (7-7)2 + (8-7)2 + (6-7)2 + (7-7)2 + (6.5-7)2 = 2.25
4-Week Cocaine = {5.5 3.5 4.5 6 5}, M = 4.9
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
12-Week Placebo = {8 10 13 9 8.5}, M = 9.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
12-Week Cocaine = {5 4.5 4 6 4}, M = 4.7
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
Now, we'll calculate the SSB:
SSB = n [( M4-Wk Placebo - MGroup )2 + ( M4-Wk Cocaine - MGroup)2 + ( M12-Wk Placebo - MGroup )2 + ( M12-Wk Cocaine - MGroup)2]
= 5 [(7 - 6.575 )2 + (4.9 - 6.575)2 + (9.7 - 6.575)2 + (4.7 - 6.575)2]
= 5 [0.180625 + 2.805625 + 9.765625 + 3.515625]
= 5 [16.2675]
= 81.3375
Now, we'll calculate the SSW:
SSW = SS4-Wk Placebo + SS4-Wk Cocaine + SS12-Wk Placebo + SS12-Wk Cocaine