lsem.test.Rd
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
Global Wald test for model parameters
Output for fitted regression models
Original model parameters after fitting (i.e., smoothing) a particular
parameter using a regression model specified in models
.
Bootstrapped model parameters after fitting (i.e., smoothing)
a particular parameter using a regression model specified in models
.
See also lsem.estimate
for estimating LSEM models and
lsem.bootstrap
for bootstrapping LSEM models.
if (FALSE) { ############################################################################# # 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(mod1) #-- 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) }