| modsem_predict | R Documentation |
modsem ModelsA generic function (and corresponding methods) that produces predicted
values or factor scores from modsem models.
modsem_predict(object, ...)
## S3 method for class 'modsem_pi'
modsem_predict(object, ...)
## S3 method for class 'modsem_da'
modsem_predict(
object,
newdata = NULL,
method = c("EBM", "ML", "Bartlett", "Regression"),
type = c("lv", "ov", "all"),
standardized = FALSE,
se = FALSE,
drop.list.single.group = TRUE,
...
)
object |
An object of class |
... |
Further arguments passed to |
newdata |
Optional |
method |
Character. Scoring method. One of |
type |
Character. Which scores to return: |
standardized |
Logical. If |
se |
Logical. If |
drop.list.single.group |
Logical. If |
* For modsem_pi: whatever lavaan::predict() returns,
which is usually a matrix of factor scores.
* For modsem_da: a numeric matrix with one row per
observation. Columns depend on type: latent variable scores
("lv"), model-implied observed-variable scores ("ov"), or
both ("all"). Columns are optionally standardised if
standardized = TRUE.
modsem_predict(modsem_pi): Wrapper for lavaan::predict
modsem_predict(modsem_da): Computes factor scores or model-implied observed-variable scores for a
modsem_da model via MAP optimisation.
m1 <- '
# Outer Model
X =~ x1 + x2 + x3
Z =~ z1 + z2 + z3
Y =~ y1 + y2 + y3
# Inner Model
Y ~ X + Z + X:Z
'
est_dca <- modsem(m1, oneInt, method = "dblcent")
head(modsem_predict(est_dca))
## Not run:
est_lms <- modsem(m1, oneInt, method = "lms")
head(modsem_predict(est_lms))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.