SummaryTable {MplusAutomation} | R Documentation |
Create a summary table of Mplus model statistics
Description
Creates output (optionally sent to a file) containing a summary table of model fit statistics
extracted using the extractModelSummaries
function.
By default, the following summary statistics are included:
Title, LL, Parameters, AIC, AICC, BIC, RMSEA_Estimate
,
but these are customizable using the keepCols
and dropCols
parameters.
Usage
SummaryTable(
modelList,
type = c("none", "screen", "popup", "html", "latex", "markdown"),
filename = "",
keepCols,
dropCols,
sortBy = NULL,
caption = "",
display = FALSE,
...,
include.rownames = FALSE
)
Arguments
modelList |
A list of models returned from the |
type |
A character vector indicating the type of output format to be generated. One of: “none”, “screen”, “popup”, “html”, “latex”, or “markdown”. Screen results in a simple summary table being sent to the R console. |
filename |
The name of the file to be created. Can be an absolute or relative path. If |
keepCols |
A vector of character strings indicating which columns/variables to display in the summary.
Only columns included in this list will be displayed (all others excluded). By default, |
dropCols |
A vector of character strings indicating which columns/variables to omit from the summary.
Any column not included in this list will be displayed. By default, |
sortBy |
optional. Field name (as character string) by which to sort the table. Typically an information criterion
(e.g., "AIC" or "BIC") is used to sort the table.
Defaults to |
caption |
A character string, the caption to be given to the table. Currently only applies to types “html”, “latex”, and “markdown”. |
display |
optional logical (defaults to |
include.rownames |
optional logical whether to include rownames or not. |
... |
additional arguments passed on to specific formatting types. |
Value
Invisibly returns the summary table, which can be used if the printing options avaiable are not sufficient.
Note
You must choose between keepCols
and dropCols
because it is not sensible to use these
together to include and exclude columns. The function will error if you include both parameters.
Author(s)
Joshua F. Wiley based on code by Michael Hallquist
See Also
Examples
## Not run:
m1 <- mplusObject(TITLE = "Reduced",
MODEL = "mpg ON wt;", rdata = mtcars)
m1.fit <- mplusModeler(m1, "mtcars.dat", run = 1L)
m2 <- mplusObject(TITLE = "Full",
MODEL = "mpg ON wt hp qsec;", rdata = mtcars)
m2.fit <- mplusModeler(m2, "mtcars.dat", run = 1L)
SummaryTable(list(m1.fit, m2.fit))
SummaryTable(list(m1.fit, m2.fit), type = "popup")
SummaryTable(list(m1.fit, m2.fit), type = "markdown",
keepCols = c("Title", "Parameters", "LL", "AIC", "CFI", "SRMR"),
caption = "Table of Model Fit Statistics",
split.tables = 200)
# remove files
unlink("mtcars.dat")
unlink("mtcars.inp")
unlink("mtcars.out")
unlink("Mplus Run Models.log")
closeAllConnections()
## End(Not run)