R:具有drop1函数的ANOVA在因子内失败

时间:2015-08-04 00:14:30

标签: r anova

我在方差分析中使用drop1函数用于III型平方和。这在因子之间工作正常但在我添加内部因素时失败。有谁知道我的错误在哪里?谢谢。

# this work fine 
datafilename="https://docs.google.com/spreadsheets/d/1PNHSBMUdPnB_mnP_WrcxYYiwCwN8KHL2Q57KoAoWdAY/pub?gid=0&single=true&output=csv"
data.ex2=read.csv(datafilename,header=1,stringsAsFactors=FALSE)                                   
aov.ex2 = aov(value~Treat*Gender,data=data.ex2  )         

drop1(aov.ex2,.~.,test="F")

## however adding within factors fails

aov.ex3 = aov(value~Treat*Gender*Region  +Error(ID/(Region))+(Gender*Treat)    ,data=data.ex2  )  
# summary works 
summary (aov.ex3)
# but drop1 funcion fails 
drop1(aov.ex3,.~.,test="F")

0 个答案:

没有答案