[R-sig-ME] missing data + explanatory variables

Christophe Dutang dutangc at gmail.com
Thu Mar 25 23:13:21 CET 2010


Thanks David for your answer,

Le 24 mars 2010 à 22:37, David Duffy a écrit :

> On Wed, 24 Mar 2010, christophe dutang wrote:
> 
>> Dear list,
>> 
>> I have two problems when I try to use mixed models. First as far as I know,
>> there are two main implementations of mixed models: lme4 and MCMCglmm.
>> 
>> I try to model a binary response variable over a small period of time. The
>> problem is that for some lines, the response is missing. In this mailing
>> list archive, I do not find response to this question.
>> 
> 
> It doesn't matter if the response variable is missing -- that merely makes the design unbalanced.  If a covariate is missing, then it is more difficult.
I don't understand how to do it with the lmer function. The following R code remove the line with missing response:

library(lme4)

fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
sleepstudy2 <- sleepstudy
sleepstudy2[180, "Reaction"] <- NA
fm2 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy2)

What am I doing wrong?

> 
>> My question is how can we know that an explanatory variable is significant?
>> is the only tool to fit another model without the variable and to use the
>> anova function?
> 
> The likelihood ratio test from anova() is the "gold standard", with the proviso that the distribution of the test statistic may not be a simple chi-squared distribution, which is what we usually assume.
That was what I had understood.

> RLRSim is a package for getting a more accurate P-value if you are testing for presence or absence of a random effect.
I hope I can used it with the lme4 functions.

> 
> If you are talking about a fixed explanatory effect, you can always construct a Wald test if you are willing to accept certain assumptions about your data.
Do I have to code something or is there any package implementing the Wald test?

Christophe

> 
> HTH, David Duffy.
> 
> -- 
> | David Duffy (MBBS PhD)                                         ,-_|\
> | email: davidD at qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
> | Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
> | 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v

--
Christophe Dutang
Ph.D. student at ISFA, Lyon, France
website: http://dutangc.free.fr




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