\begin{Schunk}
\begin{Sinput}
 SEMModel <- "
    MATH =~ wratcalc + wjcalc + waiscalc
    SPELL =~ wratspl + wjspl + waisspl
    MATH ~ edlevel + newschl + suspend + expelled + haveld + female + age
    SPELL ~ edlevel + newschl + suspend + expelled + haveld + female + age
    MATH ~~ SPELL
  "
 output <- sem(model = SEMModel, data = dat, missing = "fiml")
 summary(output)
\end{Sinput}
\begin{Soutput}
lavaan 0.6-3 ended normally after 198 iterations

  Optimization method                           NLMINB
  Number of free parameters                         33

                                                  Used       Total
  Number of observations                           313         322
  Number of missing patterns                         4

  Estimator                                         ML
  Model Fit Test Statistic                      49.780
  Degrees of freedom                                36
  P-value (Chi-square)                           0.063

Parameter Estimates:

  Information                                 Observed
  Observed information based on                Hessian
  Standard Errors                             Standard

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)
  MATH =~                                             
    wratcalc          1.000                           
    wjcalc            0.684    0.027   25.116    0.000
    waiscalc          0.403    0.024   16.552    0.000
  SPELL =~                                            
    wratspl           1.000                           
    wjspl             1.038    0.029   35.933    0.000
    waisspl           0.967    0.028   34.549    0.000

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)
  MATH ~                                              
    edlevel           1.720    0.282    6.097    0.000
    newschl           0.535    0.649    0.824    0.410
    suspend          -1.727    0.677   -2.550    0.011
    expelled         -0.524    0.954   -0.549    0.583
    haveld           -1.495    0.858   -1.743    0.081
    female           -0.757    0.689   -1.098    0.272
    age               0.617    0.179    3.441    0.001
  SPELL ~                                             
    edlevel           1.169    0.302    3.874    0.000
    newschl          -0.212    0.694   -0.305    0.760
    suspend          -0.111    0.718   -0.155    0.877
    expelled         -2.540    1.021   -2.488    0.013
    haveld           -6.631    0.923   -7.182    0.000
    female            0.843    0.736    1.145    0.252
    age               0.349    0.192    1.819    0.069

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)
 .MATH ~~                                             
   .SPELL            15.401    2.048    7.520    0.000

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .wratcalc          8.718    3.847    2.266    0.023
   .wjcalc            3.169    2.710    1.169    0.242
   .waiscalc         -1.141    1.686   -0.677    0.498
   .wratspl          17.949    4.113    4.364    0.000
   .wjspl            22.456    4.267    5.263    0.000
   .waisspl          19.289    3.978    4.849    0.000
   .MATH              0.000                           
   .SPELL             0.000                           

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .wratcalc          4.035    0.966    4.175    0.000
   .wjcalc            3.876    0.528    7.335    0.000
   .waiscalc          5.221    0.457   11.426    0.000
   .wratspl           4.985    0.612    8.151    0.000
   .wjspl             4.751    0.626    7.587    0.000
   .waisspl           4.960    0.591    8.385    0.000
   .MATH             27.561    2.600   10.601    0.000
   .SPELL            32.786    2.961   11.074    0.000
\end{Soutput}
\end{Schunk}
