prediction.frame
produces a data frame that contains
the independent variables of a model together with model generated predictions.## S3 method for class 'default':
prediction.frame(object,newdata=NULL,...,
residuals=c("none", "deviance", "pearson", "working",
"standardized", "studentized"))
predict
.lm1 <- lm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)
lm2 <- lm(sr ~ pop15 + pop75 + dpi + ddpi + pop15*dpi, data = LifeCycleSavings)
str(prediction.frame(lm1))
str(prediction.frame(lm1, se.fit=TRUE))
str(prediction.frame(lm1, interval="prediction"))
str(prediction.frame(lm1, type="terms"))
str(prediction.frame(lm1,
se.fit=TRUE,
type="terms"))
str(prediction.frame(lm1,
se.fit=TRUE,
type="terms",
residuals="working"))
str(prediction.frame(lm1,
se.fit=TRUE,
type="terms",
residuals="deviance"))
str(prediction.frame(lm2,
se.fit=TRUE,
type="terms",
residuals="standardized"))
berkeley <- Aggregate(Table(Admit,Freq)~.,data=UCBAdmissions)
berk2 <- glm(cbind(Admitted,Rejected)~Gender+Dept,data=berkeley,family="binomial")
str(prediction.frame(berk2,
se.fit=TRUE,
type="terms",
residuals="studentized"))
Run the code above in your browser using DataLab