【发布时间】:2021-02-23 01:05:01
【问题描述】:
在我的实验室中,我们使用了统计软件包,但现在我们使用 R 进行统计。
使用统计软件,在进行双向 ANOVA 后,结果表格包括“变异来源”和“总变异百分比”。如何从 R 中获取这些值?
示例: 这个数据集
Temperature <- factor(c(rep("cold", times = 4),
rep("hot", times = 4)),
levels = c("cold", "hot"))
Light <- factor(rep(c(rep("blue", times = 2),
rep("yellow", times = 2)),
times = 2),
levels = c("blue", "yellow"))
Result <- c(90.40, 85.20, 21.70, 25.30,
75.12, 77.36, 6.11, 10.8)
Data <- data.frame(Temperature, Light, Result)
R 中的 2 路方差分析:
two_wayANOVA <- aov(data = Data,
formula = Result ~ Temperature * Light)
summary(two_wayANOVA)
Df Sum Sq Mean Sq F value Pr(>F)
Temperature 1 354 354 42.250 0.00289 **
Light 1 8723 8723 1041.366 5.5e-06 ***
Temperature:Light 1 6 6 0.725 0.44250
Residuals 4 34 8
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
在统计软件中:
【问题讨论】:
-
您可以通过将单个
Sum Sq值除以Sum Sq值的总和来手动计算。前任。Light的情况下,8723/(354+8723+6+34)