Learn R Programming

epmfd (version 1.1.1)

plot_epmfd: Plot methods for epmfd objects

Description

Quick visual summaries for three object classes:

  • epmfd_scaled: Item-level retention summary (Kept vs Removed) and a quality-statistic histogram (either discrimination a for mirt or scalability H_i for mokken).

  • epmfd_misfit: Bar plot of misfit counts per statistic and a global bar summarizing overall misfit ratio.

  • epmfd_clean: Bar plot comparing remaining vs removed persons.

Usage

# S3 method for epmfd_scaled
plot(x, ...)

# S3 method for epmfd_misfit plot(x, ...)

# S3 method for epmfd_clean plot(x, ...)

Value

A single ggplot2 object, a patchwork object (if available), or a list of ggplot2 objects—depending on the class and whether combined layout is possible.

Arguments

x

An epmfd_scaled, epmfd_misfit, or epmfd_clean object.

...

Additional aesthetics or layers forwarded to the underlying ggplot2 geoms (e.g., alpha, linewidth).

Dependencies

These methods use ggplot2. For epmfd_scaled objects fitted with mirt, the method accesses model coefficients via mirt if that package is installed (it is not required for mokken). Stacking multiple plots uses patchwork when available.

Details

If the patchwork package is installed, paired plots are stacked vertically and returned as a single patchwork object; otherwise a list of two ggplot2 objects is returned.

See Also

plot_misfit for 2D/3D scatter visualizations of person-level misfit, and misfit_epmfd / clean_epmfd for producing the inputs to these plots.

Examples

Run this code
if (FALSE) {
# \donttest{
# Scaled object
p_scaled <- plot(scaled_obj)               # item retention + quality histogram

# Misfit object
p_mf <- plot(misfit_obj)                   # per-statistic counts + overall ratio

# Cleaned object
p_cl <- plot(clean_obj)                    # remaining vs removed persons

# Add ggplot2 options through '...'
plot(misfit_obj, alpha = 0.8)
# }
}

Run the code above in your browser using DataLab