Learn R Programming

semTools (version 0.5-1)

lavTestScore.mi: Score Test for Multiple Imputations

Description

Score test (or "Lagrange multiplier" test) for lavaan models fitted to multiple imputed data sets. Statistics for releasing one or more fixed or constrained parameters in model can be calculated by pooling the gradient and information matrices pooled across imputed data sets using Rubin's (1987) rules, or by pooling the score test statistics across imputed data sets (Li, Meng, Raghunathan, & Rubin, 1991).

Usage

lavTestScore.mi(object, add = NULL, release = NULL, test = c("D2",
  "Rubin"), scale.W = FALSE, asymptotic = !is.null(add),
  univariate = TRUE, cumulative = FALSE, epc = FALSE,
  verbose = FALSE, warn = TRUE, information = "expected")

Arguments

object

An object of class '>lavaan.mi.

add

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.

release

Vector of integers. The indices of the equality constraints that should be released. The indices correspond to the order of the equality constraints as they appear in the parameter table.

test

character indicating which pooling method to use. "Rubin" indicates Rubin's (1987) rules will be applied to the gradient and information, and those pooled values will be used to calculate modification indices in the usual manner. "D2" (default), "LMRR", or "Li.et.al" indicate that modification indices calculated from each imputed data set will be pooled across imputations, as described in Li, Meng, Raghunathan, & Rubin (1991) and Enders (2010).

scale.W

logical. If FALSE (default), the pooled information matrix is calculated as the weighted sum of the within-imputation and between-imputation components. Otherwise, the pooled information is calculated by scaling the within-imputation component by the average relative increase in variance (ARIV; see Enders, 2010, p. 235). Not recommended, and ignored (irrelevant) if test = "D2".

asymptotic

logical. If FALSE (default when using add to test adding fixed parameters to the model), the pooled test will be returned as an F-distributed variable with numerator (df1) and denominator (df2) degrees of freedom. If TRUE, the pooled F statistic will be multiplied by its df1 on the assumption that its df2 is sufficiently large enough that the statistic will be asymptotically \(\chi^2\) distributed with df1. When using the release argument, asymptotic will be set to TRUE because (A)RIV can only be calculated for added parameters.

univariate

logical. If TRUE, compute the univariate score statistics, one for each constraint.

cumulative

logical. If TRUE, order the univariate score statistics from large to small, and compute a series of multivariate score statistics, each time including an additional constraint in the test.

epc

logical. If TRUE, and we are releasing existing constraints, compute the expected parameter changes for the existing (free) parameters (and any specified with add), if all constraints were released. For EPCs associated with a particular (1-df) constraint, only specify one parameter in add or one constraint in release.

verbose

logical. Not used for now.

warn

logical. If TRUE, print warnings if they occur.

information

character indicating the type of information matrix to use (check lavInspect for available options). "expected" information is the default, which provides better control of Type I errors.

Value

A list containing at least one data.frame:

  • $test: The total score test, with columns for the score test statistic (X2), the degrees of freedom (df), and a p value under the \(\chi^2\) distribution (p.value).

  • $uni: Optional (if univariate=TRUE). Each 1-df score test, equivalent to modification indices.

  • $cumulative: Optional (if cumulative=TRUE). Cumulative score tests.

  • $epc: Optional (if epc=TRUE). Parameter estimates, expected parameter changes, and expected parameter values if all the tested constraints were freed.

See lavTestScore for details.

References

Bentler, P. M., & Chou, C.-P. (1992). Some new covariance structure model improvement statistics. Sociological Methods & Research, 21(2), 259--282. doi:10.1177/0049124192021002006

Enders, C. K. (2010). Applied missing data analysis. New York, NY: Guilford.

Li, K.-H., Meng, X.-L., Raghunathan, T. E., & Rubin, D. B. (1991). Significance levels from repeated p-values with multiply-imputed data. Statistica Sinica, 1(1), 65--92. Retrieved from https://www.jstor.org/stable/24303994

Rubin, D. B. (1987). Multiple imputation for nonresponse in surveys. New York, NY: Wiley.

See Also

lavTestScore

Examples

Run this code
# NOT RUN {
 
# }
# NOT RUN {
## impose missing data for example
HSMiss <- HolzingerSwineford1939[ , c(paste("x", 1:9, sep = ""),
                                      "ageyr","agemo","school")]
set.seed(12345)
HSMiss$x5 <- ifelse(HSMiss$x5 <= quantile(HSMiss$x5, .3), NA, HSMiss$x5)
age <- HSMiss$ageyr + HSMiss$agemo/12
HSMiss$x9 <- ifelse(age <= quantile(age, .3), NA, HSMiss$x9)

## impute missing data
library(Amelia)
set.seed(12345)
HS.amelia <- amelia(HSMiss, m = 20, noms = "school", p2s = FALSE)
imps <- HS.amelia$imputations

## specify CFA model from lavaan's ?cfa help page
HS.model <- '
  speed =~ c(L1, L1)*x7 + c(L1, L1)*x8 + c(L1, L1)*x9
'

out <- cfa.mi(HS.model, data = imps, group = "school", std.lv = TRUE)

## Mode 1: Score test for releasing equality constraints

## default test: Li et al.'s (1991) "D2" method
lavTestScore.mi(out, cumulative = TRUE)
## Rubin's rules
lavTestScore.mi(out, test = "Rubin")

## Mode 2: Score test for adding currently fixed-to-zero parameters
lavTestScore.mi(out, add = 'x7 ~~ x8 + x9')

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab