[R-sig-ME] GLMM linearity checking

Ben Bolker bolker at ufl.edu
Thu Jun 3 20:37:58 CEST 2010


  [cc'ing back to r-sig-mixed]

  That was going to be my suggestion.
  Try omitting rows of the data set with NA predictors or responses
(na.omit() will work if your data frame does not have *other* columns
with NAs in them beyond those used in the model) before you start.


Shujuan Feng wrote:
> or maybe I can just delete the missing rows.
> 
> 
> ----- Original Message ----- 
> From: "Shujuan Feng" <fengsj at mail.utexas.edu>
> To: "Ben Bolker" <bolker at ufl.edu>
> Cc: <r-sig-mixed-models at r-project.org>
> Sent: Thursday, June 03, 2010 12:10 PM
> Subject: Re: [R-sig-ME] GLMM linearity checking
> 
> 
>> Thanks so much!
>>
>> I read about Graphical checking for GLMM (transformed by the link 
>> Function) before fitting the model from a paper. I have difficulty in 
>> imaging how the 0s and 1s are transformed by the ink. .....
>>
>> I tried your suggestions and this way should give me more valuable 
>> checkings for the model. But because I have a lot of missing data, I could 
>> not put the residuals into the data. I got errors:
>>
>> Error in `$<-.data.frame`(`*tmp*`, "resid", value = c(-0.776415  : 
>> replacement has 13580 rows, data has 68158
>>
>> Is there any way to match residuals and the predictor?
>>
>> I tried just plot(model), but it doesn't work for GLMM.
>>
>>
>>
>> Thanks!!
>>
>>
>>
>>
>>
>>
>>
>> ----- Original Message ----- 
>> From: "Ben Bolker" <bolker at ufl.edu>
>> To: <fengsj at mail.utexas.edu>
>> Cc: <r-sig-mixed-models at r-project.org>
>> Sent: Thursday, June 03, 2010 11:25 AM
>> Subject: Re: [R-sig-ME] GLMM linearity checking
>>
>>
>>> fengsj at mail.utexas.edu wrote:
>>>> I am sorry for asking this question here. It is more related to
>>>> logistic regression.
>>>>
>>>> I need to use GLMM (binomial(link = "logit")) )to fit my data. The
>>>> dependent variable is 0 or 1 and  I'd like to do some roughly
>>>> graphical checkings for my data to see if the responses of
>>>> transformaed data are linear with respect to continuous predictors in
>>>> general. How should I do this?
>>>>
>>>> Thanks,
>>>>
>>>   how about
>>>
>>> m <- glmer(...,data=d)
>>> d$resid <- residuals(m)
>>>
>>> xyplot(resid~continuous_predictor_1,type=c("p","smooth"),data=d)
>>>
>>> ...
>>>
>>>  Non-linearity on the transformed scale will appear as a (non-flat)
>>> pattern of the (smoothed line fitted to the) residuals as a function of
>>> the continuous predictors ...
>>>
>>>  Ben Bolker
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models 
> 


-- 
Ben Bolker
Associate professor, Biology Dep't, Univ. of Florida
*** NEW E-MAIL ADDRESSES:
***   bbolker at gmail.com , bolker at math.mcmaster.ca
bolker at ufl.edu / people.biology.ufl.edu/bolker
GPG key: people.biology.ufl.edu/bolker/benbolker-publickey.asc




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