K-fold validation for glmer model

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

K-fold validation for glmer model

Samhita Bose (SCIFAC-Biological Sciences)
Hi,


I am trying to see resource selection in black tailed deer across seasons and activity state. I am fairly new to R and have used glmer function from lme4 to fit my data. I have used physical variables  (elevation, aspect and ruggedness) and vegetation classes as fixed effect and individual deer as random effect in my model. Now I want  to validate my model to test the robustness of my assumptions. I have tried using package caret but it is not supporting glmer model. Is there any R code  to conduct a k fold cross validation of a glmer model? Any help will be appreciated.


Thanks,

Samhita


Samhita Bose
PhD Student
School of Biological Sciences
New Kirk Building, Kelburn Parade
Victoria University of Wellington
Work:   +64-4-463-8554   Cell:  +64-22-389-3800

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Reply | Threaded
Open this post in threaded view
|

Re: K-fold validation for glmer model

Mathieu Basille-3
Dear Samhita,

I wrote a function that does exactly this: kfold for LMER objects (e.g. in
the context of resource selection functions). It is in the 'kfold' branch
(in development) of my package 'hab' [1].

I have to admit it is largely untested, which is why it is not in the
official version... I think it should work though, you may want to give it
a try.

Mathieu.


[1] https://github.com/basille/hab/blob/kfold/R/kfold.r


Le 02/05/2016 21:58, Samhita Bose (SCIFAC-Biological Sciences) a écrit :

> Hi,
>
>
> I am trying to see resource selection in black tailed deer across seasons and activity state. I am fairly new to R and have used glmer function from lme4 to fit my data. I have used physical variables  (elevation, aspect and ruggedness) and vegetation classes as fixed effect and individual deer as random effect in my model. Now I want  to validate my model to test the robustness of my assumptions. I have tried using package caret but it is not supporting glmer model. Is there any R code  to conduct a k fold cross validation of a glmer model? Any help will be appreciated.
>
>
> Thanks,
>
> Samhita
>
>
> Samhita Bose
> PhD Student
> School of Biological Sciences
> New Kirk Building, Kelburn Parade
> Victoria University of Wellington
> Work:   +64-4-463-8554   Cell:  +64-22-389-3800
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

--

Mathieu Basille

[hidden email] | http://ase-research.org/basille
+1 954-577-6314 | University of Florida FLREC

  « Le tout est de tout dire, et je manque de mots
  Et je manque de temps, et je manque d'audace. »
  — Paul Éluard

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology