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)
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
plot_model_fit(fit_comparison_table).data.frameproduced bycompare_model_fit().ggplot2object.CFI,TLI,RMSEA, andSRMRfor the models in the input table.metrics = c("cfi", "rmsea")).Example Usage