get_pi_data {modsem} | R Documentation |
Get data with product indicators for different approaches
Description
get_pi_syntax is a function for creating the lavaan syntax used for estimating latent interaction models using one of the product indiactors in lavaan.
Usage
get_pi_data(model.syntax, data, method = "dblcent", match = FALSE, ...)
Arguments
model.syntax |
lavaan syntax |
data |
data to create product indicators from |
method |
method to use: "rca" = residual centering approach, "uca" = unconstrained approach, "dblcent" = double centering approach, "pind" = prod ind approach, with no constraints or centering, "custom" = use parameters specified in the function call |
match |
should product indicators be made using the match strategy |
... |
arguments passed to other functions (e.g., modsem_pi) |
Value
data.frame
Examples
library(modsem)
library(lavaan)
m1 <- '
# Outer Model
X =~ x1 + x2 +x3
Y =~ y1 + y2 + y3
Z =~ z1 + z2 + z3
# Inner model
Y ~ X + Z + X:Z
'
syntax <- get_pi_syntax(m1)
data <- get_pi_data(m1, oneInt)
est <- sem(syntax, data)
[Package modsem version 1.0.1 Index]