问题
I want to analyze the effect of 2 treatments on the variation of the abundance of a plant species along a time gradient.
The experimental design consist of exclosures (treatment = no moose), paired with control plots (treatment = moose). A site consist of 1 exclosure + 1 control plot. There are 15 sites (so 15 exclosures + 15 paired plots = 30 experimental units). Each experimental units has is unique "id". The abundance (proportion : continuous value between 0 and 1) of fir has been monitored for 5 years (once every year = repeated measures). So the repeated measures is nested inside the "id".
I want to analyze the effect of treatments on fir abundance while controlling for the paired structure of the data and the repeated measures.
Since the response data is a proportion (abundance between 0 and 1), I have been directed toward GLMM with family=binomial.
However, I am not entirely sure on how to code my model. I tried :
fit = glmer(fir ~ treatment*time + (time|id) + (1|site), data=dat1, family=binomial)
If I get this right, "(1|site)" would control for the paired structure, and "(time|id)" would control for the repeated structure (since "time" is nested into "id").
but I receive the following errors :
Warning messages:
1: In eval(family$initialize, rho) :
non-integer #successes in a binomial glm!
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
unable to evaluate scaled gradient
3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Hessian is numerically singular: parameters are not uniquely determined
Any idea what goes wrong with my model and what these error messages mean ?
Thx
回答1:
I have learned a way to include both paired structure and repeated measures.
But first, I learned that you cannot directly use proportions in a glmer, since you loose information about the "solidity" of that proportion. For example, if you have fir in 1 out of 2 plots, you obtain 50% of abundance, but that 50% is less "trustable" then having 60 plots with fir out of 120 plots (which also give 50% abundance). Additionally, it is not possible to insert a Correlation parameters in glmer. In our experiment, 4200 was the effort of sampling :
dat1$fir2 = round(dat1$fir*4200);
dat1$N = 4200
To include both paired structure and repeated measures, you can use Generalized Linear Mixed Models using Penalized Quasi-Likelihood (or glmmPQL) from library(MASS). The repeated measures are included via a correlation parameter with corCAR1().
The model for the above situation would be:
fit2 = glmmPQL(cbind(fir2, N-fir2) ~ treatment*time,
random=~1|site/treatment, data=dat1, family=binomial,
correlation=corCAR1(form = ~time|site/treatment))
Cheers !
来源:https://stackoverflow.com/questions/45803227/errors-trying-to-run-glmer-with-paired-data-and-repeated-measures-lme4