Learn R Programming

MplusAutomation (version 0.6-1)

paramExtract: Extract parameters from a data frame of Mplus estimates

Description

This is a simple convenience function designed to facilitate looking at specific parameter types by easily return a subset of a data frame with those types only. It is designed to follow up the results returned from the readModels function.

Usage

paramExtract(x,
    type = c("directed", "undirected", "expectation", "variability"))

Arguments

x
A data frame (specifically the type returned by readModels) containing parameters. Should be specific such as unstandardized and the data frame must have a column called paramHeader.
type
A character string indicating the types of parameters to be returned. Options currently include directed, undirected, expectation, and variability. Directed paths include both re

Value

  • A subset data frame with the parameters of interest.

See Also

readModels

Examples

Run this code
test <- mplusObject(
    TITLE = "test the MplusAutomation Package and my Wrapper;",
    MODEL = "
      mpg ON wt hp;
      wt WITH hp;",
    usevariables = c("mpg", "wt", "hp"),
    rdata = mtcars)

  res <- mplusModeler(test, "mtcars.dat", modelout = "model1.inp", run = 1L)

  # store just the unstandardized parameters in 'd'
  d <- res$results$parameters$unstandardized
  # extract just directed parameters
  paramExtract(d, "directed")
  # extract other types of parameters using shorthand
  paramExtract(d, "u")
  paramExtract(d, "e")
  paramExtract(d, "v")

Run the code above in your browser using DataLab