[R-sig-ME] Binomial dependent variable in a mixed-model design

Douglas Bates bates at stat.wisc.edu
Fri Jul 11 15:28:09 CEST 2008

On Fri, Jul 11, 2008 at 7:49 AM, Jan Rummel
<rummelj at staff.uni-marburg.de> wrote:
> Dear Mr. Bates,
> Thank you for your quick reply. I tried to use your lme4 package. But I
> think the problem still remains the same. If I use the comand "binomial" for
> specifying the scale of my dependent variable the program would allow binary
> data only.
> Is there any posibility to allow binomial data such as described below
> (number of hits either 0,1,2,or3)?

You can specify a binomial response by providing a matrix with columns
of # of successes and # of failures on the left hand side of the model
formula.  See




> Thank you very much and sorry again for the inconvenience.
> jan
> -----Ursprüngliche Nachricht-----
> Von: dmbates at gmail.com [mailto:dmbates at gmail.com] Im Auftrag von Douglas
> Bates
> Gesendet: Mittwoch, 9. Juli 2008 20:16
> An: rummelj at staff.uni-marburg.de
> Betreff: Re: Binomial dependent variable in a mixed-model design
> What you are describing is called a generalized linear mixed model.
> The lme4 package for R has facilities for fitting such models.  See the
> function glmer.
> On Fri, Jul 4, 2008 at 4:11 AM, Jan Rummel <rummelj at staff.uni-marburg.de>
> wrote:
>> Dear Mr Bates,
>> I am a Phd-Student at the University of Marburg (Germany). And I have
>> a question concerning your lme-package for R.
>> I have conducted an experiment with one between-subject factor "group"
>> (group1 vs. group2) and one within-subject factor "stage" (high vs. low).
>> My dependent variable is binomial. It's the number of hits witch can
>> be either 0, 1, 2, or 3.
>> To analyse my data I tried your lme-implementation in R.
>> Unfortunately, lme only allows binary data under the command
>> "binomial" for the distribution of the DV. So, I got the error message
>> that only 0 and 1 are possible values of the DV.
>> Is there any posbility to analyse my data in lme? And if so, how do I
>> have to modify my the R syntax for that? I am interested in the
>> between-subject main effects, the within-subject main effects, and the
> interaction as well.
>> Sorry for any inconvenience.
>> Thank you very much and best wishes.
>> Jan
>> --
>> Jan Rummel
>> Department of Psychology
>> University of Marburg
>> Gutenbergstr. 18
>> 35032 Marburg
>> Germany
>> Phone: +49(0)6421/2823646
>> Email: jan.rummel at staff.uni-marburg.de

More information about the R-sig-mixed-models mailing list