Effects Displays for Concomitant Variables in Finite Mixture Models
Description
Generic function for visualizing the effects of concomitant variables in finite mixture models.
Usage
effectsplot(object, ...)
## S3 method for class 'efflist'
effectsplot(object, ask = FALSE, confint = FALSE,
style = c("lines", "stacked"), colors = NULL, ...)
## S3 method for class 'effpoly'
effectsplot(object, ask = FALSE, confint = FALSE,
style = c("lines", "stacked"), colors = NULL, ...)
## S3 method for class 'btmix'
allEffects(object, ...)
## S3 method for class 'mptmix'
allEffects(object, ...)
## S3 method for class 'raschmix'
allEffects(object, ...)
## S3 method for class 'btmix'
effect(term, mod, ...)
## S3 method for class 'mptmix'
effect(term, mod, ...)
## S3 method for class 'raschmix'
effect(term, mod, ...)
Arguments
object, mod
Fitted model object.
ask, confint, style, colors, …
Arguments passed to plot.eff, plot.efflist, or plot.effpoly.
term
character. Name of a term in the model.
Details
effectsplot is set up to be both an S3 and S4 generic. The idea is that it provides the glue needed to extract the concomitant part from a mixture model: First, the concomitant model is refitted as a multinom object or glm object (in case of a mixture with two components). Second, effect or allEffects from the effects package is called to extract the effects of the concomitants. Third, the corresponding plot methods from the effects package create the display.
Currently, this is implemented for raschmix, btmix, and mptmix objects.
References
Fox, J. (2003). Effect Displays in R for Generalised Linear Models. Journal of Statistical Software, 8(15), 1–27. doi:10.18637/jss.v008.i15
Fox, J., and Hong, J. (2009). Effect Displays in R for Multinomial and Proportional-Odds Logit Models: Extensions to the effects Package. Journal of Statistical Software, 32(1), 1–24. doi:10.18637/jss.v032.i01
See Also
effect, allEffects, multinom, glm
Examples
library("psychomix")## data on party preferences in Germany## (omit single observation with education = 1)data("GermanParties2009", package ="psychotools")gp<-subset(GermanParties2009, education!="1")gp$education<-factor(gp$education)## fit Bradley-Terry mixture, see ?btmix for more details## and a fully-worked examplesuppressWarnings(RNGversion("3.5.0"))set.seed(2)cm4<-btmix(preference~gender+education+age+crisis, data =gp, k =4, nrep =1)