Closed wepelham3 closed 6 years ago
There is already a hidden printInvarianceResult()
function that prints the tables to the screen, but it never returned anything. I updated it to return the table of anova()
output, or a list with both anova()
and fitMeasures()
output if the fit.measures=
argument is non-NULL
.
foo <- semTools:::printInvarianceResult(out, fit.measures = c("cfi", "rmsea"), method = "satorra.bentler.2001")
str(foo)
foo$anova
foo$fitMeasures
This will remain a hidden function (hence the semTools:::
) because I plan to massively update the measurementInvariance()
suite of functions in the future.
Is there an existing way to capture the summary output that gets printed to the console when you run
measurementInvariance()
? I'm referring to this...Use case would be, e.g., you're testing invariance across twenty different group variables and would like to be able to easily sort and manipulate the resulting chi square difference tests.
You might try something like this...
...except that
summary(obj)
is not the summary table that gets printed when you runmeasurementInvariance
, but a table of the fits used in producing that summary table.Right now I resort to sending the output of
measurementInvariance()
to a text file and manually parsing it back into a dataframe.Would be nice to have a function that takes the
obj
and returns the chi square test of differences / delta fit measures as a dataframe.