在 R studio 中,我收到一个 post hoc 测试 TukeyHSD 的错误,用于具有交互的双向方差分析
In R studio I receive an error for a post hoc test TukeyHSD for a two-way ANOVA with an interaction
这是我输入的所有内容和输出。
two.way <- aov(Facefactor ~ Teamsport + College + College:Teamsport, data = Male_Data_R_Face_Factor)
summary(two.way)
Df Sum Sq Mean Sq F value Pr(>F)
Teamsport 1 0.29 0.2860 0.343 0.559
College 1 0.05 0.0541 0.065 0.799
Teamsport:College 1 1.05 1.0538 1.262 0.263
Residuals 206 171.99 0.8349
TukeyHSD(two.way)
Error in TukeyHSD.aov(two.way) : no factors in the fitted model
In addition: Warning messages:
1: In replications(paste("~", xx), data = mf) :
non-factors ignored: Teamsport
2: In replications(paste("~", xx), data = mf) :
non-factors ignored: College
3: In replications(paste("~", xx), data = mf) :
non-factors ignored: Teamsport, College
确保你的因素是因素:
将此代码放在 aov 之前。
Male_Data_R_Face_Factor <- within(Male_Data_R_Face_Factor, {
Teamsport <- factor(Teamsport)
College <- factor(College)
})
这是我输入的所有内容和输出。
two.way <- aov(Facefactor ~ Teamsport + College + College:Teamsport, data = Male_Data_R_Face_Factor)
summary(two.way)
Df Sum Sq Mean Sq F value Pr(>F)
Teamsport 1 0.29 0.2860 0.343 0.559
College 1 0.05 0.0541 0.065 0.799
Teamsport:College 1 1.05 1.0538 1.262 0.263
Residuals 206 171.99 0.8349
TukeyHSD(two.way)
Error in TukeyHSD.aov(two.way) : no factors in the fitted model In addition: Warning messages: 1: In replications(paste("~", xx), data = mf) : non-factors ignored: Teamsport 2: In replications(paste("~", xx), data = mf) : non-factors ignored: College 3: In replications(paste("~", xx), data = mf) : non-factors ignored: Teamsport, College
确保你的因素是因素: 将此代码放在 aov 之前。
Male_Data_R_Face_Factor <- within(Male_Data_R_Face_Factor, {
Teamsport <- factor(Teamsport)
College <- factor(College)
})