sprocket
2011-Feb-18 11:00 UTC
[R] how to incorporate prior base probabilities into binomial glmm
Hi, I am modeling a gen linear mixed model with binomial repeated measures responses (y=cbind(correct/not correct)) of some individuals (id). I have a 2X2 design (effort and costs) and another continuous independent variable (scr). This will lead to something like this: mod.1<-lmer(y~effort+costs+scr+(1|id),family=binomial) so far so good. In my experiment the probability to score a correct depends also on a probability based on random choice. Short example: Individual 1 has to choose 5 times before a correct can happen in the high effort condition while in the low effort condition Ind 1 only has to choose 3 times. So there is a different probability associated to the low and high effort condition that an individual will choose correct. How can I incorporate this into a model or does anybody know of paper where a similar case has occurred? Ulf -- View this message in context: http://r.789695.n4.nabble.com/how-to-incorporate-prior-base-probabilities-into-binomial-glmm-tp3312442p3312442.html Sent from the R help mailing list archive at Nabble.com.
Ken Knoblauch
2011-Feb-18 13:15 UTC
[R] how to incorporate prior base probabilities into binomial glmm
sprocket <toelch <at> gmail.com> writes:> > > Hi, > > I am modeling a gen linear mixed model with binomialrepeated measures> responses (y=cbind(correct/not correct)) of someindividuals (id).> I have a 2X2 design (effort and costs) and anothercontinuous independent> variable (scr). This will lead to something like this: > > mod.1<-lmer(y~effort+costs+scr+(1|id),family=binomial) > so far so good. In my experiment the probabilityto score a correct depends> also on a probability based on random choice. Shortexample: Individual 1> has to choose 5 times before a correct can happenin the high effort> condition while in the low effort condition Ind 1 onlyhas to choose 3> times. So there is a different probability associatedto the low and high> effort condition that an individual will choose correct. > How can I incorporate this into a model or doesanybody know of paper where> a similar case has occurred? > > Ulf >I think that you have to define a new factor that distinguishes the two levels of strong effort, say EffortLeve l( for lack of imagination on a Friday afternoon) and then from what you describe, the subjects are nested in this, i.e., some had a high effort of 5 and others of 3. Perhaps, the following would work then glmer(y ~ EffortLevel/(effort + costs + scr) + (1 | id), family = binomial) I think that if each observer has a unique id, that the nesting will be automatic for this variable, but you should verify that. -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen L?pine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr/members/kenneth-knoblauch.html