Question

Hello what is the difference between these two in R two ways Anova test:

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

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

as you can see, the first one is "Treatment*Gender" and the last one is "Treatment+Gender"

Which one should i use?

  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
Was it helpful?

Solution

This is a statistics question. Here are nice slides explaining the basics.

The + symbol denotes inclusion of additional explanatory variables. y ~ x1 + x2 + x3 In complicated relationships we may need to include "interaction terms" as variables in the model.y ~ A * B

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top