Anova.mp: ANOVA-style results for a multinomial-Poisson model

View source: R/Anova.mp.R

Anova.mpR Documentation

ANOVA-style results for a multinomial-Poisson model

Description

Get ANOVA-style results for a model returned by glm.mp or glmer.mp. The output table contains chi-square results for the main effects and interactions indicated by the given model.

Usage

Anova.mp(model, type = c(3, 2, 1, "III", "II", "I"))

Arguments

model

A model built by glm.mp or glmer.mp. (The underlying model will have been built by glm or glmer, with family=poisson.)

type

In the case of a Type II or Type III ANOVA, this value will be the type parameter passed to Anova. In the case of a Type I ANOVA, for models built with glm.mp, the anova.glm function will be called; for models built with glmer.mp, the anova.merMod function will be called. The default is 3. See the details for Anova.

Details

For Type II or III ANOVAs, the Anova.mp function uses Anova behind the scenes to produce an ANOVA-style table with chi-square results. For Type I ANOVAs, it uses anova.glm or anova.merMod, depending on the model.

Users wishing to verify the correctness of these results can compare Anova results for dichotomous response models built with glm or glmer (using family=binomial) to Anova.mp results for models built with glm.mp or glmer.mp, respectively. The results should be similar.

Users can also compare Anova results for polytomous response models built with multinom to Anova.mp results for models built with glm.mp. Again, the results should be similar.

To date, there is no similarly easy comparison for polytomous response models with repeated measures. This lack of options was a key motivation for developing glmer.mp in the first place.

Value

An ANOVA-style table of chi-square results for models built by glm.mp or glmer.mp. See the return values for Anova, anova.glm, or anova.merMod.

Author(s)

Jacob O. Wobbrock

References

Baker, S.G. (1994). The multinomial-Poisson transformation. The Statistician 43 (4), pp. 495-504. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/2348134")}

Chen, Z. and Kuo, L. (2001). A note on the estimation of the multinomial logit model with random effects. The American Statistician 55 (2), pp. 89-95. https://www.jstor.org/stable/2685993

Guimaraes, P. (2004). Understanding the multinomial-Poisson transformation. The Stata Journal 4 (3), pp. 265-273. https://www.stata-journal.com/article.html?article=st0069

Lee, J.Y.L., Green, P.J.,and Ryan, L.M. (2017). On the “Poisson trick” and its extensions for fitting multinomial regression models. arXiv preprint available at \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.1707.08538")}

See Also

glm.mp(), glm.mp.con(), glmer.mp(), glmer.mp.con(), car::Anova(), stats::anova.glm(), lme4::anova.merMod()

Examples

library(multpois)

## two between-subjects factors (X1,X2) with polytomous response (Y)
data(bs3, package="multpois")

bs3$PId = factor(bs3$PId)
bs3$Y = factor(bs3$Y)
bs3$X1 = factor(bs3$X1)
bs3$X2 = factor(bs3$X2)
contrasts(bs3$X1) <- "contr.sum"
contrasts(bs3$X2) <- "contr.sum"

m1 = glm.mp(Y ~ X1*X2, data=bs3)
Anova.mp(m1, type=3)

## two within-subjects factors (X1,X2) with polytomous response (Y)
data(ws3, package="multpois")

ws3$PId = factor(ws3$PId)
ws3$Y = factor(ws3$Y)
ws3$X1 = factor(ws3$X1)
ws3$X2 = factor(ws3$X2)
contrasts(ws3$X1) <- "contr.sum"
contrasts(ws3$X2) <- "contr.sum"

m2 = glmer.mp(Y ~ X1*X2 + (1|PId), data=ws3)
Anova.mp(m2, type=3)


multpois documentation built on April 3, 2025, 9:37 p.m.