[R] Main effects and interactions in mixed linear models

Bert Gunter gunter.berton at gene.com
Wed Jun 6 19:22:03 CEST 2012


Ron:

There are some misunderstandings  in your message. See inline below.
However, this is fundamentally not an R question -- it's about "what
to do" not how to do it in R. So I suggest you post on a statistical
list like stats.stackexchange.com.  But as you have already noted,
beware, you are likely to get a range of possibly compet8ing views. I
shall add a few of my own in what follows, to which this caution also
applies.

-- Bert

On Wed, Jun 6, 2012 at 8:29 AM, Ron Stone <ronstone1980 at gmail.com> wrote:
> Dear all,
>
> This question may be too basic quesition for this list, but if someone has
> time to answer I will be happy. I have tried to find out, but haven't found
> a consice answer.
>
> As an example I use "Pinheiro, J. C. & Bates, D. M. 2000. Mixed-effects
> models in S and S-PLUS. Springer, New York." page 225, where rats are fed
> by 3 different diets over time, which body mass has been measured.
> Response: Body mass, fixed effects Time*Diet, random effect ~Time|Rat. The
> main question is if the interaction term is significant (i.e. growth rate).
> My question is could I also look at the p-values of the main effects to say
> if body mass increase significant with body mass?
Come again? A typo? Do you mean: "Are the main effects of time and
diet on body mass significant?" If so, by definition , yes. However,
in the presence of imbalance and interactions, your interpetation of
this may be wrong.
>
> >From Pinheiro, J. C. & Bates, D. M. (2000)
>
> Fixed effects: weight ~Time * Diet
>                   Value     St.error    DF    t-value   p-value
> Intercept    251.60      13.068   157   19.254    <.0001
> Time          0.36           0.088      13     4.084    0.0001
> Diet2          200.78      22.657     13     8.862   <.0001
> Diet3          252.17      22.662    157  11.127   <.0001
> TimeDiet2  0.60           0.155     157    3.871      0.0002
> TimeDiet3  0.30           0.156     157    1.893      0.0602
>
> As stated by Pinheiro, J. C. & Bates, D. M. (2000), the growth rate of diet
> 2 (TimeDiet2) differs significantly from diet 1. Allthoug could I from this
> also say that body mass increase significantly with time for diet 1?
This is the R part of your question. You do not understand what
contrasts are in linear models and, in particular, R's default choice
of contrasts (which actually really aren't contrasts). See ?contrasts
and especially ?contr.treatment.
The point here is that with 3 diets there are only 2 diet "effects"
and their corresponding interactions with time that exist. These can
be chosen in any of several different (in theory infinitely many)
ways. By default, R chooses Diet 1, time 0 as the "control" (given by
the intercept term; note that there can be no "no diet" against which
to compare Diet 1) and the Diet 2 and Diet 3 main effects and their
corresponding interactions with time represent the differences of
these Diets against the Diet 1 control and their differences in growth
rate vs Diet 1.

So bottom line: Your question is nonsense.

 Like
> this: f(x) = 251.60 (+/-13.068) + 0.36 x (+/- 0.088), t = 4.084, p =
> 0.0001? I have seen different places that it people claiming that when the
> interaction is significant then it is wrong to interpret p-values for the
> main effects. Is it more proper to split the data and run the test (weight
> ~Time) for each diet seperately, when looking at the simple effect of time
> on body mass?
I would agree, with the caveat that P values should be ignored.

Bottom Line: (keep my caution in mind):

1. Plot your data informatively. lattice or ggplot style trellis plots
would be useful here. See also
http://addictedtor.free.fr/graphiques/
where you may get some ideas. This is likely to be more useful than
formal statistics.

2. Consult a local statistician. Spending an hour or two of time with
a local statistician (i.e. anyone with statistical expertise who
understands linear models, not necessarily someone with a statistical
degree)  would be better than any advice that you could obtain here,
including, paradoxically, mine.

-- Bert

>
> Best regards Ron
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm



More information about the R-help mailing list