代码:
setwd("C:/Study/MASTER/data")
mydata<-read.csv(file="xxxxxx.csv",header=T)
library(lme4)
library(ape)
varcomp(lme(SLA~1,random=~1|growth.form/sp, data = mydata),1)
得到结果:
growth.form sp Within
0.3318310 0.4072085 0.2609604
以上结果求出的是growth.form/species各个层级的方差相对比例。如果想求intraspecific variation withingrowth.form 和 interspecific variation among growth.form以及 interspecific variation各自的方差,应该怎么求呢?还有就是在上述结果中within的结果是否指的就是intraspecific variationwithin growth.form?