\begin{Schunk}
\begin{Sinput}
 library(lavaan)
 CFAmodel <- "
    MATH =~ wratcalc + wjcalc + waiscalc
    SPELL =~ wratspl + wjspl + waisspl
  "
 testOutput <- cfa(model = CFAmodel, data = dat, std.lv = TRUE, missing = "fiml")
 summary(testOutput, fit.measures = TRUE)
\end{Sinput}
\begin{Soutput}
lavaan 0.6-3 ended normally after 48 iterations

  Optimization method                           NLMINB
  Number of free parameters                         19

  Number of observations                           322
  Number of missing patterns                         4

  Estimator                                         ML
  Model Fit Test Statistic                       9.540
  Degrees of freedom                                 8
  P-value (Chi-square)                           0.299

Model test baseline model:

  Minimum Function Test Statistic             1882.335
  Degrees of freedom                                15
  P-value                                        0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.999
  Tucker-Lewis Index (TLI)                       0.998

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -5127.830
  Loglikelihood unrestricted model (H1)      -5123.060

  Number of free parameters                         19
  Akaike (AIC)                               10293.661
  Bayesian (BIC)                             10365.377
  Sample-size adjusted Bayesian (BIC)        10305.112

Root Mean Square Error of Approximation:

  RMSEA                                          0.024
  90 Percent Confidence Interval          0.000  0.073
  P-value RMSEA <= 0.05                          0.761

Standardized Root Mean Square Residual:

  SRMR                                           0.024

Parameter Estimates:

  Information                                 Observed
  Observed information based on                Hessian
  Standard Errors                             Standard

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)
  MATH =~                                             
    wratcalc          6.041    0.276   21.921    0.000
    wjcalc            4.144    0.203   20.370    0.000
    waiscalc          2.410    0.165   14.636    0.000
  SPELL =~                                            
    wratspl           6.532    0.288   22.645    0.000
    wjspl             6.809    0.296   23.025    0.000
    waisspl           6.354    0.283   22.463    0.000

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)
  MATH ~~                                             
    SPELL             0.553    0.042   13.191    0.000

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .wratcalc         38.922    0.355  109.514    0.000
   .wjcalc           23.812    0.255   93.297    0.000
   .waiscalc         11.022    0.186   59.230    0.000
   .wratspl          36.484    0.385   94.751    0.000
   .wjspl            41.674    0.398  104.808    0.000
   .waisspl          37.163    0.376   98.788    0.000
    MATH              0.000                           
    SPELL             0.000                           

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .wratcalc          4.179    1.014    4.122    0.000
   .wjcalc            3.769    0.537    7.017    0.000
   .waiscalc          5.304    0.457   11.596    0.000
   .wratspl           5.053    0.612    8.256    0.000
   .wjspl             4.541    0.616    7.369    0.000
   .waisspl           5.156    0.599    8.605    0.000
    MATH              1.000                           
    SPELL             1.000                           
\end{Soutput}
\end{Schunk}
