[R-sig-ME] na.action in lmer()

Ravi Varadhan ravi.varadhan at jhu.edu
Fri Apr 22 17:23:03 CEST 2016


Ok, I get it.  
Yes, I did mean REML=FALSE.  I use that option so that I can do an anova() on the two nested models.

Thank you,
Ravi

-----Original Message-----
From: Ben Bolker [mailto:bbolker at gmail.com] 
Sent: Thursday, April 21, 2016 5:31 PM
To: Ravi Varadhan <ravi.varadhan at jhu.edu>; r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] na.action in lmer()


  You shouldn't need to do anything special, since the data are written out in a long format, e.g.

Patient  time   y
1           0   0.1
1           1   0.3
...
2           0   0.1
2           1   NA
2           2   0.3
...

  Unlike in the classic MANOVA setup where the responses from an individual are all considered part of the same observation (and hence an NA screws things up badly), this is just handled automatically/naturally in the mixed-model context.

  The only difference between na.omit() and na.exclude() is whether NA values are inserted into appropriate places in the downstream residual/prediction calculations.  (g)lmer can't do anything with observations containing NA values, but 'observation' means (in this
case) 'patient-time combination', not 'patient'.

  (Do you mean REML=FALSE ... ?)


On 16-04-21 05:19 PM, Ravi Varadhan wrote:
> Hi,
> 
> I am fitting a model like this with random intercept and random slope 
> using lme4::lmer.
> 
> lmer(y ~ time + (time|Patient), REML="FALSE", na.action=na.omit)
> 
> The `na.omit' option is the default. However, I would like to include 
> patients with one or missing values in their time trajectory.  Which 
> NA handling option would I use?
> 
> Thank you, Ravi
> 
> Ravi Varadhan, Ph.D. (Biostatistics), Ph.D. (Environmental Engg) 
> Associate Professor,  Department of Oncology Division of Biostatistics 
> & Bionformatics Sidney Kimmel Comprehensive Cancer Center Johns 
> Hopkins University 550 N. Broadway, Suite 1111-E Baltimore, MD 21205 
> 410-502-2619
> 
> 
> [[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models at 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