[R] continuous independent variable in lme

Federico Calboli f.calboli at ucl.ac.uk
Mon Jul 28 00:58:52 CEST 2003


At 14:14 27/07/2003 +0100, you wrote:
>Your anova call is a sequential anova, which you are misinterpreting.
>You can't conclude terms are significant or not if later terms are.
>You need to use type="marginal" to interpret things the way you do (except 
>that I hope that does not drop the main effect and keep the interaction).
>
>You also seem to be interpreting main effects in the presence of 
>interactions incorrectly.  In your first model the coefs for `line' are
>intercepts at 0 temp (probably uninteresting) whereas in the second they 
>are at intercepts at temp=21.5 (probably also uninteresting).  It makes 
>perfect sense to have lines of different slopes with similar intercepts at 
>0 but different ones at 21.5.
>
>Perhaps it is `temp' you want to think hard about how to code?

Prof. Ripley,

many thanks for your reply. I coded temperature as a factor and imposed the
contrasts:

   [,1]
18    1
25   -1

After doing this, the results of anova() are the following:

 anova(lme(area  ~line*temp, random= ~ 1|replicate/temp, mydata), type="m")
            numDF denDF  F-value p-value
(Intercept)     1   336 41817.83  <.0001
line            3     8    14.38  0.0014
temp            1     8   338.21  <.0001
line:temp       3     8     0.62  0.6211

which, incidentally, are identical to the call:

anova(lme(area  ~line*temp, random= ~ 1|replicate/temp, mydata))
            numDF denDF  F-value p-value
(Intercept)     1   336 41817.83  <.0001
line            3     8    14.38  0.0014
temp            1     8   338.21  <.0001
line:temp       3     8     0.62  0.6211

as my data is perfectly balanced (at lest I think this is the most
plausible explanation). 

The contrasts read:

                Value Std.Error  DF   t-value p-value
(Intercept) 109207.89  534.0393 336 204.49409  <.0001
line1         4704.14  755.2457   8   6.22862  0.0003
line2         -544.76  755.2457   8  -0.72130  0.4913
line3        -1043.87  534.0393   8  -1.95467  0.0864
temp1         9150.37  497.5610   8  18.39045  <.0001
line1:temp1   -337.37  703.6576   8  -0.47946  0.6444
line2:temp1   -335.11  703.6576   8  -0.47623  0.6466
line3:temp1   -589.91  497.5610   8  -1.18561  0.2698

which is what I would expect from eyeballing the interaction.plot. I
imagine I could come up with a better model, but I still need more
pondering over chpt 6 of MASS. Nonetheless I think I have a better grasp of
what I am doing now.

Regards,

Federico Calboli

=========================

Federico C.F. Calboli

Department of Biology
University College London
Room 327
Darwin Building
Gower Street
London
WClE 6BT

Tel: (+44) 020 7679 4395 
Fax (+44) 020 7679 7096
f.calboli at ucl.ac.uk




More information about the R-help mailing list