[R-sig-ME] graphing fixed effects from mixed effects model

jude girard jude.girard at gmail.com
Wed Apr 4 22:54:21 CEST 2012


I feel like this must be a common problem, but I can’t find any
information on how to graph the results of my mixed effects model.

I am trying to predict insect biomass from weed cover and month.  I
have 9 pairs of organic and conventional fields; each field has a
unique site id.  In each field, insect biomass weed cover were
measured in june and july.  So my model is

model<lme(biomass~weed.cover+month, data=weeds, random=~1|pair/site)

I would like to plot a graph showing the raw data, together with two
lines, one showing the predicted relationship between biomass and weed
cover in June and one showing the predicted relationship in July.  I’m
not interested in showing the slopes for the individual sites; this is
included in the model only to account for the longitudinal nature of
the design, not because I am interested in this variation.

So, is there some way to calculate and average slope across sites in
each month, or do I have to pick one site to use as a reference and
just graph the result for that site?  And if so, are there any
guidelines for which site to use as the reference?

Thanks for your help!

Jude Girard


>summary(model)
Linear mixed-effects model fit by REML
 Data: weeds
       AIC      BIC    logLik
  65.07516 73.86958 -26.53758

Random effects:
 Formula: ~1 | pair
         (Intercept)
StdDev: 3.967212e-05

 Formula: ~1 | site %in% pair
        (Intercept)  Residual
StdDev:   0.1402752 0.4805598

Fixed effects: biomass ~ weed.cover +      month
                                 Value Std.Error DF    t-value p-value
(Intercept)                 -2.1694761 0.1263224 15 -17.174124  0.0000
weed.cover 0.2168042 0.3158289 15   0.686461  0.5029
monthJuly             0.4870690 0.2069135 15   2.353974  0.0326
 Correlation:
                            (Intr) a((./1
weed.cover -0.277
monthJuly            -0.351 -0.618

Standardized Within-Group Residuals:
       Min         Q1        Med         Q3        Max
-1.5283318 -0.5597323 -0.2046855  0.7638652  1.9944551

Number of Observations: 35
Number of Groups:
          pair site %in% pair
             9             18

> anova(model)
                            numDF denDF  F-value p-value
(Intercept)                     1    15 443.8127  <.0001
weed.cover     1    15   7.4109  0.0157
month                  1    15   5.5412  0.0326




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