I'm currently analysing a large dataset with measurements of nutrients in the Dutch marine systems in R. I have a variable "OffshoreDist" representing the distance from the sampling location to the coast. I also calculated the total amount of precipitation over The Netherlands and called this variable "Precip".What I want to do is link mean annual dissolved inorganic nitrogen (DIN) to the amount of precipitation. I expect that this relationship is dependent on the offshore distance. Distance classes can contain 1 or more sampling stations.
That's why I propose these two models with different random components:
model1 <- lme(log(DIN) ~ Precip:factor(OffshoreDist) + factor(OffshoreDist),
model2 <- lme(log(DIN) ~ Precip:factor(OffshoreDist) + factor(OffshoreDist),
Are these the right models for random intercepts per station (model1) and random slope+intercept per station (model2)? Or should this be something like:
random = ~ factor(OffshoreDist) -1 station (model 1)
random = ~ Precip:factor(OffshoreDist)station (model 2)
I've read Pinheiro & Bates, 2000 which is a good reference, but explanation of the formulae only by means of examples does not seem to work for me.
Thanks in advance.
Tom Van Engeland