[R] residual plots for lmer in lme4 package

John Maindonald john.maindonald at anu.edu.au
Fri Aug 17 12:51:53 CEST 2007


I am doubtful whether standard residual plots are very useful
in this context.  One wants the theoretical effects Ui to have a
normal distribution.  If there are similar amounts of information
on each patient, maybe it will not be too bad to extract the
estimated effects and check them for normality. I don't think
you can use residuals() to extract them, as glmer() does
not have the notion of levels.  Maybe they can be extracted
using ranef(), but I do not see any examples for use with
glmer() on the help pages.

The issue of checking for normality of effects in multi-level
models has not been very much researched, as far as I can
tell.  The function residuals()  gives residuals that adjust for
all except the "highest" level of random effects.  Depending
on the relative magnitudes of the variance components,
whether or not these "residuals" are anywhere near normal
may not be of much or any consequence.

John Maindonald             email: john.maindonald at anu.edu.au
phone : +61 2 (6125)3473    fax  : +61 2(6125)5549
Centre for Mathematics & Its Applications, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.


On 17 Aug 2007, at 8:00 PM, r-help-request at stat.math.ethz.ch wrote:

> From: "Martin Henry H. Stevens" <HStevens at muohio.edu>
> Date: 17 August 2007 12:08:15 AM
> To: Margaret Gardiner-Garden <m.gardiner-garden at garvan.org.au>
> Cc: "R-help at R-project.org" <R-help at R-project.org>
> Subject: Re: [R] residual plots for lmer in lme4 package
>
>
> Hi Margaret,
> Have a look at qqmath in the lattice package.
> ?qqmath
> Hank
> On Aug 16, 2007, at 2:45 AM, Margaret Gardiner-Garden wrote:
>
>> Hi,
>>
>>
>>
>> I was wondering if I might be able to ask some advice about doing  
>> residual
>> plots for the lmer function in the lme4 package.
>>
>>
>>
>> Our group's aim is to find if the expression staining of a  
>> particular gene
>> in a sample (or "core")  is related to the pathology of the core.
>>
>> To do this, we used the lmer function to perform a logistic mixed  
>> model
>> below.  I apologise in advance for the lack of subscripts.
>>
>>
>>
>>  logit P(yij=1) = â0 + Ui + â1Patholij where Ui~N(0, óu2),
>>
>> i indexes patient, j indexes measurement, Pathol is an indicator  
>> variable
>> (0,1) for benign
>>
>> epithelium versus cancer and yij is the staining indicator (0,1)  
>> for each
>> core where yij equals 1 if the core stains positive and 0 otherwise.
>>
>>
>>
>> (I have inserted some example R code at the end of this message)
>>
>>
>>
>> I was wondering if you knew how I could test that the errors Ui  
>> are normally
>> distributed in my fit.  I am not familiar with how to do residual  
>> plots for
>> a mixed logistic regression (or even for any logistic regression!).
>>
>>
>>
>> Any advice would be greatly appreciated!
>>
>>
>>
>> Thanks and Regards
>>
>> Marg
>>



More information about the R-help mailing list