predict(object, newdata, se.fit = FALSE, scale = NULL, df = Inf, 参数:object Object of class inheriting from “lm”. 参数:newdata An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used. 参数:se.fit A switch indicating if standard errors are required. 参数:scale Scale parameter for std.err. calculation. 参数:df Degrees of freedom for scale 参数:interval Type of interval calculation. 参数:level Tolerance/confidence level. 参数:type Type of prediction (response or model term). 参数:terms If type=”terms”, which terms (default is all terms). 参数:na.action function determining what should be done with missing values in newdata. The default is to predict NA. 参数:pred.var the variance(s) for future observations to be assumed for prediction intervals. 参数: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. 例如: > yy<-predict(fm,newdata = data.frame(X1=220,X2=2500),interval='confidence')> yy
fit lwr upr1 135.6 134.1 137.1> yy<-predict(fm,newdata = data.frame(X1=220,X2=2500),interval='prediction')> yy
fit lwr upr1 135.6 130.6 140.5 |
|
来自: 昵称70907282 > 《R语言》