\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.5-23.1097) converged normally after 195 iterations

  Number of observations                           322

  Number of missing patterns                         9

  Estimator                                         ML
  Minimum Function Test Statistic               53.744
  Degrees of freedom                                36
  P-value (Chi-square)                           0.029

Parameter Estimates:

  Information                                 Observed
  Standard Errors                             Standard

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)
  MATH =~                                             
    wratcalc          1.000                           
    wjcalc            0.683    0.027   25.075    0.000
    waiscalc          0.395    0.024   16.229    0.000
  SPELL =~                                            
    wratspl           1.000                           
    wjspl             1.044    0.029   36.398    0.000
    waisspl           0.974    0.028   34.537    0.000

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)
  MATH ~                                              
    edlevel           1.555    0.265    5.870    0.000
    newschl           0.504    0.640    0.787    0.431
    suspend          -1.767    0.666   -2.652    0.008
    expelled         -0.533    0.943   -0.565    0.572
    haveld           -1.436    0.844   -1.701    0.089
    female           -0.847    0.677   -1.250    0.211
    age               0.634    0.176    3.601    0.000
  SPELL ~                                             
    edlevel           1.143    0.285    4.016    0.000
    newschl          -0.258    0.688   -0.375    0.707
    suspend          -0.008    0.711   -0.012    0.991
    expelled         -2.510    1.016   -2.470    0.014
    haveld           -6.369    0.909   -7.004    0.000
    female            0.970    0.724    1.340    0.180
    age               0.351    0.189    1.860    0.063

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)
 .MATH ~~                                             
   .SPELL            14.951    1.993    7.504    0.000

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .wratcalc         10.349    3.676    2.815    0.005
   .wjcalc            4.288    2.585    1.659    0.097
   .waiscalc         -0.278    1.585   -0.175    0.861
   .wratspl          18.069    3.941    4.585    0.000
   .wjspl            22.455    4.110    5.463    0.000
   .waisspl          19.219    3.840    5.004    0.000
   .MATH              0.000                           
   .SPELL             0.000                           

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .wratcalc          3.963    0.971    4.083    0.000
   .wjcalc            3.814    0.526    7.246    0.000
   .waiscalc          5.372    0.460   11.678    0.000
   .wratspl           5.131    0.609    8.426    0.000
   .wjspl             4.526    0.609    7.430    0.000
   .waisspl           5.095    0.595    8.570    0.000
   .MATH             27.269    2.540   10.736    0.000
   .SPELL            32.493    2.908   11.174    0.000
\end{Soutput}
\end{Schunk}
