8.2.2 Missing values
If the data contain missing values, the default behavior is listwise deletion. If the missing mechanism is
MCAR (missing completely at random) or MAR (missing at random), the lavaan package provides case-wise
(or ‘full information’) maximimum likelihood estimation. You can turn this feature on, by using the argument
missing="ml" when calling the fitting function. An unrestricted (h1) model will automatically be estimated,
so that all common fit indices are available.
8.2.3 Standard Errors
Standard errors are (by default) based on the expected information matrix. The only exception is when data
are missing and full information ML is used (via missing="ml"). In this case, the observed information matrix
is used to compute the standard errors. The user can change this behavior by using the information argument,
which can be set to "expected" or "observed". If the estimator is simply "ML", you request robust standard
errors by using the se argument, which can be set to "robust.mlm", "robust.mlr" or "first.order". Or simply
to "none" if you don’t need them. This will not affect the test statistic. In fact, you can choose the test statistic
independently by using the "test" argument, which can be set to "Satorra-Bentler" of "Yuan-Bentler".
8.3 Modification Indices
Modification indices can be requested by adding the modindices=TRUE argument in the summary call, or by
calling the modindices function directly. The modindices function returns a data frame. For example, to see
only the modification indices for the factor loadings, you can use something like this:
> fit <- cfa(HS.model, data = HolzingerSwineford1939)
> mi <- modindices(fit)
> mi[mi$op == "=~", ]
lhs op rhs mi epc sepc.lv sepc.all
1 visual =~ x1 NA NA NA NA
2 visual =~ x2 0.000 0.000 0.000 0.000
3 visual =~ x3 0.000 0.000 0.000 0.000
4 visual =~ x4 1.211 0.077 0.069 0.059
5 visual =~ x5 7.441 -0.210 -0.189 -0.147
6 visual =~ x6 2.843 0.111 0.100 0.092
7 visual =~ x7 18.631 -0.422 -0.380 -0.349
8 visual =~ x8 4.295 -0.210 -0.189 -0.187
9 visual =~ x9 36.411 0.577 0.519 0.515
10 textual =~ x1 8.903 0.350 0.347 0.297
11 textual =~ x2 0.017 -0.011 -0.011 -0.010
12 textual =~ x3 9.151 -0.272 -0.269 -0.238
13 textual =~ x4 NA NA NA NA
14 textual =~ x5 0.000 0.000 0.000 0.000
15 textual =~ x6 0.000 0.000 0.000 0.000
16 textual =~ x7 0.098 -0.021 -0.021 -0.019
17 textual =~ x8 3.359 -0.121 -0.120 -0.118
18 textual =~ x9 4.796 0.138 0.137 0.136
19 speed =~ x1 0.014 0.024 0.015 0.013
20 speed =~ x2 1.580 -0.198 -0.123 -0.105
21 speed =~ x3 0.716 0.136 0.084 0.075
22 speed =~ x4 0.003 -0.005 -0.003 -0.003
23 speed =~ x5 0.201 -0.044 -0.027 -0.021
24 speed =~ x6 0.273 0.044 0.027 0.025
25 speed =~ x7 NA NA NA NA
26 speed =~ x8 0.000 0.000 0.000 0.000
27 speed =~ x9 0.000 0.000 0.000 0.000
Modification indices are printed out for each nonfree (or nonredundant) parameter. The modification indices
are supplemented by the expected parameter change values (column epc). The last two columns are the
standardized and completely standardized EPC values respectively.
8.4 Extracting information from a fitted model
The summary function gives a nice overview of a fitted model, but is for display only. If you need the actual
numbers for further processing, you may prefer to use one of several ‘extractor’ functions. We have already
seen the coef function which extracts the estimated parameters of a fitted model. Other extractor functions
are discussed below.
26