[R] cross-validation / sensitivity anaylsis for logistic regression model

Dylan Beaudette dylan.beaudette at gmail.com
Tue May 15 01:38:21 CEST 2007


Hi,

I have developed a logistic regression model in the form of (factor_1~ numeric 
+ factor_2) and  would like to perform a cross-validation or some similar 
form of sensitivity analysis on this model.

using cv.glm() from the boot package:

# dataframe from which model was built in 'z'
# model is called 'm_geo.lrm'

# as suggested in the man page for a binomial model:
cost <- function(r, pi=0) mean(abs(r-pi)>0.5)
cv.10.err <- cv.glm(z, m_geo.lrm, cost, K=10)$delta

I get the following:
cv.10.err
    1     1 
0.275 0.281

Am I correct in interpreting that this is the mean estimated error percentage 
for this specified model, after 10 runs of the cross-validation?

any tips on understanding the output from cv.glm() would be greatly 
appreciated. I am mostly looking to perform a sensitivity analysis with this 
model and dataset - perhaps there are other methods?

thanks

-- 
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341



More information about the R-help mailing list