Maggie Wisniewska
2013-May-29 23:22 UTC
[R] lmer (multinomial response variable ~ fixed + (1|random), family='"multinomial" ???)
Hello, I am trying to run glmm to test the effect of the three fixed effects [AGE (weaned vs. unweaned claf), LOCATION (zoo vs. park), MOTher's social status (matriarch vs. nonmatriarch)] and one random effect [ID (12 different calves of whom I have multiple but unbalanced observations)] on the a multinomial response variable [DIST (distance from mom at less than 2 meters,between 2-5 meters and at more than 5 meters). Is the *family binomial* argument in my code incorrect for my data? If it is incorrect, is there a way to test this model with *multinomial response variable*? OConnell.glmm1<-lmer(DIST~AGE+LOC+MOT+(1|ID),data=OConnell,family=binomial(link = "logit") Thank you for reading. Maggie [[alternative HTML version deleted]]
Ben Bolker
2013-May-31 00:38 UTC
[R] lmer (multinomial response variable ~ fixed + (1|random), family='"multinomial" ???)
Maggie Wisniewska <maggie.wisniewska <at> gmail.com> writes:> > Hello, > I am trying to run glmm to test the effect of the three fixed effects [AGE > (weaned vs. unweaned claf), LOCATION (zoo vs. park), MOTher's social status > (matriarch vs. nonmatriarch)] and one random effect [ID (12 different > calves of whom I have multiple but unbalanced observations)] on the a > multinomial response variable [DIST (distance from mom at less than 2 > meters,between 2-5 meters and at more than 5 meters). Is the *family > binomial* argument in my code incorrect for my data? If it is incorrect, > is there a way to test this model with *multinomial response variable*? >OConnell.glmm1<-lmer(DIST~AGE+LOC+MOT+(1|ID),data=OConnell,family=binomial(link> = "logit") >This would probably be better asked on the specialized r-sig-mixed-models at r-project.org mailing list. It looks like you really want to fit an ordinal model (i.e. your categories are naturally ordered, as opposed to a case where your responses were unordered, e.g. "chocolate", "strawberry", "vanilla", "maple walnut"). The 'ordinal' package will allow you to fit these kinds of models. PS (somewhat tangential) As far as I know the only mixed model package available for R that can handle multinomial models in a simple way is the MCMCglmm package. Multinomial models are relatively easy to code as variations on binomial models: http://en.wikipedia.org/wiki/Generalized_linear_model#Multinomial_regression http://www.math.ntnu.no/inla/r-inla.org/papers/multinomial-poisson.pdf (the latter is provided by the INLA web site, another mixed model package) but this won't help if you just want a quick "black-box" solution.