I can code this problem in SAS with residual as a random effect ( I believe this is a r-side random intercept by fish)
proc glimmix data=one method=mmpl ;
class fish;
model increment =age growth_year age*growth_year;
random residual / subject=fish ;
run;
Here is the same analysis with AR(1) covariance structure.
proc glimmix data=one method=mmpl ;
class fish;
model increment =age growth_year age*growth_year;
random residual/ subject=fish type = ar(1) ;
run;
Here is my attempt in R to reproduce the first model that doesn't work.
model = lmer(increment ~ age + growth_year+ age*growth_year
+ (resid()|fish), data = SR_data)
Please Help, Use of lmer or glmer(gamma instead of normal distribution) or lme or any other package that I am unaware of.