公卫百科  > 所属分类  >  R/S+   
[0] 评论[0] 编辑

运用回归模型进行预测

 You want to predict new values from your regression model 公卫家园

Save the predictor data in a data frame. Use the predict function, setting the newdata
parameter 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.

附件列表


0

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

如果您认为本词条还有待完善,请 编辑

上一篇 线性回归的诊断    下一篇 调用R包中的函数

同义词

暂无同义词