Learn R Programming

MplusAutomation (version 0.6-1)

coef.mplusObject: Return coefficients for an mplusObject

Description

This is a method for returning the coefficients of an mplusObject.

Usage

## S3 method for class 'mplusObject':
coef(object,
    type = c("un", "std", "stdy", "stdyx"), ...)

Arguments

object
An object of class mplusObject
type
A character vector indicating the type of coefficients to return. One of un, std, stdy, or stdyx.
...
Additional arguments to pass on (not currently used)

Value

  • A named vector of the (unstandardized) coefficients.

Examples

Run this code
# simple example of a model using builtin data
# demonstrates use
test <- mplusObject(
  TITLE = "test the MplusAutomation Package;",
  MODEL = "
    mpg ON wt hp;
    wt WITH hp;",
  OUTPUT = "STANDARDIZED;",
  usevariables = c("mpg", "wt", "hp"),
  rdata = mtcars)

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

# example of the coef method
coef(res)
coef(res, type = "std")
coef(res, type = "stdy")
coef(res, type = "stdyx")

# remove files
unlink("mtcars.dat")
unlink("model1.inp")
unlink("model1.out")
unlink("Mplus Run Models.log")

Run the code above in your browser using DataLab