Missing data

If you have missing data you can use the missing = "ML" argument to ask lavaan to estimate the ‘full information maximum likelihood’ (see http://lavaan.ugent.be/tutorial/est.html).

# fit ML model including mean structure to make comparable with FIML fit below
# (means are always included with FIML model fits)
sem.mod.fit <- sem(sem.mod, data=tpb.df, meanstructure=TRUE)

# fit again including missing data also
sem.mod.fit.fiml <- sem(sem.mod, data=tpb.df, missing="ML")

It doesn’t look like the parameter estimates change much. To compare them explicitly we can extract the relevant coefficients from each (they don’t look all that different):

bind_cols(parameterestimates(sem.mod.fit) %>%
    select(lhs, op, rhs, est, pvalue) %>%
    rename(ml=est, ml.p = pvalue),
  parameterestimates(sem.mod.fit.fiml) %>%
    transmute(fiml=est, fiml.p = pvalue)) %>%
  # select only the regression paths
  filter(op=="~") %>%
  as_huxtable() %>%
  set_caption("Comparison of ML and MLM parameter estimates.") %>%
  print_md()
-------------------------------------------------------
 intention ~   AT        0.379   0.0513 0.306   0.0608 
---------- --- --------- ----- -------- ----- ---------
 intention ~   SN        0.472   0.0234 0.479  0.00381 
                                                       
 intention ~   PBC        1.09 3.51e-12  1.05 2.01e-13 
                                                       
 exercise  ~   intention  5.91        0   5.9        0 
-------------------------------------------------------

Table: Comparison of ML and MLM parameter estimates.