stacked_bar_by_item: Visualization of each latent class in a stacked bar plot...

Description Usage Arguments Value Examples

Description

Visualization of each latent class in a stacked bar plot fashion (facet by item variables)

Usage

1
stacked_bar_by_item(model, color_palette = "Greys")

Arguments

model

This parameter expects to be the fitted latent class model object

color_palette

The color palette for the plot; default at "Greys," you could change to any palette from brewer.pal from RColorBrewer package

Value

The stacked bar plot object; the plot object will be returned

Examples

1
2
3
4
5
6
7
8
9
# Find out the best model according to the BIC criterion
best_model = find_best_fit(data, form, "bic")
# Pass the model object into the stacked_bar_plot function
# The function will return the plot object
p = stacked_bar_plot(best_model)
# If you want to further customize the plot, you could add more adjustments on top of
the plot object. For example:
p + theme(plot.margin=unit(c(1.5,1.5,1.5,1.2),"cm")) +
  labs(title = "The title name that you want")

DavidykZhao/LCA_plotter documentation built on Dec. 11, 2019, 8:38 p.m.