我对新手问题表示歉意,但我是 lme4 的新手。我正在使用 lme4 对三年内由不同类型的土地利用组成的六个地点中蜂群的生存进行建模,并在使用 REML 消除其他竞争模型后生成了以下模型:
land1=lmer(asin(sqrt(prop_survival))~log(area_forage_uncult) + (1|site) + (1|year))
Run Code Online (Sandbox Code Playgroud)
并制作了摘要:
Linear mixed model fit by REML ['lmerMod']
Formula: asin(sqrt(prop_survival)) ~ log(area_forage_uncult) + (1 | site)+ (1 | year))
REML criterion at convergence: -32.7
Scaled residuals:
Min 1Q Median 3Q Max
-1.4914 -0.5867 -0.0323 0.4945 1.7873
Random effects:
Groups Name Variance Std.Dev.
site (Intercept) 0.001080 0.03287
year (Intercept) 0.000000 0.00000
Residual 0.004983 0.07059
Number of obs: 18, groups: site, 6; year, 3
Fixed effects:
Estimate Std. Error t value
(Intercept) -1.33426 0.62653 -2.130
log(area_forage_uncult) 0.13687 0.03618 3.783
Correlation of Fixed Effects:
(Intr)
lg(r_frg_n) -0.999
Run Code Online (Sandbox Code Playgroud)
我现在想做的是使用这个模型来预测养蜂场在给定其他数量的未开垦饲料的情况下的生存率。最好的方法是什么?示例代码会非常有帮助。
这应该是相当简单的(尽管使用可重现的示例会让我更直接......)
如果您有合适的型号land1,那么
## I'm picking arbitrary values here since I don't
## know what's sensible for your system
pframe <- data.frame(area_forage_uncult=200:210)
predict(land1,newdata=pframe,re.form=~0)
Run Code Online (Sandbox Code Playgroud)
该参数re.form=~0告诉predict()函数您想要在人口级别进行预测,而不是针对任何特定年份或地点(即在预测时将随机效应值设置为零)。有关详细信息,请参阅?predict.merMod。
关于该模型我还有其他一些建议:
contrasts=list(year=contr.sum))。| 归档时间: |
|
| 查看次数: |
3152 次 |
| 最近记录: |