Learn R Programming

umx (version 1.9.1)

umxCompare: Print a comparison table of one or more mxModels, formatted nicely.

Description

umxCompare compares two or more mxModels. It has several nice features:

1. It supports direct control of rounding, and reports p-values rounded to APA style.

2. It reports the table in your preferred format (default is markdown, options include latex)

3. Table columns are arranged to make for easy comparison for readers.

4. report = 'inline', will provide an English sentence suitable for a paper.

5. 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

Usage

umxCompare(base = NULL, comparison = NULL, all = TRUE, digits = 3,
  report = c("markdown", "inline", "html", "report"), file = "tmp.html")

Arguments

base

The base mxModel for comparison

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!)

file

file to write html too if report = "html" (defaults to "tmp.html")

References

- http://www.github.com/tbates/umx/

See Also

- mxCompare, umxSummary, umxRAM,

Other Reporting functions: RMSEA.MxModel, RMSEA.summary.mxmodel, RMSEA, extractAIC.MxModel, loadings, plot.MxModel, residuals.MxModel, umxCI_boot, umxCI, umxConfint, umxExpCov, umxExpMeans, umxFitIndices, umxPlotACEcov, umxPlotACEv, umxPlotACE, umxPlotCP, umxPlotGxE, umxPlotIP, umxSummary.MxModel, umxSummaryACEv, umxSummaryACE, umx_drop_ok, umx_standardize_RAM

Examples

Run this code
# NOT RUN {
require(umx)
data(demoOneFactor)
latents  = c("G")
manifests = names(demoOneFactor)
m1 <- mxModel("One Factor", type = "RAM", 
	manifestVars = manifests, latentVars = latents, 
	mxPath(from = latents, to = manifests),
	mxPath(from = manifests, arrows = 2),
	mxPath(from = latents, arrows = 2, free = FALSE, values = 1.0),
	mxData(cov(demoOneFactor), type = "cov", numObs = 500)
)
m1 = umxRun(m1, setLabels = TRUE, setValues = TRUE)
m2 = umxModify(m1, update = "G_to_x2", name = "drop_path_2_x2")
umxCompare(m1, m2)
mxCompare(m1, m2) # what OpenMx gives by default
umxCompare(m1, m2, report = "report") # Add English-sentence descriptions
# }
# NOT RUN {
umxCompare(m1, m2, report = "html") # Open table in browser
# }
# NOT RUN {
m3 = umxModify(m2, update = "G_to_x3", name = "drop_path_2_x2_and_3")
umxCompare(m1, c(m2, m3))
umxCompare(c(m1, m2), c(m2, m3), all = TRUE)
# }

Run the code above in your browser using DataLab