Pedro Vaz
2018-Sep-04 16:39 UTC
[R] leave-one-out cross validation in mixed effects logistic model (lme4)
Hello, So, I have this (simplified for better understanding) binomial mixed effects model [library (lme4)] Mymodel <- glmer(cross.01 ~ stream.01 + width.m + grass.per + (1| structure.id), data = Mydata, family = binomial) stream is a factor with 2 levels; width.m is continuous; grass.per is a percentage Now, a reviewer is asking me to apply "a cross-validation procedure (i.e. a leave-one-out design coupled with predictive metrics as e.g. AUC) on this model" Does anyone have R-code to do this cross validation in my logistic mixed effects model? In the reviewer words: "the model should be evaluated also as for their predictive performance, not only for assumptions violation and for goodness-of-fit" (which I presented already in the reviewed paper draft) Many thanks in advance, pedro [[alternative HTML version deleted]]
Bert Gunter
2018-Sep-04 18:13 UTC
[R] leave-one-out cross validation in mixed effects logistic model (lme4)
Please post on the r-sig-mixed-models list, where you are more likely to find the requisite expertise. However, FWIW, I think the reviewer's request is complete nonsense (na?ve cross validation requires iid sampling). But the mixed models experts are the authorities on such judgments (and may tell you that my opinion is complete nonsense!). Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Sep 4, 2018 at 10:16 AM Pedro Vaz <zasvaz at gmail.com> wrote:> Hello, > > So, I have this (simplified for better understanding) binomial mixed > effects model [library (lme4)] > > Mymodel <- glmer(cross.01 ~ stream.01 + width.m + grass.per + (1| > structure.id), > data = Mydata, family = binomial) > > stream is a factor with 2 levels; width.m is continuous; grass.per is a > percentage > > Now, a reviewer is asking me to apply "a cross-validation procedure (i.e. a > leave-one-out design coupled with predictive metrics as e.g. AUC) on this > model" > > Does anyone have R-code to do this cross validation in my logistic mixed > effects model? In the reviewer words: "the model should be evaluated also > as for their predictive performance, not only for assumptions violation and > for goodness-of-fit" (which I presented already in the reviewed paper > draft) > > Many thanks in advance, > pedro > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]