2
$\begingroup$

I am spatially predicting binomial probabilities (using proportional data; cbind in R) across a spatial domain. I use the functions get.models followed by model.avg in the R package MuMIn to get averaged coefficients of models with delta AIC less than 2. This returns an object of class model list showing the component models and averaged coefficients. I would now like to use the cross validation cv.glm function (or any similar methods) from the R package boot to obtain leave-one-out cross validation prediction accuracy of this averaged model. However, I get the following warning when doing cv.glm(data, model.avg output):

Error in eval(expr, envir, enclos) : could not find function model.avg.default.  

I would greatly appreciate it if anyone could provide suggestions on how to obtain leave one out cross validation on averaged models from the MuMIn package. Thank you.

$\endgroup$

1 Answer 1

3
$\begingroup$

It seems that cv.glm cannot handle any of the model averaging objects provided by either MuMIN or bbmle. I am looking for a similar answer, yet not for exactly the same question as yours. During my search, I found a blog post where a function is presented that allows cross-validation of MuMIN models. I thought it might be handy for you.

Check out the link here Noam Ross` Blog

in the bottom you should find the proposed Cross function. I only works with 2 models so you will have to adjust it.

Did you find another solution already? If so, please post it here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.