Specification of binomial mixed model with custom intercept
Hi Tom, I'm not sure if this is a sensible thing to do. If your presumption about the proportion of infected insects in each group at time=0 is correct, then surely your data must already reflect this fact? In which case I don't see why you can't just estimate the unconstrained model that you wrote and let the model figure out for itself what p(infected) is at time=0. In short, I don't see the added value of the constraints you mention. With that said, it occurs to me that if you really do want to implement the two constraints that you mentioned, then really you are not estimating any fixed-effect parameters at time=0. So it seems you could just as well exclude the time=0 data and just model the treatment factor at time=1. From those parameter estimates it would be easier to figure out what the time slopes are for each group, since they will just be the difference between the time=1 parameter estimates and whatever values you fixed the proportions at time=0 to. Hope this makes sense. Jake
From: Tom.Wenseleers at bio.kuleuven.be To: r-sig-mixed-models at r-project.org Date: Tue, 23 Jun 2015 15:02:47 +0000 Subject: [R-sig-ME] Specification of binomial mixed model with custom intercept Dear all, I have a binomial mixed model fit=glmer(cbind(infected,not_infected)~(1|colony)+treatment*time,family=binomial,data=data) in which I am modelling the evolution of an infection in different social insect colonies across two treatment groups (INJECTED and CONTROL) as a function of time. However, as my INJECTED group individuals should all be infected at time=0, whereas none of my CONTROL individuals should be infected at time=0, I would like to force the model to go approx through 1 at time t=0 for the INJECTED group and to go approx through 0 at time t=1 for the CONTROL group. What would be the correct way to specify such a model? I tried with data$baseline=qlogis(c(0.001,0.999))[data$treatment] fit=glmer(cbind(infected,not_infected)~(1|colony)+treatment*time+offset(baseline),family=binomial,data=data) but this doesn't seem to give sensible predictions. Any thoughts on the correct syntax? cheers, Tom Wenseleers
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models