\begin{Schunk}
\begin{Sinput}
 msem.gotBully.02 <- '
  Level: 1
  gotBully.w =~ gotBu2_i + gotBu4_i + gotBu5_i + gotBu7_i
  
  Level: 2
  gotBu2_i ~~ gotBu2_i
  gotBu4_i ~~ gotBu4_i
  gotBu5_i ~~ gotBu5_i
  gotBu7_i ~~ gotBu7_i '
 ## Fitting the model
 msem.gotBully.02.fit <- 
  sem(model = msem.gotBully.02, data = hbsc.2, mimic = "Mplus", std.lv = TRUE, missing = "listwise", cluster = "schl_id")
 ## Requesting an estimation summary 
 summary(msem.gotBully.02.fit, fit.measures = TRUE, standardized = TRUE)
\end{Sinput}
\begin{Soutput}
lavaan 0.6-3 ended normally after 26 iterations

  Optimization method                           NLMINB
  Number of free parameters                         16

                                                  Used       Total
  Number of observations                           244         333
  Number of clusters [schl_id]                       8

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

Model test baseline model:

  Minimum Function Test Statistic              295.245
  Degrees of freedom                                12
  P-value                                        0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.949
  Tucker-Lewis Index (TLI)                       0.923

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -1475.465
  Loglikelihood unrestricted model (H1)      -1464.202

  Number of free parameters                         16
  Akaike (AIC)                                2982.930
  Bayesian (BIC)                              3038.885
  Sample-size adjusted Bayesian (BIC)         2988.166

Root Mean Square Error of Approximation:

  RMSEA                                          0.086
  90 Percent Confidence Interval          0.045  0.129
  P-value RMSEA <= 0.05                          0.069

Standardized Root Mean Square Residual (corr metric):

  SRMR (within covariance matrix)                0.030
  SRMR (between covariance matrix)               0.597

Parameter Estimates:

  Information                                 Observed
  Observed information based on                Hessian
  Standard Errors                             Standard


Level 1 [within]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  gotBully.w =~                                                         
    gotBu2_i          0.812    0.085    9.542    0.000    0.812    0.629
    gotBu4_i          1.025    0.082   12.455    0.000    1.025    0.779
    gotBu5_i          0.822    0.076   10.845    0.000    0.822    0.710
    gotBu7_i          0.995    0.082   12.098    0.000    0.995    0.765

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gotBu2_i          0.000                               0.000    0.000
   .gotBu4_i          0.000                               0.000    0.000
   .gotBu5_i          0.000                               0.000    0.000
   .gotBu7_i          0.000                               0.000    0.000
    gotBully.w        0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gotBu2_i          1.006    0.110    9.180    0.000    1.006    0.604
   .gotBu4_i          0.683    0.099    6.883    0.000    0.683    0.394
   .gotBu5_i          0.665    0.081    8.233    0.000    0.665    0.496
   .gotBu7_i          0.700    0.096    7.310    0.000    0.700    0.414
    gotBully.w        1.000                               1.000    1.000


Level 2 [schl_id]:

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gotBu2_i          2.037    0.176   11.581    0.000    2.037    5.163
   .gotBu4_i          2.102    0.178   11.824    0.000    2.102    5.157
   .gotBu5_i          1.631    0.121   13.461    0.000    1.631    7.343
   .gotBu7_i          1.911    0.136   14.081    0.000    1.911    7.305

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gotBu2_i          0.156    0.124    1.256    0.209    0.156    1.000
   .gotBu4_i          0.166    0.115    1.446    0.148    0.166    1.000
   .gotBu5_i          0.049    0.065    0.760    0.447    0.049    1.000
   .gotBu7_i          0.068    0.071    0.964    0.335    0.068    1.000
\end{Soutput}
\end{Schunk}
