[R-sig-ME] plot glmmPQL

Ben Bolker bbolker at gmail.com
Fri Apr 27 16:00:57 CEST 2012


Mario V. Balzan <m.balzan at ...> writes:

> 
> Dear all,
> 
> I am investigating the influence of some experimental treatments
> (A,B,C,...) on fecundity of a lepidoptera. These data have been
> collected over time from different experimental plots (A1, A2, ... ).
> I am using glmmPQL function with quasipoisson errors since these are
> count data and with overdispersion.
> 
> the model which I came up with is as follows:
> glmmPQL(Fecundity~Treatment,random=~Time|Plot, family="quasipoisson")
> 
> I would like to plot a curve of fecundity against time for each
> treatment from this model. Is that possible? Would appreciate if
> someone could help me out with this.
> 

  [snip]

  It sounds a lot like you want a fixed effect of Treatment+Time,
or possibly even Treatment*Time. It is odd (although not absolutely
impossible) to consider a model where there is no overall effect of
time (i.e. the mean time trajectory across plots is *exactly* zero)
but there is variation in the time effect across plot.

  If you fit Treatment+Time (an additive model), then the expected
time effects are the same for each treatment.  If you fit Treatment*Time
then they differ.  
  Probably the most straightforward way to do this is just to pick
out the relevant coefficients from your model, compute
(intercept)+(slope)*time for each treatment, and then exponentiate
(since you are using the default log link for the quasipoisson).
Alternatively, you can use the 'predict' method for glmmPQL to
generate predictions (use expand.grid() to create a full data frame
of combinations of times and treatments, then apply your model
to it with predict())



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