Learn R Programming

psychomix (version 1.1-9)

effectsplot: 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, ...)

Arguments

object

Fitted model object.

...

Arguments passed to plot.eff, plot.efflist, or plot.effpoly.

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. The interface is not yet fully tested and may change in future versions.

References

Fox, J. (2003). Effect Displays in R for Generalised Linear Models. Journal of Statistical Software, 8(15), 1--27. tools:::Rd_expr_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. tools:::Rd_expr_doi("10.18637/jss.v032.i01")

See Also

effect, allEffects, multinom, glm

Examples

Run this code
# \donttest{
## 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 example
suppressWarnings(RNGversion("3.5.0"))
set.seed(2)
cm4 <- btmix(preference ~ gender + education + age + crisis, data = gp, k = 4, nrep = 1)

## inspect mixture and effects
library("lattice")
xyplot(cm4)
effectsplot(cm4)

## vis effects package directly
if(require("effects")) {
eff4 <- allEffects(cm4)
plot(eff4)
}
# }

Run the code above in your browser using DataLab