利用多水平模型,代码如下:
#Step6 利用Mixed Effects Model探索有统计学意义的SNP
lm<-lmer(fev1a~comb[,c(2)]+time+age+height+weight+basemill+atopy2b+homesm+parentax+newhire+pastexp+(1|index),comb)
tValue<-coef(summary(lm))[2,3]
随机效应结果如下:
Random effects:
Groups Name Variance Std.Dev.
index (Intercept) 80285 283.35
Residual 10585 102.88
Number of obs: 1173, groups: index, 415
查阅帮助后得到可以使用VarCorr(lm)。但是得到结果令人迷惑:
$index
(Intercept)
(Intercept) 80284.65
attr(,"stddev")
(Intercept)
283.3455
attr(,"correlation")
(Intercept)
(Intercept) 1
attr(,"sc")
[1] 102.8819
2水平的方差可以发现。1水平的方差呢?
我的目的是将1、2水平的方差提取出来。
请高手指点迷津……