Description Usage Arguments Value Examples
Visualization of each latent class in a stacked bar plot fashion (facet by item variables)
1 | stacked_bar_by_item(model, color_palette = "Greys")
|
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 |
The stacked bar plot object; the plot object will be returned
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.