我试图通过四年(“年”)的处理(“ C”和“ N”添加)研究草地上的莎草植物(Bi)的两栖类。
每种处理分为三个级别(“ C0”,“ C1”,“ C2”和“ N0”,“ N1”,“ N2”)。我尝试使用R中的ezANOVA函数通过重复测量ANOVA方法分析数据。但是它总是失败,而且我找不到哪里出错了。
以下是有关我的数据的一些信息。
C N Year Bi
C0 N0 2011 44.5
C0 N0 2011 59.5
C0 N0 2011 78.4
C0 N0 2011 60.4
C0 N1 2011 102.8
C0 N1 2011 107.7
C0 N1 2011 100.2
C0 N1 2011 80.6
C0 N2 2011 127
C0 N2 2011 151.6
C0 N2 2011 139.6
C0 N2 2011 175.2
C1 N0 2011 142.4
C1 N0 2011 135.2
C1 N0 2011 138.8
C1 N0 2011 132.8
C1 N1 2011 123.4
C1 N1 2011 99.4
C1 N1 2011 107.3
C1 N1 2011 137.26
C1 N2 2011 100.2
C1 N2 2011 112
C1 N2 2011 114.4
C1 N2 2011 108.4
C2 N0 2011 119
C2 N0 2011 136.08
C2 N0 2011 169.6
C2 N0 2011 122.8
C2 N1 2011 105.3
C2 N1 2011 97.6
C2 N1 2011 99.2
C2 N1 2011 94.2
C2 N2 2011 88.2
C2 N2 2011 97.6
C2 N2 2011 112.2
C2 N2 2011 116.8
C0 N0 2012 44.5
C0 N0 2012 59.5
C0 N0 2012 78.4
C0 N0 2012 60.4
C0 N1 2012 102.8
C0 N1 2012 107.7
C0 N1 2012 100.2
C0 N1 2012 80.6
C0 N2 2012 127
C0 N2 2012 151.6
C0 N2 2012 139.6
C0 N2 2012 175.2
C1 N0 2012 142.4
C1 N0 2012 135.2
C1 N0 2012 138.8
C1 N0 2012 132.8
C1 N1 2012 123.4
C1 N1 2012 99.4
C1 N1 2012 107.3
C1 N1 2012 137.26
C1 N2 2012 100.2
C1 N2 2012 112
C1 N2 2012 114.4
C1 N2 2012 108.4
C2 N0 2012 119
C2 N0 2012 136.08
C2 N0 2012 169.6
C2 N0 2012 122.8
C2 N1 2012 105.3
C2 N1 2012 97.6
C2 N1 2012 99.2
C2 N1 2012 94.2
C2 N2 2012 88.2
C2 N2 2012 97.6
C2 N2 2012 112.2
C2 N2 2012 116.8
C0 N0 2013 44.5
C0 N0 2013 59.5
C0 N0 2013 78.4
C0 N0 2013 60.4
C0 N1 2013 102.8
C0 N1 2013 107.7
C0 N1 2013 100.2
C0 N1 2013 80.6
C0 N2 2013 127
C0 N2 2013 151.6
C0 N2 2013 139.6
C0 N2 2013 175.2
C1 N0 2013 142.4
C1 N0 2013 135.2
C1 N0 2013 138.8
C1 N0 2013 132.8
C1 N1 2013 123.4
C1 N1 2013 99.4
C1 N1 2013 107.3
C1 N1 2013 137.26
C1 N2 2013 100.2
C1 N2 2013 112
C1 N2 2013 114.4
C1 N2 2013 108.4
C2 N0 2013 119
C2 N0 2013 136.08
C2 N0 2013 169.6
C2 N0 2013 122.8
C2 N1 2013 105.3
C2 N1 2013 97.6
C2 N1 2013 99.2
C2 N1 2013 94.2
C2 N2 2013 88.2
C2 N2 2013 97.6
C2 N2 2013 112.2
C2 N2 2013 116.8
C0 N0 2014 44.5
C0 N0 2014 59.5
C0 N0 2014 78.4
C0 N0 2014 60.4
C0 N1 2014 102.8
C0 N1 2014 107.7
C0 N1 2014 100.2
C0 N1 2014 80.6
C0 N2 2014 127
C0 N2 2014 151.6
C0 N2 2014 139.6
C0 N2 2014 175.2
C1 N0 2014 142.4
C1 N0 2014 135.2
C1 N0 2014 138.8
C1 N0 2014 132.8
C1 N1 2014 123.4
C1 N1 2014 99.4
C1 N1 2014 107.3
C1 N1 2014 137.26
C1 N2 2014 100.2
C1 N2 2014 112
C1 N2 2014 114.4
C1 N2 2014 108.4
C2 N0 2014 119
C2 N0 2014 136.08
C2 N0 2014 169.6
C2 N0 2014 122.8
C2 N1 2014 105.3
C2 N1 2014 97.6
C2 N1 2014 99.2
C2 N1 2014 94.2
C2 N2 2014 88.2
C2 N2 2014 97.6
C2 N2 2014 112.2
C2 N2 2014 116.8
代码:
dataLong1 <- data.frame(a1=c(data3$C), a2=c(data3$N), a3=c(data3$Year),
a4=c(data3$Bi))
dataLongLong <- reshape(dataLong1, varying=list(c("a1", "a2","a3")),
v.names="Treatment", times=c(1,2,3), direction="long")
dataLong1$a1 <- factor(dataLong1$a1)
colnames(dataLongLong)
dataLong1$a3 <- factor(dataLong1$a3)
dataLongLong$C <- gl(3, 12, length=144, labels=c("C0", "C1", "C2"), ordered=FALSE)
dataLongLong$N <- gl(3, 4, length=3*48, labels=c("N0", "N1", "N2"), ordered=FALSE)
dataLongLong$Year <- gl(4, 36, labels=c("2011", "2012","2013","2014"), ordered=FALSE)
library(ez)
ezANOVA(dataLongLong, dv=.(a4), wid=.(id), within=.(C, N, Year), detailed=TRUE)
我也尝试了很多次并更改了函数中的许多参数,但是它们都失败了。
Warning: Collapsing data to cell means. *IF* the requested effects are a
subset of the full design, you must use the "within_full" argument, else
results may be inaccurate.
Error in ezANOVA_main(data = data, dv = dv, wid = wid, within = within, :
One or more cells is missing data. Try using ezDesign() to check your
data.