运用回归模型进行预测
You want to predict new values from your regression model 公卫论坛
Save the predictor data in a data frame. Use the predict function, setting the newdataparameter to the data frame:
> m <- lm(y ~ u + v + w) 公卫人
> preds <- data.frame(u=3.1, v=4.0, w=5.5)
> predict(m, newdata=preds)
1
12.31374
These are just the point estimates of the predictions. Use the interval="prediction"argument of predict to obtain the confidence intervals.
附件列表
词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。