看到很多坛友对R语言中的Formulas的具体规定不太了解,特意收集了一些相关资料,
可供下载:
另外将主要的应用举例如下:
| Right Side of Formula | Meaning |
| A + B | main effects of A and B |
| A:B | interaction of A with B |
| A*B | main effects and interactions = A + B + A:B |
| A*B*C | main effects and interactions A+B+C+A:B+A:C+B:C+A:B:C |
| (A+B+C)^2 | A, B, and C crossed to level 2: A+B+C+A:B+A:C+B:C |
| A*B*C-A:B:C | same as above: main effects plus 2-way interactions |
| 1 + state + state:county | nested ANOVA |
| 1 + state + county%in%state | nested ANOVA emphasizing county nested in state |
| state / county | nested ANOVA |
| (1 / subject) | fit random intercepts for subjects |
| (1+time / subject) | fit both random intercepts and random subject-specific slopes |