\begin{Schunk}
\begin{Sinput}
 group.mod.0 <- 'posAffect ~ c(B, B)*agency'
 group.out.0 <- sem(group.mod.0, data = dat, meanstructure = TRUE, group = "gender")
 summary(group.out.0)
\end{Sinput}
\begin{Soutput}
lavaan (0.5-23.1097) converged normally after  16 iterations

  Number of observations per group         
  male                                             195
  female                                           185

  Estimator                                         ML
  Minimum Function Test Statistic                2.978
  Degrees of freedom                                 1
  P-value (Chi-square)                           0.084

Chi-square for each group:

  male                                           1.207
  female                                         1.771

Parameter Estimates:

  Information                                 Expected
  Standard Errors                             Standard


Group 1 [male]:

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)
  posAffect ~                                         
    agency     (B)    0.365    0.061    5.954    0.000

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .posAffect         2.108    0.159   13.285    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .posAffect         0.311    0.032    9.874    0.000


Group 2 [female]:

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)
  posAffect ~                                         
    agency     (B)    0.365    0.061    5.954    0.000

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .posAffect         2.192    0.161   13.587    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .posAffect         0.423    0.044    9.618    0.000
\end{Soutput}
\end{Schunk}
