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

  Optimization method                           NLMINB
  Number of free parameters                         12

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

  Estimator                                         ML
  Model Fit Test Statistic                      43.315
  Degrees of freedom                                12
  P-value (Chi-square)                           0.000

Model test baseline model:

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

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.881
  Tucker-Lewis Index (TLI)                       0.881

Loglikelihood and Information Criteria:

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

  Number of free parameters                         12
  Akaike (AIC)                                2995.719
  Bayesian (BIC)                              3037.685
  Sample-size adjusted Bayesian (BIC)         2999.646

Root Mean Square Error of Approximation:

  RMSEA                                          0.103
  90 Percent Confidence Interval          0.071  0.137
  P-value RMSEA <= 0.05                          0.004

Standardized Root Mean Square Residual (corr metric):

  SRMR (within covariance matrix)                0.033
  SRMR (between covariance matrix)                  NA

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.863    0.085   10.143    0.000    0.863    0.643
    gotBu4_i          1.054    0.083   12.652    0.000    1.054    0.766
    gotBu5_i          0.852    0.073   11.704    0.000    0.852    0.719
    gotBu7_i          1.033    0.080   12.848    0.000    1.033    0.772

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.057    0.115    9.175    0.000    1.057    0.587
   .gotBu4_i          0.782    0.107    7.285    0.000    0.782    0.413
   .gotBu5_i          0.677    0.082    8.222    0.000    0.677    0.482
   .gotBu7_i          0.721    0.099    7.247    0.000    0.721    0.403
    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          1.902    0.086   22.129    0.000    1.902       NA
   .gotBu4_i          2.016    0.088   22.892    0.000    2.016       NA
   .gotBu5_i          1.607    0.076   21.190    0.000    1.607       NA
   .gotBu7_i          1.910    0.086   22.317    0.000    1.910       NA

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gotBu2_i          0.000                               0.000       NA
   .gotBu4_i          0.000                               0.000       NA
   .gotBu5_i          0.000                               0.000       NA
   .gotBu7_i          0.000                               0.000       NA
\end{Soutput}
\end{Schunk}
