以下是我对昆虫卵量做的分析。想请教的地方用红色标出
'data.frame': 180 obs. of 8 variables:
$ ci : int 1 2 3 4 1 2 3 4 1 2 ...
$ target: Factor w/ 2 levels "A","X": 2 2 2 2 2 2 2 2 2 2 ...
$ origin: Factor w/ 2 levels "C","T": 2 2 2 2 2 2 2 2 2 2 ...
$ size : Factor w/ 2 levels "B","S": 2 1 1 2 1 2 2 1 1 1 ...
其中,target,origin,size是我实验设置的三个变量,ci是每一头虫子我都观察了四次
$ egg : int 72 41 58 39 22 26 24 34 32 13 ...
$ hatch : int 33 15 33 31 5 14 22 11 23 5 ...
$ luanli: num 0.0363 0.0597 0.0317 0.0344 0.0392 ...
$ rate : num 0.458 0.366 0.569 0.795 0.227 ...
后面四个是我的观察值,其中前两个是计数值,后两个是测量值
> md1=lmer(egg~target*origin*size+(1|ci))
> summary(md1)
Linear mixed model fit by REML
正交实验,但是每种处理的重复数不都一样,有的有十几个,有的只有几个,所以是选REML还是ML,还是都不合适,对概念不是很清楚
Formula: egg ~ target * origin * size + (1 | ci)
AIC BIC logLik deviance REMLdev
1422 1454 -700.8 1433 1402
Random effects:
Groups Name Variance Std.Dev.
ci (Intercept) 1.2402e-07 3.5216e-04
Residual 1.7541e+02 1.3244e+01
Number of obs: 180, groups: ci, 4
Fixed effects:
Estimate Std. Error t value
(Intercept) 30.375 3.311 9.174
targetX -10.375 4.352 -2.384
originT 4.408 4.312 1.022
sizeS -6.322 4.494 -1.407
targetX:originT 5.823 5.771 1.009
targetX:sizeS 6.888 5.983 1.151
originT:sizeS 2.850 5.820 0.490
targetX:originT:sizeS -4.555 8.012 -0.569
Correlation of Fixed Effects:
(Intr) targtX orignT sizeS trgX:T trgX:S orgT:S
targetX -0.761
originT -0.768 0.584
sizeS -0.737 0.561 0.566
targtX:rgnT 0.574 -0.754 -0.747 -0.423
targetX:szS 0.553 -0.727 -0.425 -0.751 0.548
originT:szS 0.569 -0.433 -0.741 -0.772 0.553 0.580
trgtX:rgT:S -0.413 0.543 0.538 0.561 -0.720 -0.747 -0.726
> library(car)
> Anova(md1)
Analysis of Deviance Table (Type II tests)
Response: egg
Chisq Df Pr(>Chisq)
target 5.9767 1 0.0145 *
origin 15.1890 1 9.727e-05 ***
size 1.4523 1 0.2282
target:origin 0.7468 1 0.3875
target:size 1.1936 1 0.2746
origin:size 0.0125 1 0.9111
target:origin:size 0.3233 1 0.5697
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> plot(fitted(md1),resid(md1),xlab="Fitted",ylab="Residuals")
> qqnorm(resid(md1),main="")
如何检验模型?混合效应模型该怎么简化?
还有我对数据转换也不是很清楚,我们一般是卵量的数据会进行对数转换,我想知道一般数据转换在什么情况下才需要进行?
感谢解答