predict.20x {s20x} | R Documentation |
Uses the main output and some error messages from R function "predict" but gives you more output. (Error messages are not reliable when used in Splus.)
Note: The data frame, newdata, must have the same column order and data types (e.g. numeric or factor) as those used in fitting the model.
predict.20x(lmfit, newdata, cilevel=0.95, digit=3, print.out=T)
lmfit |
an lm object, i.e. the output from "lm()". |
newdata |
prediction data frame. |
cilevel |
confidence level of the interval. |
digit |
decimal numbers after the point. |
print.out |
if T, print out the prediction matrix. |
frame |
vector or matrix including predicted values, confidence intervals and predicted intervals. |
fit |
prediction values. |
se.fit |
standard error of predictions. |
residual.scale |
residual standard deviations. |
df |
degrees of freedom for residual. |
cilevel |
confidence level of the interval. |
"predict", "predict.lm", "as.data.frame".
# Zoo data data(zoo) attach(zoo) day.type<-factor(day.type) fit1<-lm(log(attendance) ~ time + sun.yesterday + nice.day + day.type + tv.ads) pred.zoo<-data.frame(8,10.8,0,factor(3),1.181) predict.20x(fit1,pred.zoo) # Peruvian Indians data data(peru) attach(peru) fit2<-lm(BP ~ age + years + I(years^2) + weight + height) pred.peru<-data.frame(21,2,2^2,71,1629) predict.20x(fit2,pred.peru)