R语言predict函数用法


2023年12月16日发(作者:韩语翻译)

R语言predict函数用法

predict(object, newdata, = FALSE, scale = NULL, df = Inf,

interval = c(“none”, “confidence”, “prediction”),

level = 0.95, type = c(“response”, “terms”),

terms = NULL, = ,

= /weights, weights = 1, …)

参数:object

Object of class inheriting from “lm”.

继承类的对象从“lm”。

参数:newdata

An optional data frame in which to look for variables with

which to predict. If omitted, the fitted values are used.

一个可选的数据框寻与预测的变数。如果省略,用来拟合值。

参数:

A switch indicating if standard errors are required.

一个开关,如果需要标准误差。

参数:scale

Scale parameter for . calculation.

尺度参数的计算。

参数:df

Degrees of freedom for scale

度规模的自由。

参数:interval

Type of interval calculation.

区间计算的类型。其中,若interval=“prediction”,则返回在默认置信水平为95%下的置信区间(lwr为区间左端,upr为区间右端);若interval=“confidence”,则返回预测值的预测范围区间。

参数:level

Tolerance/confidence level.

宽容/置信水平。

参数:type

Type of prediction (response or model term).

预测型(反应或模型长期)。

参数:terms

If type=”terms”, which terms (default is all terms).

如果type=”terms”,则默认是所有条款。

参数:

function determining what should be done with missing

values in newdata. The default is to predict NA.

功能确定应做与newdata缺失值,默认预测NA。

参数:

the variance(s) for future observations to be assumed for

prediction intervals.

要承担未来的观测方差(S)的预测区间。

参数:weights

variance weights for prediction. This can be a numeric vector

or a one-sided model formula. In the latter case, it is interpreted

as an expression evaluated in newdata.

预测方差权。这可以是一个数值向量或片面的模型公式。在后一种情况下,它被解释为表达newdata的评价。

例如:

>

upr1 135.6

yy<-predict(fm,newdata

134.1 137.1> yy<-predict(fm,newdata

=

=

(X1=220,X2=2500),interval='confidence')> yy fit lwr

(X1=220,X2=2500),interval='prediction')> yy fit lwr

upr1 135.6 130.6 140.5


本文发布于:2024-09-21 05:42:21,感谢您对本站的认可!

本文链接:https://www.17tex.com/fanyi/5553.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:预测   区间   表达   片面
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议