R语言predict函数用法

R语言predict函数用法


2024年3月11日发(作者:联想y330笔记本参数)

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


发布者:admin,转转请注明出处:http://www.yc00.com/num/1710127038a1705107.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信