我有一个在R中使用5个变量开发的模型 . 选择线性混合建模方法来开发具有嵌套效应的模型 .

我的模型开发的R代码如下:

model1 <- lmer(Reduction.factor ~ (1|PAI:Open.wind) + 
     (1|PAI:Temp) + (1|PAI:Height)+ (1|PAI:Density)+ PAI  ,
    data = model)

4个参数由PAI嵌套 .

为了了解模型在不同条件下的预测,我为5个参数创建了不同的数字作为数据框(称为“案例研究”) .

它看起来像这样:

Temp    Height  Density PAI Open wind
20.000  0.041   0.033   1.960   30.000
20.000  0.082   0.061   1.960   30.000
20.000  0.122   0.059   1.960   30.000
20.000  0.163   0.061   1.960   30.000
20.000  0.204   0.043   1.960   30.000
20.000  0.245   0.048   1.960   30.000
20.000  0.286   0.052   1.960   30.000
40.000  0.082   0.061   1.960   40.000
40.000  0.122   0.059   1.960   40.000
40.000  0.163   0.061   1.960   40.000
40.000  0.204   0.043   1.960   40.000
40.000  0.245   0.048   1.960   40.000
40.000  0.286   0.052   1.960   40.000

我想通过使用5个参数的值来预测'Reduction.factor' .

所以我把 p1 <- predict(model1,case study) 看到预测..但只有错误(函数(x,n):在newdata中检测到的新级别< - 此消息出现了..

如何通过将这些值用于5个参数来预测“Reduction.factor”?并且..如果我想有置信区间(95%),我应该把'interval ='置信''?

先感谢您 .