Saturday, April 07, 2007

random effects

Dear Tom,
my apologies for the long delay between you request and this answer.
First of all, why not include precipitation ("Precip") as a main effect too?

Using libray "nlme" and lme():
Random intercepts per station:
random= ~1|station
Don't forget the vertical bar!
Including random slope:
random= ~Precip|station
random= ~1+Precip|station

Make sure that all stations have different names, otherwise you run the risk that stations with identical names at different distances will be considered as a single station.

You could also consider to use the updated library now called "lme4".
Then the random effects are simply included as extra terms in the model statement.

Cheers, Tom