假设我有以下模型结果:
> summary(msa_res@objects[[1]])
Model Results:
estimate se zval pval ci.lb ci.ub
intrcpt 0.9397 0.0667 14.0850 <.0001 0.8090 1.0705 ***
MAT_e -0.0079 0.0035 -2.2691 0.0233 -0.0147 -0.0011 *
Naddl -0.0385 0.0133 -2.9005 0.0037 -0.0645 -0.0125 **
MAT_e
我想使用预测函数和Naddl
主持人绘制回归线:
preds_MAT_e <- predict(msa_res@objects[[1]], newmods=c(-5:30))
preds_Naddl <- predict(msa_res@objects[[1]], newmods=c(1:6))
但我得到这种类型的错误:
Error in predict.rma(msa_res@objects[[1]], newmods = c(-5:30)) :
Dimensions of 'newmods' do not match dimensions of the model.
我想这是因为我没有指定 predict() 函数应该考虑哪个主持人。请注意,上面的函数适用于单变量模型,例如仅使用 MAT_e。