R中两种方式Anova测试的差异

时间:2013-06-18 15:11:25

标签: r linear-regression anova

你好,这两者在R两种方式Anova测试中有什么区别:

  1. anova(lm(StressReduction~Treatment*Gender))

  2. anova(lm(StressReduction~Treatment+Gender))

  3. 如您所见,第一个是“治疗*性别”,最后一个是“治疗+性别”

    我应该使用哪一个?

      Treatment Gender StressReduction
    1    medical      F               1
    2    medical      F               1
    3    medical      F               1
    4    medical      F               1
    5    medical      F               2
    6    medical      F               2
    7    medical      F               3
    8    medical      F               3
    9    medical      F               3
    10   medical      F               3
    11   medical      M               1
    12   medical      M               1
    13   medical      M               2
    14   medical      M               2
    15   medical      M               2
    16   medical      M               2
    17   medical      M               2
    18   medical      M               2
    19   medical      M               3
    20   medical      M               3
    21    mental      F               3
    22    mental      F               3
    23    mental      F               4
    24    mental      F               4
    25    mental      F               4
    26    mental      F               4
    27    mental      F               4
    28    mental      F               4
    29    mental      F               5
    30    mental      F               5
    31    mental      M               2
    32    mental      M               2
    33    mental      M               2
    34    mental      M               2
    35    mental      M               3
    36    mental      M               3
    37    mental      M               4
    38    mental      M               4
    39    mental      M               4
    40    mental      M               4
    41  physical      F               1
    42  physical      F               1
    43  physical      F               1
    44  physical      F               1
    45  physical      F               2
    46  physical      F               2
    47  physical      F               3
    48  physical      F               3
    49  physical      F               3
    50  physical      F               3
    51  physical      M               3
    52  physical      M               3
    53  physical      M               4
    54  physical      M               4
    55  physical      M               4
    56  physical      M               4
    57  physical      M               4
    58  physical      M               4
    59  physical      M               5
    60  physical      M               5
    

1 个答案:

答案 0 :(得分:1)

这是一个统计问题。这里有很好的slides解释了基础知识。

+符号表示包含其他解释变量。 y ~ x1 + x2 + x3 在复杂的关系中,我们可能需要在模型中包含“交互术语”作为变量。y ~ A * B