
Plot each profile's probability of one response category on every categorical or ordinal indicator
Source:R/plot-named.R
plot_responses.Rdplot_responses() plots how likely each profile (class) is to give one
response category. There is one line per profile, joining the probability of
the chosen category on every categorical or ordinal indicator, on a 0 to 1
axis. The categorical indicators carry 95% intervals, formed on the logit
scale, when the fit has standard errors.
Usage
plot_responses(
x,
category = "last",
intervals = TRUE,
labels = TRUE,
data = NULL,
main = NULL,
subtitle = NULL
)Arguments
- x
A profile, class or transition fit with categorical or ordinal indicators: from
lca(),multilca(),lpa()ormultilpa()(with or without membership covariates), or fromlta()with categorical indicators. Anlta()fit of classmultilpa_lta(ordinal or count indicators, covariates, weights, a stayer class, second-order or occasion-specific transitions, occasion-specific measurement) is not drawn: read its probabilities withget_results(x, "responses")orget_results(x, "ordinal").- category
Which category's probability is drawn:
"last"(default): the last category of each indicator, which for a no/yes indicator is the probability of "yes";"first": the first category of each indicator;one category label (such as
"yes") or one whole-number position (such as2), which every indicator must have.
- intervals
TRUE(default) draws the 95% intervals ofparameter_inference(); a fit that has no standard errors is drawn without them, and the subtitle says why. A probability estimated at 0 or 1 is held there and has no interval.FALSEdraws no intervals and does not compute them.- labels
TRUE(default) writes each profile's name at the end of its line;FALSEuses a legend instead.- data
The data frame the model was fitted to, used only to compute the intervals.
NULL(default) uses the data stored in the fit.- main, subtitle
Title and subtitle of the plot, each one string;
NULL(default) keeps the view's own.
Value
A ggplot object, which draws the plot when printed. Conditions raised:
latents_no_categorical: a profile, class or transition fit without categorical or ordinal indicators;latents_unknown_category:categoryis not a category of every indicator;latents_nothing_to_plot: a model of another family, which has no response view; the message names the plot functions that apply;latents_not_a_fit:xis not a fitted model.
See also
plot_profiles() for continuous indicators; plot_heatmap()
for every category at once.

