[R] Prediction Error Calculation

quaildoc just.struttin at gmail.com
Mon Oct 26 21:21:09 CET 2009


Any suggestions?

quaildoc wrote:
> 
> Hello List,
> 
> I am fitting a logistic regression model for some presence/absence type
> data.  I have numerous covariates I am fitting to explain variation, and I
> am using AIC to rank models.  However, I would like to report how well my
> best model (s) do at prediction.  I have looked over the archives and the
> web and have come up with something that gives me what I think is the mean
> prediction error, BUT I am not sure of that. I am sort of unfamiliar with
> these types of statistics.  Here is my code:
> 
> 
> metrics.global<-glm(Type~MPI+IJI+ED+PRD+class2+class3+class5,
> family=binomial, data=metrics)## ##Type is my binary response 0 or 1
> 
> muhat<-metrics.global$fitted.values
> ##assigns the fitted values a name muhat
> global.diag<-glm.diag(metrics.global)
> ##creates a the diagnostic values
> cv.err<-mean((metrics.global$y-muhat)^2/(1-global.diag$h)^2)
> ###calculates cv.err
> cv.err
> 
> 
> My main problem is I am unsure how to interpret what cv.err means for my
> model.  I know that h is a leverage statistic for each observation.  I
> would appreciate some interpretation clarification.
> 
> Thank you.
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Prediction-Error-Calculation-tp26031236p26066845.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list