[R-sig-ME] na.action in lmer()
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.
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:
> 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
> [[alternative HTML version deleted]]
> R-sig-mixed-models at r-project.org mailing list
More information about the R-sig-mixed-models