Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
703 views
in Technique[技术] by (71.8m points)

In R studio I receive an error for a post hoc test TukeyHSD for a two-way ANOVA with an interaction

This is everything I entered and the output.

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

question from:https://stackoverflow.com/questions/66056951/in-r-studio-i-receive-an-error-for-a-post-hoc-test-tukeyhsd-for-a-two-way-anova

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Be sure that your factors are factors: put this code before aov.

Male_Data_R_Face_Factor <- within(Male_Data_R_Face_Factor, {
  Teamsport  <- factor(Teamsport)
  College <- factor(College)
})

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...