# Mixed Models: How to incorporate technical replicates in my analysis?

I'm trying to make sure that I'm using mixed models in the correct way. I measured enzimatic activity in 10 specimens (5 female and 5 male), each one measured in three technical replicates. These measurements were made during the four seasons in two different years. I would like to know if Season, Sex and the interaction between Season and Sex have effect on enzimatic activity. So I considered as fixed effects Season (4 levels), Sex (2 levels) and Season*Sex, and as random effects Year.

Specimen Replicates Activity Sex Season Year

  1          A   184.78   F    AUT    1
1          A   179.18   F    AUT    1
1          A   183.48   F    AUT    1
2          B   162.77   F    AUT    1
2          B   161.01   F    AUT    1
2          B   154.53   F    AUT    1


Iam using these:

model1=lmer(Activity~Season+Sex+Season*Sex+(1|Year))

but interaction wasn't significant, so I simplified to:

model2=lmer(Activity~Season+Sex+(1|Year))

Is it right?

I know that R typically treat all observations having the same set of predictor variables as technical replicates, but Iam not sure if I should to specify the "Specimen" in my model, like this...

model3=lmer(Activity~Season+Sex+(1|Specimen)+(1|Year))

...to R recognize my technical replicates as technical replicates instead outcomes from different subjects.

I know that I could use the mean of my technical replicates as my dependent variable (Activity) but I would like to use all my data in this analysis.

Someone can help me with this issue?

Best regards

D.

• (i) 2 levels for Year is far too low for a random effect, change that to a fixed effect.
– mkt
Commented Sep 13, 2022 at 18:56
• (ii) Season+Sex+Season*Sex is redundant, all you need is Season*Sex because that includes both main effects and interactions. R might deal with that intelligently, though, so it may not make a difference.
– mkt
Commented Sep 13, 2022 at 18:57
• (iii) What does Specimen mean exactly, and how is it different from Replicate? Can you post your data using dput() or at least a reproducible example illustrating the structure?
– mkt
Commented Sep 13, 2022 at 18:58
• Hi mkt, thanks. Specimen is my Subject variable. I will rewrite using Year as fixed effects and post it again using dput(). I will also try to explain in more details my issues on this analysis. Thank you very much. Commented Sep 14, 2022 at 14:16

In this design, one expects that the functional form of the random effect, using lme4's formula syntax, would be ~ ... + (1|Specimen).
Adjusting for a fixed effect "costs" one degree of freedom for each non-referent level, when the number of levels becomes too large, the estimation is imprecise; in this case a random effect does better. As the comments point out, Year has two levels, so the fixed effect "costs" barely anything while having much greater predictive power than if it were handled as a random effect.
Conversely, Specimen has 10 levels, which would require 9 covariates to handle using dummy encoding. In an analysis set comprised of only 30 observations, adjusting for these values is not at all tenable. The specimen-effect (which isn't directly handled at all in the proposed models) is a candidate for adjustment as a random effect. One possible approach is to specify specimen as a random intercept, i.e. ~ ... + (1|Specimen). This is a special case of a repeated measures ANOVA. Each cluster of observations within an instance of specimen has a sort of randomly assigned intercept according to a normal $$N(0, \sigma_s)$$ distribution where $$\sigma_s$$ is the variance of the random intercept.