I vaguely recall that se = "bootstrap" did not work when missing = "fiml" (not sure if I am right.) However, I tried the following today and there is no warning or error message (I used only 100 bootstrap samples but I think this is not an issue for this test):
library(lavaan)
#> This is lavaan 0.6-11
#> lavaan is FREE software! Please report any bugs.
data(HolzingerSwineford1939)
model <-
"
visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
"
HolzingerSwineford1939_miss <- HolzingerSwineford1939[, paste0("x", 1:9)]
set.seed(60841)
idx <- mapply(function(x, y) c(x, y),
x = sample(seq_len(nrow(HolzingerSwineford1939_miss)), 50, replace = TRUE),
y = sample(seq_len(ncol(HolzingerSwineford1939_miss)), 50, replace = TRUE),
SIMPLIFY = FALSE)
for (i in idx) {
HolzingerSwineford1939_miss[i[1], i[2]] <- NA
}
fit <- cfa(model = model,
data = HolzingerSwineford1939_miss,
missing = "fiml",
se = "bootstrap",
bootstrap = 100)
summary(fit)
#> lavaan 0.6-11 ended normally after 51 iterations
#>
#> Estimator ML
#> Optimization method NLMINB
#> Number of model parameters 30
#>
#> Number of observations 301
#> Number of missing patterns 13
#>
#> Model Test User Model:
#>
#> Test statistic 86.784
#> Degrees of freedom 24
#> P-value (Chi-square) 0.000
#>
#> Parameter Estimates:
#>
#> Standard errors Bootstrap
#> Number of requested bootstrap draws 100
#> Number of successful bootstrap draws 100
#>
#> Latent Variables:
#> Estimate Std.Err z-value P(>|z|)
#> visual =~
#> x1 1.000
#> x2 0.533 0.142 3.764 0.000
#> x3 0.713 0.162 4.400 0.000
#> textual =~
#> x4 1.000
#> x5 1.110 0.056 19.967 0.000
#> x6 0.921 0.066 13.921 0.000
#> speed =~
#> x7 1.000
#> x8 1.194 0.165 7.232 0.000
#> x9 0.973 0.482 2.019 0.043
#>
#> Covariances:
#> Estimate Std.Err z-value P(>|z|)
#> visual ~~
#> textual 0.413 0.105 3.929 0.000
#> speed 0.251 0.056 4.511 0.000
#> textual ~~
#> speed 0.169 0.059 2.869 0.004
#>
#> Intercepts:
#> Estimate Std.Err z-value P(>|z|)
#> .x1 4.935 0.066 74.374 0.000
#> .x2 6.066 0.072 83.797 0.000
#> .x3 2.254 0.065 34.685 0.000
#> .x4 3.063 0.066 46.497 0.000
#> .x5 4.345 0.075 58.088 0.000
#> .x6 2.183 0.063 34.786 0.000
#> .x7 4.184 0.073 57.673 0.000
#> .x8 5.517 0.064 86.219 0.000
#> .x9 5.367 0.060 89.928 0.000
#> visual 0.000
#> textual 0.000
#> speed 0.000
#>
#> Variances:
#> Estimate Std.Err z-value P(>|z|)
#> .x1 0.534 0.195 2.746 0.006
#> .x2 1.129 0.104 10.870 0.000
#> .x3 0.858 0.116 7.428 0.000
#> .x4 0.372 0.046 8.074 0.000
#> .x5 0.453 0.059 7.723 0.000
#> .x6 0.362 0.045 7.982 0.000
#> .x7 0.777 0.104 7.492 0.000
#> .x8 0.452 0.125 3.634 0.000
#> .x9 0.586 0.138 4.232 0.000
#> visual 0.835 0.204 4.101 0.000
#> textual 0.987 0.120 8.224 0.000
#> speed 0.408 0.113 3.605 0.000
Does this mean that lavaan now can do bootstrapping even with missing = "fiml"? Maybe it has been able to do this for a long time but I overlooked this feature?
If it can do bootstrapping with
missing = "fiml", does it do FIML in each bootstrap sample to get the bootstrap estimates?
-- Shu Fai