Skip to contents

This function plots the decomposition of aggregate change as a stacked bar chart showing composition, within-group change, and interaction effects at each time period, with a line following the overall mean.

Usage

decompPlot(data, cols = c("#66c5cc", "#f6cf71", "#f89c74"), bar_width = 1)

Arguments

data

A data frame generated by decomp.

cols

The color palette for the three effects (composition, within-change, and interaction), as a character vector of length 3.

bar_width

The half-width of each bar in time units.

Value

A ggplot2 object.