[R-sig-ME] lme4 package

John Fox j|ox @end|ng |rom mcm@@ter@c@
Wed Sep 20 22:14:42 CEST 2023


Dear Ben and Mina,

Georges Monette and I have coincidentally been working recently on a 
general cross-validation package for R, which includes methods (which we 
regards as experimental) for mixed models fit by lme4. In particular, we 
haven't completed a vignette that should explain in more detail some 
considerations involved in cross-validating mixed models. The methods 
for mixed models in the package support cluster-based cross-validation.

The package, named cv, isn't (yet) on CRAN, but can be installed from 
GitHub. See <https://github.com/gmonette/cv> and the associated website 
at <https://gmonette.github.io/cv/>.

Since this is a work in progress, though one that's reasonably far 
along, feedback and suggestions would be welcome.

Best,
  John

John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/

On 2023-09-20 1:58 p.m., Ben Bolker wrote:
> Caution: External email.
> 
> 
>     Train/test splits for longitudinal data are a little tricky, and not
> something that's dealt with explicitly in lme4.  For example, see the
> 'rolling origin' sampler in the tidymodels package:
> https://rsample.tidymodels.org/reference/rolling_origin.html
> 
>    The split should also respect cluster identity (i.e., the split
> should be stratified by cluster so that all the observations from a
> cluster end up in the same fold)
> 
>    I would guess that many lme4 users rely on the assumptions of the
> model being approximately valid and use predictive performance measures
> based on that assumption ...
> 
>    Hopefully someone else on the list will have more practical advice.
> 
> 
> On 2023-09-20 1:44 p.m., mina jahan wrote:
>> Hi,
>>
>> I want to use the lme4 package for prediction of a longitudinal 
>> continuous
>> outcome variable. How can I split data into train and test in 
>> longitudinal
>> data to compute predictive performance?
>>
>>
>> Best regards,
>> Mina Jahangiri
>> Ph.D. student of Biostatistics
>>
>>       [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-mixed-models using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> 
> -- 
> Dr. Benjamin Bolker
> Professor, Mathematics & Statistics and Biology, McMaster University
> Director, School of Computational Science and Engineering
> (Acting) Graduate chair, Mathematics & Statistics
>  > E-mail is sent at my convenience; I don't expect replies outside of
> working hours.
> 
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



More information about the R-sig-mixed-models mailing list