[R-sig-ME] Specification of binomial mixed model with custom intercept
Tom Wenseleers
Tom.Wenseleers at bio.kuleuven.be
Tue Jun 23 21:35:20 CEST 2015
Hi Jake,
Well to clarify a bit - I have actual datapoints for time=4, 8, 12 and 16, but not for t=0 days.
For t=0, however, I know that based on my treatments (injecting individuals with virus lysate or with buffer) the proportion of infected individuals was ca 0% for the CONTROL treatment and 100% for the INJECTED group.
Problem is that if this a priori constraint is not taken into account and I fit my model and make an effect plot, the prediction is not exactly 0% for the CONTROL group or 100% for the INJECTED group, even though I know that it should. So my question is whether constraints such as these can be taken into account into either binomial GLMs or binomial mixed models, e.g. by specifying custom offsets/intercepts? (I also have other similar models where I would like to be able to specify that at time=0 the initial proportion is known a priori to be 0.5)
In general my aim of specifying constraints such as these would be to obtain better fits that better/more parsimoniously reflect known facts about the actual experiments.
cheers,
Tom
________________________________________
From: R-sig-mixed-models [r-sig-mixed-models-bounces at r-project.org] on behalf of Jake Westfall [jake987722 at hotmail.com]
Sent: 23 June 2015 17:30
To: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] 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
[[alternative HTML version deleted]]
_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list