lsem.test | R Documentation |
Performs global and parameter tests for a fitted local structural equation model.
The LSEM must have been fitted and bootstrap estimates of the LSEM model must be
available for statistical inference. The hypothesis of a constant parameter is tested
by means of a Wald test. Moreover, regression functions can be specified and tested
if these are specified in the argument models
.
lsem.test(mod, bmod, models=NULL)
mod |
Fitted LSEM object |
bmod |
Fitted LSEM bootstrap object. The argument |
models |
List of model formulas for named LSEM model parameters |
List with following entries
wald_test_global |
Global Wald test for model parameters |
test_models |
Output for fitted regression models. The test for parameter
heterogeneity is included in |
parameters |
Original model parameters after fitting (i.e., smoothing) a particular
parameter using a regression model specified in |
parameters_boot |
Bootstrapped model parameters after fitting (i.e., smoothing)
a particular parameter using a regression model specified in |
See also lsem.estimate
for estimating LSEM models and
lsem.bootstrap
for bootstrapping LSEM models.
## Not run:
#############################################################################
# EXAMPLE 1: data.lsem01 | Age differentiation and tested models
#############################################################################
data(data.lsem01, package="sirt")
dat <- data.lsem01
# specify lavaan model
lavmodel <- "
F=~ v1+v2+v3+v4+v5
F ~~ 1*F
"
# define grid of moderator variable age
moderator.grid <- seq(4,23,1)
#-- estimate LSEM with bandwidth 2
mod <- sirt::lsem.estimate( dat, moderator="age", moderator.grid=moderator.grid,
lavmodel=lavmodel, h=2, std.lv=TRUE)
summary(mod)
#-- bootstrap model
bmod <- sirt::lsem.bootstrap(mod, R=200)
#-- test models
models <- list( "F=~v1"=y ~ m + I(m^2),
"F=~v2"=y ~ I( splines::bs(m, df=4) ) )
tmod <- sirt::lsem.test(mod=mod, bmod=bmod, models=models)
str(tmod)
sirt::print_digits(wald_test_global, 3)
sirt::print_digits(test_models, 3)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.