Representing repeated measurements within sample plots in linear mixed
effects model in R
I have collected data on gas fluxes from plots of soil subjected to 5
different treatments ("D2", "K2", "M", "N", and "O2"), which also
possessed variable clay contents. The experiment was laid out in a
randomized complete block design, with 4 replications. Within each plot,
two separate measurements of flux were performed. The resulting data.frame
resembles the following:
block treatment subsample flux clay
1 D2 1 112068.6003 14.8
1 D2 2 129223.1641 14.8
1 K2 1 256712.4712 15.5
1 K2 2 113343.9756 15.5
1 M2 1 85794.47834 16.4
1 M2 2 -33620.6990 16.4
1 N 1 70283.98133 18.2
1 N 2 49569.84621 18.2
1 O2 1 100553.1116 13.4
1 O2 2 38885.99674 13.4
2 D2 1 96968.58451 15.8
I want to build a linear mixed effect model that takes account of this
subsampling, and have come up with:
flux.lme <- lme(flux ~ treatment + block, random = ~1|subsample)
Which produces an ANOVA table:
> anova(flux.lme)
numDF denDF F-value p-value
(Intercept) 1 26 158.15781 <.0001
treatment 4 26 8.88691 0.0001
clay 1 26 1.72640 0.2003
block 3 26 1.59188 0.2153
treatment:clay 4 26 1.73011 0.1736
Can I represent repeated measurements as a random effect in this way. The
output seems a bit strange to me, as the denominator degrees of freedom
should not be 26, which is taking each repeat as independent experimental
unit. It should instead be based on the number of "main plots", which is
20. In my case the denominator d.f. should be 20-1-3-1-4-4=7. Is is
possible to instruct the lme() function to use this value?
No comments:
Post a Comment