Plot Marginal Means (MMs) or AMCEs from projoint Results
plot.projoint_results.Rd
This function creates publication-ready plots based on the output from `projoint()`. It supports both profile-level and choice-level analyses, with tailored plotting options.
Arguments
- x
A `projoint_results` object, typically created by `projoint()`.
- .estimates
Character. Which estimates to plot: `"corrected"` (default), `"uncorrected"`, or `"both"`.
- .by_var
Logical. (Profile-level only) Whether to plot subgroup differences. Default is `FALSE`.
- .labels
Character vector. (Choice-level only) Custom x-axis labels for bar or point-range plots.
- .base_size
Numeric. Base font size for plot text. Default is 12.
- .base_family
Character. Base font family for plot text. Default is "" (system default).
- .type
Character. (Choice-level only) Type of plot: `"bar"` (default) or `"pointrange"`.
- .show_attribute
Logical. (Choice-level only) Whether to display the attribute name as a plot title. Default is `FALSE`.
- .remove_xaxis
Logical. (Choice-level only) Whether to remove x-axis labels and ticks. Default is `FALSE`.
- .xlim
Numeric vector of length 2. (Choice-level only) X-axis limits. Default is `c(0, 1)`.
- .plot.margin
Numeric vector of length 4. (Choice-level only) Margins around the plot in centimeters. Default is `c(0, 3, 0, 3)`.
- ...
Additional arguments passed to underlying plotting functions.
Details
For **profile-level results**, only `.by_var`, `.base_size`, and `.base_family` are relevant.
For **choice-level results**, only `.type`, `.labels`, `.show_attribute`, `.xtitle`, `.remove_xaxis`, `.xlim`, `.hjust_left`, `.hjust_right`, `.title_size`, and `.plot.margin` are relevant.
If irrelevant arguments are provided for a given structure, a warning will be issued and the arguments will be ignored.