summary-MxModel {OpenMx} | R Documentation |
This function returns summary statistics of a model after it has been run
summary(object, ..., verbose=FALSE)
object |
A MxModel object. |
... |
Any number of named arguments (see below). |
verbose |
logical. Changes the printing style for summary (see Details) |
mxSummary allows the user to set or override the following parameters of the model:
Numeric. Specify the total number of observations for the model.
Numeric. Specify the total number of observed statistics for the model.
Numeric or MxModel object. Specify a saturated likelihood for testing.
Numeric. When SaturatedLikelihood is numeric, specify the degrees of freedom of the saturated likelihood for testing.
Logical. Set to FALSE to ignore independent submodels in summary.
The verbose
argument changes the printing style for the summary
of a model. When verbose=FALSE
, a relatively minimal amount of information is printed: the free parameters, the likelihood, and a few fit indices. When more information is available, more is printed. For example, when the model has a saturated likelihood, several additional fit indices are printed. On the other hand, when verbose=TRUE
, the compute plan, the data summary, and additional timing information are always printed. Moreover, available fit indices are printed regarless of whether or not they are defined. The undefined fit indices are printed as NA
. Running a saturated model and including it with the call to summary
will define these fit indices and they will dislay meaningful values. It should be noted that the verbose
argument only changes the printing style, all of the same information is calculated and exists in the output of summary
. More information is displayed when verbose=TRUE
, and less when verbose=FALSE
.
This function can report Error codes as follows:
1: The final iterate satisfies the optimality conditions to the accuracy requested, but the sequence of iterates has not yet converged. NPSOL was terminated because no further improvement could be made in the merit function (Mx status GREEN)
2: The linear constraints and bounds could not be satisfied. The problem has no feasible solution.
3: The nonlinear constraints and bounds could not be satisfied. The problem may have no feasible solution.
4: The major iteration limit was reached (Mx status BLUE).
6: The model does not satisfy the first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found during the final linesearch (Mx status RED)
7: The function derivates returned by funcon or funobj appear to be incorrect.
9: An input parameter was invalid
The OpenMx User's guide can be found at http://openmx.psyc.virginia.edu/documentation.
library(OpenMx) data(demoOneFactor) # load the demoOneFactor dataframe manifests <- names(demoOneFactor) # set the manifest to the 5 demo variables latents <- c("G") # define 1 latent variable model <- mxModel(model="One Factor", type="RAM", manifestVars = manifests, latentVars = latents, mxPath(from = latents, to=manifests, labels = paste("b", 1:5, sep = "")), mxPath(from = manifests, arrows = 2, labels = paste("u", 1:5, sep = "")), mxPath(from = latents, arrows = 2, free = FALSE, values = 1.0), mxData(cov(demoOneFactor), type = "cov", numObs = 500) ) model <- mxRun(model) # Run the model, returning the result into model # Show summary of the fitted model summary(model) # Compute the summary and store in the variable "statistics" statistics <- summary(model) # Access components of the summary statistics$parameters statistics$SaturatedLikelihood # Specify a saturated likelihood for testing summary(model, SaturatedLikelihood = -3000) # Add a CI and view it in the summary model = mxRun(mxModel(model=model, mxCI("b5")), intervals = TRUE) summary(model)