I am interested in looking at the effects that
Time have on my response variable
Y as well as the interactions between them whilst accounting for the nested variation between tanks and the variation caused by measuring the same individuals through time.
Treatment are crossed based on a figure found here:
• As “Tanks” are exclusive to each
Tank is nested within
• The same 50 individuals per tank are measured through time, so
Subjects are repeated measures.
• As both
Treatment have less than 5 levels each, I have treated them as fixed effects and I would like to extract fixed effects coefficients.
• The Gamma distribution with
link="log" was used because my response variable
Y are non-integers (i.e. 0.3, 0.4 etc.).
• I have checked the random effects observation numbers as mentioned by Dr. Ben Bolker here: (Have I correctly specified my model in lmer?), and the models above are able to capture the nested random nature (N=18).
• I have chosen the
lme4 package because it is able to handle crossed designs.
• I think that either
(1|Tank) are equivalent since the nesting of
Treatment can be “discovered” from the way the data is structured, but I would like to keep it as
(1|Treatment:Tank) to remind myself. Inferred from Dr. Doug Bates here: https://stat.ethz.ch/pipermail/r-sig-mixed-models/2009q3/002790.html
gamma_3 <- glmer(Y~Treatment*Culture*Time+(1|Treatment:Tank)+(1|Subject), data=raw_data, family=Gamma(link="log")) gamma_4 <- glmer(Y~Treatment*Culture*Time+(1|Treatment:Tank)+(1|Treatment)+ (1|Culture)+(1|Subject), data=raw_data, family=Gamma(link="log"))
Have I correctly captured the crossed nature of
gamma_3? I understand that if they were treated as Random Effects it would be correct to specify them as
(1|Culture) + (1|Treatment)as suggested by Dr. Doug Bates and Dr. Ben Bolker, respectively: https://stat.ethz.ch/pipermail/r-sig-mixed-models/2009q3/002790.html and http://glmm.wikidot.com/faq
However, I have found less resources on how to specify crossed fixed effects.
gamma_4I have added the above structure mentioned in question 1 [
(1|Culture) + (1|Treatment)] in addition to keeping
Treatmentas Fixed effects to capture their crossed nature. However, this seems to be advised against by Dr. Ben Bolker here: Have I correctly specified my model in lmer?
(1|Subject)sufficient to specify repeated measures in the
Finally, I am getting the following error message although the model does produced an output:
fixed-effect model matrix is rank deficient so dropping 5 columns / coefficients
This was surprising to me because I have heaps of data. I have 50 individuals per tank, 3 tanks per treatment etc.
Warning message:In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.101624 (tol = 0.001, component 1)
Why would the model fail to converge but still produced an output? Any clues on how I can fix this or glean some more information on the nature of the error?
Note: Also, a tag for crossed designs does not seem to exist. Potentially someone with a high enough reputation could create a new tag if they find it useful or correct for this community?