Skip to content
Prev 16041 / 20628 Next

Plotting partial residuals from a glmmADMB model

Dear Dr. Bolker,
 Thank you very much for your response. After trying to implement your suggestion, I'm unfortunately stuck. It appears that the getME function does not work with glmmADMB. I get the following error message:

Error in UseMethod("getME") : 
  no applicable method for 'getME' applied to an object of class "glmmadmb"

A potential work around to this may be to use the "predict" function, which can generate the components, but I'm not sure if this is equivalent. Also, I'm having trouble following the steps that you outlined in your email to generate the partial residuals. Would you be willing to work through how to generate the partial residuals for the fixed effect "FoodTreatment" in the model below that uses the Owl data set?

 ##Using the Owl Data
om <- glmmadmb(SiblingNegotiation~FoodTreatment+ArrivalTime+SexParent+ (1|Nest),family="nbinom1",data=Owls)

Thank you,
Frances

-----Original Message-----
From: Ben Bolker [mailto:bbolker at gmail.com] 
Sent: Thursday, December 14, 2017 9:54 PM
To: Sivakoff, Frances <sivakoff.3 at osu.edu>
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] Plotting partial residuals from a glmmADMB model

You'll have to find a way to make "partial predictions". I don't think there's anything built in for this.  *Very* briefly, considering only fixed effects, if you retrieve the X matrix
(getME(fitted_model,"X")) and the fixed-effect parameters (fixef(fitted_model)), you can drop any columns/parameters you want and do exp(X %*% beta) with the remaining columns/parameters to get a prediction that includes some but not all of the predictors. Subtracting the observed value should get you the partial residuals ...
On Tue, Dec 12, 2017 at 2:19 PM, Sivakoff, Frances <sivakoff.3 at osu.edu> wrote: