Learn R Programming

modsem (version 1.0.11)

centered_estimates: Get Centered Interaction Term Estimates

Description

Computes centered estimates of model parameters. This is relevant when there is an interaction term in the model, as the simple main effects depend upon the mean structure of the structural model. Currenlty only available for modsem_da and lavaan object. It is not relevant for the PI approaches (excluding the "pind" method, which is not recommended), since the indicators are centered before computing the product terms. The centering can be applied to observed variable interactions in lavaan models and latent interactions estimated using the sam function.

Usage

centered_estimates(object, ...)

# S3 method for lavaan centered_estimates( object, monte.carlo = FALSE, mc.reps = 10000, tolerance.zero = 1e-10, ... )

# S3 method for modsem_da centered_estimates( object, monte.carlo = FALSE, mc.reps = 10000, tolerance.zero = 1e-10, ... )

Value

A data.frame with centered estimates in the est column.

Arguments

object

An object of class modsem_da

...

Additional arguments passed to underlying methods. See specific method documentation for supported arguments, including:

monte.carlo

Logical. If TRUE, use Monte Carlo simulation to estimate standard errors; if FALSE, use the delta method (default).

mc.reps

Number of Monte Carlo repetitions. Default is 10000.

tolerance.zero

Threshold below which standard errors are set to NA.

Methods (by class)

  • centered_estimates(lavaan): Method for lavaan objects

  • centered_estimates(modsem_da): Method for modsem_da objects

Examples

Run this code
m1 <- '
  # Outer Model
  X =~ x1 + x2 + x3
  Z =~ z1 + z2 + z3
  Y =~ y1 + y2 + y3

  # Inner Model
  Y ~ X + Z + X:Z
'
if (FALSE) {
est_lms <- modsem(m1, oneInt, method = "lms")
centered_estimates(est_lms)
}

Run the code above in your browser using DataLab