Skip to content

[Feature] Implement plot_model_fit() for visualizing fit indices #19

@brianmsm

Description

@brianmsm

User Story

As a user, comparing models by looking at a table of numbers can be difficult. I want a function that creates a plot to visually compare the key fit indices (like CFI, TLI, RMSEA) of different models, making it easier to select the best one.

Acceptance Criteria

  • Create a new function plot_model_fit(fit_comparison_table).
  • The function must accept the data.frame produced by compare_model_fit().
  • It should generate a ggplot2 object.
  • By default, it should create a dot plot or bar chart comparing CFI, TLI, RMSEA, and SRMR for the models in the input table.
  • There should be an option to select which metrics to plot (e.g., metrics = c("cfi", "rmsea")).

Example Usage

# Assuming fit_1 and fit_2 are fitted lavaan objects
fit_table <- compare_model_fit(fit_1, fit_2)

# Desired outcome
plot_model_fit(fit_table)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions