plot.decomposition {rineq}R Documentation

Plots a barplot of the contribution percentages in a decomposition object. Sets custom plot margins and uses the graphical parameters xlim, horiz, las and xlab which therefore cannot be customized

Description

Plots a barplot of the contribution percentages in a decomposition object. Sets custom plot margins and uses the graphical parameters xlim, horiz, las and xlab which therefore cannot be customized

Usage

## S3 method for class 'decomposition'
plot(x, decreasing = TRUE, horiz = FALSE, ...)

Arguments

x

Object returned from decomposition function

decreasing

Whether to sort contributions decreasing or not

horiz

If the barplots should be printed horizontally or vertically

...

Graphical parameter passed on to base::barplot()

Value

Invisibly returns x as the function is called for side effects (plotting).

Examples

data(housing)
# Linear regression & decompose 
fit.lm <- lm(bmi ~ sex + tenure + place + age,data = housing)
contrib.lm <- contribution(fit.lm, housing$income)

# plot horizontally, in increasing order
plot(contrib.lm, decreasing = FALSE, horiz = TRUE)

[Package rineq version 0.2.3 Index]