I´m trying to fit a linear mixed model to test if my dependent variable (B) is different between my treatments (A with 2 levels A&B). The study was conducted at severals sampling sites. To account for the paired data (measurements within one site) I would take sampling site as random effect into the model:
lmer(B ~ A + (1|Site))
However, to also account for the varibailty within each treamtent, serveral measurements were taken per site per treatment (i.e. field replicats, or pseudoreplicates, not the same number per treatment, as treatment B is expected to have a higher variabilty than treatment A). I now wonder if I need to aggregate my data first and take the mean value over the pseudoreplicates (for each treatment for each site) as dependent variable or every single observation? Or as a third option include some nested structure into the random effect to account for the field replicates.
My data looks something like this:
Site | Treatment A | Observation | Measurement B |
---|---|---|---|
1 | A | 1 | 5.3 |
1 | A | 2 | 5.3 |
1 | A | 3 | 8.1 |
1 | B | 1 | 7.2 |
1 | B | 2 | 5.2 |
2 | A | 1 | 2.6 |
2 | A | 2 | 3.3 |
2 | A | 3 | 1.3 |
2 | B | 1 | 4.1 |
2 | B | 2 | 6.3 |