umxCompare | R Documentation |
mxModel()
s, formatted nicely.umxCompare compares two or more mxModel()
s. It has several nice features:
It supports direct control of rounding, and reports p-values rounded to APA style.
It reports the table in your preferred format (default is markdown, options include latex).
Table columns are arranged to make for easy comparison for readers.
report = 'inline', will provide an English sentence suitable for a paper.
report = "html" opens a web table in your browser to paste into a word processor.
Note: If you leave comparison blank, it will just give fit info for the base model
umxCompare(
base = NULL,
comparison = NULL,
all = TRUE,
digits = 3,
report = c("markdown", "html", "inline"),
compareWeightedAIC = FALSE,
silent = FALSE,
file = "tmp.html"
)
base |
The base |
comparison |
The model (or list of models) which will be compared for fit with the base model (can be empty) |
all |
Whether to make all possible comparisons if there is more than one base model (defaults to T) |
digits |
rounding for p-values etc. |
report |
"markdown" (default), "inline" (a sentence suitable for inclusion in a paper), or "html". create a web table and open your default browser. (handy for getting tables into Word, and other text systems!) |
compareWeightedAIC |
Show the Wagenmakers AIC weighted comparison (default = FALSE) |
silent |
(don't print, just return the table as a dataframe (default = FALSE) |
file |
file to write html too if report = "html" (defaults to "tmp.html") |
umxSummary()
, umxRAM()
,mxCompare()
Other Model Summary and Comparison:
umxEquate()
,
umxMI()
,
umxReduce()
,
umxSetParameters()
,
umxSummary()
,
umx
## Not run:
require(umx)
data(demoOneFactor)
manifests = names(demoOneFactor)
m1 = umxRAM("One Factor", data = demoOneFactor, type = "cov",
umxPath("G", to = manifests),
umxPath(var = manifests),
umxPath(var = "G", fixedAt = 1)
)
m2 = umxModify(m1, update = "G_to_x2", name = "drop_path_2_x2")
umxCompare(m1, m2)
umxCompare(m1, m2, report = "inline") # Add English-sentence descriptions
umxCompare(m1, m2, report = "html") # Open table in browser
# Two comparison models
m3 = umxModify(m2, update = "G_to_x3", name = "drop_path_2_x2_and_3")
umxCompare(m1, c(m2, m3))
umxCompare(m1, c(m2, m3), compareWeightedAIC = TRUE)
umxCompare(c(m1, m2), c(m2, m3), all = TRUE)
manifests = names(demoOneFactor)
m1 = umxRAM("WLS", data = demoOneFactor, type = "DWLS",
umxPath("G", to = manifests),
umxPath(var = manifests),
umxPath(var = "G", fixedAt = 1)
)
m2 = umxModify(m1, update = "G_to_x2", name = "drop_path_2_x2")
umxCompare(m1, m2)
umxCompare(m1, m2, report = "inline") # Add English-sentence descriptions
umxCompare(m1, m2, report = "html") # Open table in browser
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.