View source: R/trace_paths_wright.R
trace_path | R Documentation |
This function estimates the path from x
to y
using the path tracing rules.
Note that it only works with structural parameters, so "=~"
are ignored, unless
measurement.model = TRUE
.
If you want to use the measurement model,
"~"
should be in the mod
column of pt
.
trace_path(
pt,
x,
y,
parenthesis = TRUE,
missing.cov = FALSE,
measurement.model = FALSE,
maxlen = 100,
...
)
pt |
A data frame with columns |
x |
Source variable |
y |
Destination variable |
parenthesis |
If |
missing.cov |
If |
measurement.model |
If |
maxlen |
Maximum length of a path before aborting |
... |
Additional arguments passed to trace_path |
A string with the estimated path (simplified if possible)
library(modsem)
m1 <- '
# Outer Model
X =~ x1 + x2 +x3
Y =~ y1 + y2 + y3
Z =~ z1 + z2 + z3
# Inner model
Y ~ X + Z + X:Z
'
pt <- modsemify(m1)
trace_path(pt, x = "Y", y = "Y", missing.cov = TRUE) # variance of Y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.