effectstars.vglm {EffectStars2}R Documentation

Plot effect stars for vglm objects.

Description

Plots effect stars for vglm-objects. In particular, the method works for multinomial logit models created by family multinomial and for models with ordinal response like sratio, cratio, cumulative or acat.

For more details on plotting effect stars see effectstars.

Usage

## S3 method for class 'vglm'
effectstars(x, p.values = FALSE, symmetric = TRUE,
  plot.parallel = FALSE, ...)

Arguments

x

A vglm-object.

p.values

Should the p-values of the single coefficients be included in the labels? Default is FALSE.

symmetric

Should the parameters be transformed to parameters with symmetric (sum-to-zero) side constraints instead of using reference levels. Default is TRUE for multinomial-models. If the multinomial-model contains object-specific covariates (xij argument from vglm.control) symmetric side constraints are not possible. In ordinal response models, no side constraints are needed and the option is obsolete.

plot.parallel

Should parallel parameters (equal over all response categories) be represented by effect stars. Default is FALSE.

...

further arguments for generic function effectstars.

Author(s)

Gunther Schauberger
gunther.schauberger@tum.de

https://www.sg.tum.de/epidemiologie/team/schauberger/

References

Tutz, G. and Schauberger, G. (2013): Visualization of Categorical Response Models - from Data Glyphs to Parameter Glyphs, Journal of Computational and Graphical Statistics 22(1), 156–177.

Gerhard Tutz (2012): Regression for Categorical Data, Cambridge University Press

See Also

effectstars effectstars.DIFlasso

Examples

## Not run: 
############################################
### Examples for multinomial logit model
############################################

### German election data
data(election) 
library(VGAM)
m_elect <- vglm(Partychoice ~ Gender + West + Age + Union + Highschool + Unemployment
+ Pol.Interest + Democracy + Religion, family = multinomial(), data = election)

effectstars(m_elect)

# include p.values
effectstars(m_elect, p.values = TRUE)

### German election data with category-specific covariates

data(election)
election[,13:16] <- election[,13:16] - election[,12]
election[,18:21] <- election[,18:21] - election[,17]
election[,23:26] <- election[,23:26] - election[,22]
election[,28:31] <- election[,28:31] - election[,27]

election$Social <- election$Social_SPD
election$Immigration <- election$Immigration_SPD
election$Nuclear <- election$Nuclear_SPD
election$Left_Right <- election$Left_Right_SPD

m.all <- vglm(Partychoice ~ Social + Immigration + Nuclear + Left_Right + Age + 
                Religion + Democracy + Pol.Interest + Unemployment + Highschool + Union + West + 
                Gender, data = election, 
                family = multinomial(parallel = TRUE~-1 + Social + Immigration + 
                Nuclear + Left_Right, refLevel = 1),
              xij = list(Social ~ Social_SPD + Social_FDP + Social_Greens + Social_Left,
                         Immigration ~ Immigration_SPD + Immigration_FDP + 
                         Immigration_Greens + Immigration_Left,
                         Nuclear ~ Nuclear_SPD + Nuclear_FDP + 
                         Nuclear_Greens + Nuclear_Left,
                         Left_Right ~ Left_Right_SPD + Left_Right_FDP + 
                         Left_Right_Greens + Left_Right_Left),
              form2 = ~Social + Immigration + Nuclear + Left_Right + Age + 
                Religion + Democracy + Pol.Interest + Unemployment + Highschool + Union + West + 
                Gender + Social_SPD + Social_FDP + Social_Greens + Social_Left +
                Immigration_SPD + Immigration_FDP + Immigration_Greens + Immigration_Left +
                Nuclear_SPD + Nuclear_FDP + Nuclear_Greens + Nuclear_Left +
                Left_Right_SPD + Left_Right_FDP + Left_Right_Greens + Left_Right_Left
)

effectstars(m.all, symmetric = FALSE, p.values = TRUE)
summary(m.all)


### Chilean plebiscite data
data(plebiscite)
m_chile <- vglm(Vote ~ ., family = multinomial(), data = plebiscite)
effectstars(m_chile)

# choose fixed circle sizes and use reference category instead of symmetric side constraints
effectstars(m_chile, symmetric = FALSE, fixed = TRUE)

############################################
### Examples for ordinal data
############################################

### Munich insolvency data
data(insolvency)
insolvency$Age <- scale(insolvency$Age)

my_formula <- Insolvency ~ Age + Gender

m_acat <- vglm(my_formula, data = insolvency,family = acat())
m_cratio <- vglm(my_formula, data = insolvency,family = cratio())
m_sratio <- vglm(my_formula, data = insolvency,family = sratio())
m_cumulative <- vglm(my_formula, data = insolvency,family = cumulative())

summary(m_acat)
effectstars(m_acat, p.values = TRUE)

summary(m_cratio)
effectstars(m_cratio, p.values = TRUE)

summary(m_sratio)
effectstars(m_sratio, p.values = TRUE)

summary(m_cumulative)
effectstars(m_cumulative, p.values = TRUE)

## End(Not run)

[Package EffectStars2 version 0.1-3 Index]