This question already has an answer here:
- R's lmer cheat sheet 3 answers
I am modeling wood properties variation of several individual within the same tree species using multilevel lme(). I specified a first model as :
full <- lme(id ~ dist2 + I(dist2^2) ,data=dataGr ,random=list(ind=pdDiag(~ dist2 + I(dist2^2)), radius=pdDiag(~ dist2 + I(dist2^2))) ,control=ctrl, meth='ML')
with 'radius' nested within 'ind'.
As 'id' is a longitudinal variable according to 'dist2' within 'radius' within 'ind', I want to add an AR(1) autocorrelation error term.
So, I wrote a second model by updating the first one with :
fullc <- update(full, correlation=corARMA(p=1,q=0, form = ~ 1 | ind/radius))
Is it a good way to include autocorrelation error structure in my model?
This specification is also possible and gives slightly different results :
fullc <- update(full, correlation=corARMA(p=1,q=0, form = ~ dist2 | ind/radius))
But I don't clearly understand the difference between both specifications. Could you help me ?