Score test (or Lagrange Multiplier test) for releasing one or more fixed or constrained parameters in model.
lavTestScore(object, add = NULL, release = NULL,
univariate = TRUE, cumulative = FALSE, epc = FALSE,
verbose = FALSE, warn = TRUE)
Either a character string (typically between single quotes) or a parameter table containing additional (currently fixed-to-zero) parameters for which the score test must be computed.
Vector of Integers. The indices of the constraints that should be released. The indices correspond to the order of the equality constraints as they appear in the parameter table.
Logical. If TRUE
, compute the univariate score
statistics, one for each constraints.
Logical. If TRUE
, order the univariate score
statistics from large to small, and compute a series of
multivariate score statistics, each time adding an additional constraint.
Logical. If TRUE
, and we are releasing existing constraints,
compute the expected parameter changes for the existing (free) parameters,
for each released constraint.
Logical. Not used for now.
Logical. If TRUE
, print out warnings if they occur.
A list containing at least three elements: the Score test statistic (stat), the degrees of freedom (df), and a p-value under the chi-square distribution (p.value). If univariate tests were requested, an additional element (TS.univariate) containing a numeric vector of univariate score statistics. If cumulative tests were requested, an additional element (TS.order) showing the order of the univariate test statistics, and an element (TS.cumulative) containing a numeric vector of cumulative multivariate score statistics.
This function can be used to compute both multivariate and univariate
score tests. There are two modes: 1) releasing fixed-to-zero parameters
(using the add
argument), and 2) releasing existing equality
constraints (using the release
argument). The two modes can not
be used simultaneously.
When adding new parameters, they should not already be part of the model (i.e. not listed in the parameter table). If you want to test for a parameter that was explicitly fixed to a constant (say to zero), it is better to label the parameter, and use an explicit equality constraint.
Bentler, P. M., & Chou, C. P. (1993). Some new covariance structure model improvement statistics. Sage Focus Editions, 154, 235-255.
# NOT RUN {
HS.model <- '
visual =~ x1 + b1*x2 + x3
textual =~ x4 + b2*x5 + x6
speed =~ x7 + b3*x8 + x9
b1 == b2
b2 == b3
'
fit <- cfa(HS.model, data=HolzingerSwineford1939)
# test 1: release both two equality constraints
lavTestScore(fit, cumulative = TRUE)
# test 2: the score test for adding two (currently fixed
# to zero) cross-loadings
newpar = '
visual =~ x9
textual =~ x3
'
lavTestScore(fit, add = newpar)
# }
Run the code above in your browser using DataLab