#Reading in the data
library(haven)
## Warning: package 'haven' was built under R version 4.3.3
csek12 <- as.data.frame(read_sav("RegRep_K12 Sex Ed_De-Id Data_Clean_11-24-23.sav"))
#Making variables nominal
csek12$Vote <- factor(csek12$Vote, levels = c(1:3))
csek12$Gender_3cat <- factor(csek12$Gender_3cat, levels = c(1:3))
csek12$Gender_5cat <- factor(csek12$Gender_5cat, levels = c(1:5))
csek12$Race_cat <- factor(csek12$Race_cat, levels = c(1:7))
csek12$SO <- factor(csek12$SO, levels = c(1:6))
csek12$Geo <- factor(csek12$Geo, levels = c(1:4))
csek12$Parent <- factor(csek12$Parent, levels = c(1:3))

#setting "I don't know" responses to NA
csek12$PolAff <- ifelse(csek12$Politic == 8, NA, csek12$Politic)

#setting "I would abstain (not vote)" responses to NA
csek12$Vote1 <- ifelse(csek12$Vote == 3, NA, csek12$Vote)

CSEK12_Items <- as.data.frame(csek12[,c(5:13, 15:36, 38:45)])

csek12$highered <- ifelse(csek12$Edu > 5, 1, 0) 
csek12one <- '
             CSE =~ Q2_1 + Q2_2 + Q2_3 + Q2_4 + Q2_5 + Q2_6 + Q2_7 + Q2_8 + Q2_9 + Q3_1 + Q3_2 + Q3_3 + Q3_4 + Q3_5 + Q3_6 + Q3_7 + Q3_8 + Q3_9 + Q3_10 + Q4_1 + Q4_2 + Q4_3 + Q4_4 + Q4_5 + Q4_6 + Q4_7 + Q4_8 + Q4_9 + Q4_10 + Q5_1 + Q5_2 + Q5_4 + Q5_5 + Q5_6 + Q5_7 + Q5_8 + Q5_9 + Q5_10 + Q5_11'

#outliers for one factor model
gcd.cfa.one <- faoutlier::gCD(CSEK12_Items, csek12one)
gcd.df <- as.data.frame(print(gcd.cfa.one, ncases = 75))
##            gCD
## 23  20.8330234
## 162 19.6241643
## 89  18.1736515
## 135  9.4883661
## 278  7.7142933
## 18   7.4100895
## 282  7.0051095
## 64   6.5176744
## 250  6.1831421
## 111  5.7671950
## 117  5.5295826
## 269  4.5024798
## 169  4.4364703
## 101  4.2983051
## 60   3.8662917
## 284  3.6514077
## 152  3.5844975
## 290  3.4134331
## 93   3.3317468
## 222  3.1529251
## 272  3.1196155
## 271  2.9078272
## 297  2.8088492
## 73   2.6349612
## 283  2.5234844
## 3    2.4651199
## 29   2.3244764
## 154  2.3146595
## 134  2.3130229
## 146  2.2926201
## 286  2.1304443
## 199  2.1091443
## 241  2.0634007
## 274  2.0118393
## 262  2.0089802
## 80   1.9815271
## 185  1.9368994
## 295  1.7910419
## 175  1.7086479
## 53   1.5969983
## 178  1.5650120
## 202  1.5167497
## 147  1.4703360
## 238  1.3888787
## 50   1.3717834
## 240  1.3439534
## 99   1.3137057
## 276  1.2982603
## 54   1.2923161
## 55   1.2923161
## 153  1.2923161
## 148  1.2817452
## 296  1.2361155
## 223  1.2295029
## 17   1.1779550
## 125  1.1777589
## 144  1.1762872
## 128  1.1644040
## 252  1.1593186
## 233  1.1473196
## 122  1.1357495
## 214  1.0916477
## 264  1.0822014
## 232  1.0510886
## 66   0.9741224
## 208  0.9695800
## 110  0.9620269
## 88   0.9578064
## 235  0.9456809
## 167  0.9072802
## 251  0.9057366
## 279  0.8889584
## 217  0.8590883
## 257  0.8537280
## 226  0.8525605
plot(gcd.cfa.one)

dfb.cfa.one <- as.data.frame(gcd.cfa.one$dfbetas)
library(writexl)
## Warning: package 'writexl' was built under R version 4.3.3
write_xlsx(dfb.cfa.one, "dbf.cfa.one.xlsx")
library(rstatix)
## Warning: package 'rstatix' was built under R version 4.3.2
## 
## Attaching package: 'rstatix'
## The following object is masked from 'package:stats':
## 
##     filter
md.cfa.one <- faoutlier::robustMD(na.omit(CSEK12_Items, csek12one, method = "mve")) #issue with IQR; Q4_8 has an IQR of 0 (first q, median, third q and max all 5); use alternative function
## Error in cov.rob(data, method = method, ...): at least one column has IQR 0
md.cfa.one.1 <- mahalanobis_distance(CSEK12_Items)
md.cfa.one.outliers <- data.frame(md.cfa.one.1$mahal.dist, md.cfa.one.1$is.outlier)

#removal of participants who were considered outliers on more than one method of detection
csek12.nooutliers <- csek12[-c(3, 18, 23, 29, 50, 54, 55, 60, 64, 73, 80, 89, 99, 101, 111, 117, 128, 134, 135, 146, 152, 153, 154, 162, 169, 175, 178, 185, 199, 202, 240, 241, 250, 262, 269, 271, 272, 276, 278, 282, 283, 284, 286, 290, 295, 296, 297),]
library(lavaan)
## Warning: package 'lavaan' was built under R version 4.3.3
## This is lavaan 0.6-18
## lavaan is FREE software! Please report any bugs.
library(semTools)
## Warning: package 'semTools' was built under R version 4.3.2
## 
## ###############################################################################
## This is semTools 0.5-6
## All users of R (or SEM) are invited to submit functions or ideas for functions.
## ###############################################################################
#Checking fit of one factor model when outliers are removed
csek12one.fit.nooutliers <- lavaan::cfa(csek12one, data = csek12.nooutliers, std.lv = TRUE, missing = "FIML", estimator = "MLR")
summary(csek12one.fit.nooutliers, fit.measures = TRUE, standardized = TRUE) #at face value, fit looks worse w/ no outliers; does have smaller AIC and BIC
## lavaan 0.6-18 ended normally after 187 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       117
## 
##   Number of observations                           251
##   Number of missing patterns                         2
## 
## Model Test User Model:
##                                               Standard      Scaled
##   Test Statistic                              2625.418    1567.869
##   Degrees of freedom                               702         702
##   P-value (Chi-square)                           0.000       0.000
##   Scaling correction factor                                  1.675
##     Yuan-Bentler correction (Mplus variant)                       
## 
## Model Test Baseline Model:
## 
##   Test statistic                             12416.542    7035.629
##   Degrees of freedom                               741         741
##   P-value                                        0.000       0.000
##   Scaling correction factor                                  1.765
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.835       0.862
##   Tucker-Lewis Index (TLI)                       0.826       0.855
##                                                                   
##   Robust Comparative Fit Index (CFI)                         0.872
##   Robust Tucker-Lewis Index (TLI)                            0.864
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -5746.181   -5746.181
##   Scaling correction factor                                  2.352
##       for the MLR correction                                      
##   Loglikelihood unrestricted model (H1)             NA          NA
##   Scaling correction factor                                  1.771
##       for the MLR correction                                      
##                                                                   
##   Akaike (AIC)                               11726.362   11726.362
##   Bayesian (BIC)                             12138.840   12138.840
##   Sample-size adjusted Bayesian (SABIC)      11767.936   11767.936
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.104       0.070
##   90 Percent confidence interval - lower         0.100       0.067
##   90 Percent confidence interval - upper         0.109       0.074
##   P-value H_0: RMSEA <= 0.050                    0.000       0.000
##   P-value H_0: RMSEA >= 0.080                    1.000       0.000
##                                                                   
##   Robust RMSEA                                               0.090
##   90 Percent confidence interval - lower                     0.084
##   90 Percent confidence interval - upper                     0.096
##   P-value H_0: Robust RMSEA <= 0.050                         0.000
##   P-value H_0: Robust RMSEA >= 0.080                         0.997
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.046       0.046
## 
## Parameter Estimates:
## 
##   Standard errors                             Sandwich
##   Information bread                           Observed
##   Observed information based on                Hessian
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   CSE =~                                                                
##     Q2_1              0.695    0.061   11.419    0.000    0.695    0.833
##     Q2_2              0.577    0.057   10.152    0.000    0.577    0.624
##     Q2_3              0.541    0.046   11.635    0.000    0.541    0.854
##     Q2_4              0.638    0.051   12.594    0.000    0.638    0.797
##     Q2_5              0.610    0.056   10.874    0.000    0.610    0.778
##     Q2_6              0.551    0.062    8.840    0.000    0.551    0.782
##     Q2_7              0.547    0.067    8.198    0.000    0.547    0.842
##     Q2_8              0.529    0.056    9.506    0.000    0.529    0.729
##     Q2_9              0.464    0.060    7.673    0.000    0.464    0.678
##     Q3_1              0.618    0.051   12.036    0.000    0.618    0.913
##     Q3_2              0.592    0.054   10.882    0.000    0.592    0.889
##     Q3_3              0.543    0.052   10.382    0.000    0.543    0.875
##     Q3_4              0.621    0.051   12.223    0.000    0.621    0.913
##     Q3_5              0.554    0.053   10.458    0.000    0.554    0.878
##     Q3_6              0.438    0.052    8.483    0.000    0.438    0.721
##     Q3_7              0.706    0.066   10.746    0.000    0.706    0.786
##     Q3_8              0.751    0.073   10.309    0.000    0.751    0.657
##     Q3_9              0.824    0.067   12.314    0.000    0.824    0.630
##     Q3_10             0.553    0.057    9.719    0.000    0.553    0.692
##     Q4_1              0.615    0.053   11.548    0.000    0.615    0.921
##     Q4_2              0.604    0.053   11.476    0.000    0.604    0.809
##     Q4_3              0.577    0.057   10.171    0.000    0.577    0.933
##     Q4_4              0.572    0.058    9.829    0.000    0.572    0.910
##     Q4_5              0.511    0.058    8.833    0.000    0.511    0.810
##     Q4_6              0.620    0.055   11.291    0.000    0.620    0.898
##     Q4_7              0.743    0.058   12.846    0.000    0.743    0.835
##     Q4_8              0.482    0.058    8.256    0.000    0.482    0.808
##     Q4_9              0.370    0.069    5.329    0.000    0.370    0.392
##     Q4_10             0.590    0.054   10.972    0.000    0.590    0.866
##     Q5_1              0.609    0.048   12.667    0.000    0.609    0.808
##     Q5_2              0.525    0.054    9.774    0.000    0.525    0.770
##     Q5_4              0.528    0.056    9.413    0.000    0.528    0.880
##     Q5_5              0.436    0.045    9.696    0.000    0.436    0.721
##     Q5_6              0.503    0.052    9.589    0.000    0.503    0.811
##     Q5_7              0.536    0.054    9.898    0.000    0.536    0.848
##     Q5_8              0.383    0.066    5.802    0.000    0.383    0.457
##     Q5_9              0.475    0.049    9.700    0.000    0.475    0.843
##     Q5_10             0.491    0.060    8.153    0.000    0.491    0.678
##     Q5_11             0.555    0.058    9.515    0.000    0.555    0.906
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .Q2_1              4.482    0.053   85.122    0.000    4.482    5.373
##    .Q2_2              4.406    0.058   75.507    0.000    4.406    4.766
##    .Q2_3              4.657    0.040  116.589    0.000    4.657    7.359
##    .Q2_4              4.510    0.051   89.290    0.000    4.510    5.636
##    .Q2_5              4.526    0.050   91.369    0.000    4.526    5.767
##    .Q2_6              4.625    0.045  103.927    0.000    4.625    6.560
##    .Q2_7              4.665    0.041  113.797    0.000    4.665    7.183
##    .Q2_8              4.546    0.046   99.227    0.000    4.546    6.263
##    .Q2_9              4.614    0.043  106.823    0.000    4.614    6.743
##    .Q3_1              4.622    0.043  108.150    0.000    4.622    6.826
##    .Q3_2              4.645    0.042  110.452    0.000    4.645    6.972
##    .Q3_3              4.681    0.039  119.611    0.000    4.681    7.550
##    .Q3_4              4.633    0.043  107.852    0.000    4.633    6.808
##    .Q3_5              4.689    0.040  117.841    0.000    4.689    7.438
##    .Q3_6              4.722    0.038  122.874    0.000    4.722    7.777
##    .Q3_7              4.490    0.057   79.154    0.000    4.490    4.996
##    .Q3_8              4.311    0.072   59.765    0.000    4.311    3.772
##    .Q3_9              4.076    0.083   49.359    0.000    4.076    3.115
##    .Q3_10             4.470    0.050   88.556    0.000    4.470    5.590
##    .Q4_1              4.637    0.042  109.984    0.000    4.637    6.942
##    .Q4_2              4.562    0.047   96.842    0.000    4.562    6.113
##    .Q4_3              4.705    0.039  120.420    0.000    4.705    7.601
##    .Q4_4              4.697    0.040  118.501    0.000    4.697    7.480
##    .Q4_5              4.709    0.040  118.337    0.000    4.709    7.469
##    .Q4_6              4.641    0.044  106.470    0.000    4.641    6.720
##    .Q4_7              4.466    0.056   79.573    0.000    4.466    5.023
##    .Q4_8              4.749    0.038  126.219    0.000    4.749    7.967
##    .Q4_9              4.363    0.060   73.161    0.000    4.363    4.618
##    .Q4_10             4.629    0.043  107.638    0.000    4.629    6.794
##    .Q5_1              4.534    0.048   95.344    0.000    4.534    6.018
##    .Q5_2              4.629    0.043  107.638    0.000    4.629    6.794
##    .Q5_4              4.721    0.038  124.579    0.000    4.721    7.863
##    .Q5_5              4.665    0.038  122.159    0.000    4.665    7.711
##    .Q5_6              4.701    0.039  120.065    0.000    4.701    7.578
##    .Q5_7              4.681    0.040  117.206    0.000    4.681    7.398
##    .Q5_8              4.546    0.053   85.952    0.000    4.546    5.425
##    .Q5_9              4.745    0.036  133.424    0.000    4.745    8.422
##    .Q5_10             4.570    0.046  100.012    0.000    4.570    6.313
##    .Q5_11             4.705    0.039  121.692    0.000    4.705    7.681
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .Q2_1              0.213    0.036    5.848    0.000    0.213    0.306
##    .Q2_2              0.522    0.084    6.244    0.000    0.522    0.610
##    .Q2_3              0.108    0.017    6.456    0.000    0.108    0.270
##    .Q2_4              0.233    0.044    5.284    0.000    0.233    0.365
##    .Q2_5              0.243    0.040    6.115    0.000    0.243    0.395
##    .Q2_6              0.193    0.045    4.261    0.000    0.193    0.389
##    .Q2_7              0.123    0.024    5.185    0.000    0.123    0.291
##    .Q2_8              0.247    0.038    6.463    0.000    0.247    0.469
##    .Q2_9              0.253    0.042    6.092    0.000    0.253    0.540
##    .Q3_1              0.076    0.014    5.450    0.000    0.076    0.166
##    .Q3_2              0.093    0.025    3.793    0.000    0.093    0.210
##    .Q3_3              0.090    0.023    3.999    0.000    0.090    0.234
##    .Q3_4              0.077    0.018    4.278    0.000    0.077    0.167
##    .Q3_5              0.091    0.018    4.932    0.000    0.091    0.228
##    .Q3_6              0.177    0.038    4.685    0.000    0.177    0.481
##    .Q3_7              0.309    0.046    6.643    0.000    0.309    0.382
##    .Q3_8              0.742    0.128    5.811    0.000    0.742    0.568
##    .Q3_9              1.032    0.133    7.765    0.000    1.032    0.603
##    .Q3_10             0.333    0.075    4.430    0.000    0.333    0.521
##    .Q4_1              0.068    0.018    3.742    0.000    0.068    0.152
##    .Q4_2              0.193    0.047    4.130    0.000    0.193    0.346
##    .Q4_3              0.050    0.010    5.105    0.000    0.050    0.130
##    .Q4_4              0.068    0.018    3.805    0.000    0.068    0.172
##    .Q4_5              0.136    0.029    4.765    0.000    0.136    0.343
##    .Q4_6              0.093    0.015    6.072    0.000    0.093    0.194
##    .Q4_7              0.239    0.039    6.188    0.000    0.239    0.302
##    .Q4_8              0.123    0.023    5.366    0.000    0.123    0.347
##    .Q4_9              0.755    0.108    7.025    0.000    0.755    0.846
##    .Q4_10             0.116    0.024    4.838    0.000    0.116    0.250
##    .Q5_1              0.197    0.036    5.547    0.000    0.197    0.347
##    .Q5_2              0.189    0.047    4.040    0.000    0.189    0.407
##    .Q5_4              0.081    0.019    4.221    0.000    0.081    0.225
##    .Q5_5              0.176    0.029    6.042    0.000    0.176    0.480
##    .Q5_6              0.132    0.023    5.804    0.000    0.132    0.343
##    .Q5_7              0.113    0.024    4.692    0.000    0.113    0.282
##    .Q5_8              0.556    0.109    5.107    0.000    0.556    0.791
##    .Q5_9              0.092    0.016    5.901    0.000    0.092    0.290
##    .Q5_10             0.283    0.046    6.105    0.000    0.283    0.540
##    .Q5_11             0.067    0.015    4.543    0.000    0.067    0.179
##     CSE               1.000                               1.000    1.000
dynamic::cfaOne(csek12one.fit.nooutliers, plot = TRUE) #still does not meet dynamic fit indices
## Warning: Returning more (or less) than 1 row per `summarise()` group was deprecated in
## dplyr 1.1.0.
## ℹ Please use `reframe()` instead.
## ℹ When switching from `summarise()` to `reframe()`, remember that `reframe()`
##   always returns an ungrouped data frame and adjust accordingly.
## ℹ The deprecated feature was likely used in the dynamic package.
##   Please report the issue at <https://github.com/melissagwolf/dynamic/issues>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Your DFI cutoffs: 
##                SRMR RMSEA  CFI
## Level 1: 95/5  .024  NONE NONE
## Level 1: 90/10   --  .027 .987
## Level 2: 95/5  .025  .037 .976
## Level 2: 90/10   --    --   --
## Level 3: 95/5  .026  .047 .962
## Level 3: 90/10   --    --   --
## 
## Empirical fit indices: 
##  Chi-Square  df p-value   SRMR   RMSEA    CFI
##    2625.418 702       0  0.046   0.104  0.835
## 
##  The distributions for each level are in the Plots tab 
## [[1]]

## 
## [[2]]

## 
## [[3]]

csek12one.mod4 <- '
             CSE =~ Q2_1 + Q2_2 + Q2_3 + Q2_4 + Q2_5 + Q2_6 + Q2_7 + Q2_8 + Q2_9 + Q3_1 + Q3_2 + Q3_3 + Q3_4 + Q3_5 + Q3_6 + Q3_7 + Q3_8 + Q3_9 + Q3_10 + Q4_1 + Q4_2 + Q4_3 + Q4_4 + Q4_5 + Q4_6 + Q4_7 + Q4_8 + Q4_9 + Q4_10 + Q5_1 + Q5_2 + Q5_4 + Q5_5 + Q5_6 + Q5_7 + Q5_8 + Q5_9 + Q5_10 + Q5_11
        
          #covariances
          Q2_3 ~~ Q2_4
          Q2_3 ~~ Q2_5
          Q2_3 ~~ Q5_5
          Q2_3 ~~ Q5_6
          Q2_4 ~~ Q2_5
          Q2_4 ~~ Q5_5
          Q2_4 ~~ Q5_6
          Q2_5 ~~ Q5_5
          Q2_5 ~~ Q5_6
          Q5_5 ~~ Q5_6
          Q4_4 ~~ Q4_5
          Q4_4 ~~ Q4_6
          Q4_5 ~~ Q4_6
          Q4_7 ~~ Q4_8
          Q2_8 ~~ Q2_9
'

#checking fit of one factor model + all covariance sets added when outliers are removed
csek12one.mod4.fit.nooutliers <- lavaan::cfa(csek12one.mod4, data = csek12.nooutliers, std.lv = TRUE, missing = "FIML", estimator = "MLR")
summary(csek12one.mod4.fit.nooutliers, fit.measures = TRUE, standardized = TRUE) #fit looks worse w/ no outliers, does have smaller AIC and BIC
## lavaan 0.6-18 ended normally after 209 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       132
## 
##   Number of observations                           251
##   Number of missing patterns                         2
## 
## Model Test User Model:
##                                               Standard      Scaled
##   Test Statistic                              2401.021    1452.349
##   Degrees of freedom                               687         687
##   P-value (Chi-square)                           0.000       0.000
##   Scaling correction factor                                  1.653
##     Yuan-Bentler correction (Mplus variant)                       
## 
## Model Test Baseline Model:
## 
##   Test statistic                             12416.542    7035.629
##   Degrees of freedom                               741         741
##   P-value                                        0.000       0.000
##   Scaling correction factor                                  1.765
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.853       0.878
##   Tucker-Lewis Index (TLI)                       0.842       0.869
##                                                                   
##   Robust Comparative Fit Index (CFI)                         0.889
##   Robust Tucker-Lewis Index (TLI)                            0.880
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -5633.982   -5633.982
##   Scaling correction factor                                  2.386
##       for the MLR correction                                      
##   Loglikelihood unrestricted model (H1)             NA          NA
##   Scaling correction factor                                  1.771
##       for the MLR correction                                      
##                                                                   
##   Akaike (AIC)                               11531.965   11531.965
##   Bayesian (BIC)                             11997.325   11997.325
##   Sample-size adjusted Bayesian (SABIC)      11578.869   11578.869
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.100       0.067
##   90 Percent confidence interval - lower         0.095       0.063
##   90 Percent confidence interval - upper         0.104       0.070
##   P-value H_0: RMSEA <= 0.050                    0.000       0.000
##   P-value H_0: RMSEA >= 0.080                    1.000       0.000
##                                                                   
##   Robust RMSEA                                               0.085
##   90 Percent confidence interval - lower                     0.078
##   90 Percent confidence interval - upper                     0.091
##   P-value H_0: Robust RMSEA <= 0.050                         0.000
##   P-value H_0: Robust RMSEA >= 0.080                         0.895
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.045       0.045
## 
## Parameter Estimates:
## 
##   Standard errors                             Sandwich
##   Information bread                           Observed
##   Observed information based on                Hessian
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   CSE =~                                                                
##     Q2_1              0.695    0.061   11.375    0.000    0.695    0.833
##     Q2_2              0.579    0.057   10.103    0.000    0.579    0.626
##     Q2_3              0.538    0.047   11.532    0.000    0.538    0.851
##     Q2_4              0.633    0.051   12.354    0.000    0.633    0.790
##     Q2_5              0.604    0.057   10.683    0.000    0.604    0.770
##     Q2_6              0.549    0.063    8.748    0.000    0.549    0.778
##     Q2_7              0.546    0.067    8.168    0.000    0.546    0.840
##     Q2_8              0.524    0.056    9.386    0.000    0.524    0.722
##     Q2_9              0.460    0.061    7.568    0.000    0.460    0.672
##     Q3_1              0.620    0.051   12.165    0.000    0.620    0.917
##     Q3_2              0.593    0.054   10.945    0.000    0.593    0.890
##     Q3_3              0.543    0.052   10.370    0.000    0.543    0.875
##     Q3_4              0.623    0.051   12.300    0.000    0.623    0.915
##     Q3_5              0.556    0.053   10.561    0.000    0.556    0.882
##     Q3_6              0.438    0.051    8.521    0.000    0.438    0.722
##     Q3_7              0.706    0.066   10.719    0.000    0.706    0.786
##     Q3_8              0.752    0.073   10.298    0.000    0.752    0.658
##     Q3_9              0.825    0.067   12.313    0.000    0.825    0.631
##     Q3_10             0.552    0.057    9.687    0.000    0.552    0.691
##     Q4_1              0.617    0.053   11.613    0.000    0.617    0.923
##     Q4_2              0.603    0.053   11.452    0.000    0.603    0.808
##     Q4_3              0.579    0.057   10.230    0.000    0.579    0.935
##     Q4_4              0.570    0.058    9.775    0.000    0.570    0.908
##     Q4_5              0.503    0.058    8.669    0.000    0.503    0.799
##     Q4_6              0.616    0.055   11.145    0.000    0.616    0.893
##     Q4_7              0.743    0.058   12.803    0.000    0.743    0.836
##     Q4_8              0.481    0.058    8.240    0.000    0.481    0.806
##     Q4_9              0.367    0.070    5.266    0.000    0.367    0.389
##     Q4_10             0.591    0.054   10.989    0.000    0.591    0.867
##     Q5_1              0.609    0.048   12.666    0.000    0.609    0.808
##     Q5_2              0.526    0.054    9.820    0.000    0.526    0.772
##     Q5_4              0.529    0.056    9.468    0.000    0.529    0.882
##     Q5_5              0.431    0.045    9.510    0.000    0.431    0.712
##     Q5_6              0.504    0.052    9.644    0.000    0.504    0.813
##     Q5_7              0.534    0.054    9.850    0.000    0.534    0.843
##     Q5_8              0.382    0.066    5.768    0.000    0.382    0.456
##     Q5_9              0.474    0.049    9.667    0.000    0.474    0.842
##     Q5_10             0.488    0.060    8.075    0.000    0.488    0.675
##     Q5_11             0.557    0.058    9.560    0.000    0.557    0.909
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##  .Q2_3 ~~                                                               
##    .Q2_4              0.025    0.014    1.829    0.067    0.025    0.156
##    .Q2_5              0.018    0.015    1.234    0.217    0.018    0.111
##    .Q5_5              0.012    0.015    0.784    0.433    0.012    0.086
##    .Q5_6              0.009    0.013    0.663    0.508    0.009    0.073
##  .Q2_4 ~~                                                               
##    .Q2_5              0.119    0.032    3.672    0.000    0.119    0.483
##    .Q5_5              0.034    0.020    1.728    0.084    0.034    0.162
##    .Q5_6             -0.031    0.012   -2.649    0.008   -0.031   -0.175
##  .Q2_5 ~~                                                               
##    .Q5_5              0.039    0.021    1.905    0.057    0.039    0.185
##    .Q5_6             -0.032    0.015   -2.177    0.029   -0.032   -0.175
##  .Q5_5 ~~                                                               
##    .Q5_6              0.014    0.017    0.817    0.414    0.014    0.089
##  .Q4_4 ~~                                                               
##    .Q4_5              0.023    0.013    1.773    0.076    0.023    0.233
##    .Q4_6              0.014    0.011    1.322    0.186    0.014    0.172
##  .Q4_5 ~~                                                               
##    .Q4_6              0.047    0.015    3.221    0.001    0.047    0.402
##  .Q4_7 ~~                                                               
##    .Q4_8              0.007    0.019    0.362    0.718    0.007    0.041
##  .Q2_8 ~~                                                               
##    .Q2_9              0.129    0.033    3.957    0.000    0.129    0.508
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .Q2_1              4.482    0.053   85.122    0.000    4.482    5.373
##    .Q2_2              4.406    0.058   75.507    0.000    4.406    4.766
##    .Q2_3              4.657    0.040  116.589    0.000    4.657    7.359
##    .Q2_4              4.510    0.051   89.290    0.000    4.510    5.636
##    .Q2_5              4.526    0.050   91.369    0.000    4.526    5.767
##    .Q2_6              4.625    0.045  103.927    0.000    4.625    6.560
##    .Q2_7              4.665    0.041  113.797    0.000    4.665    7.183
##    .Q2_8              4.546    0.046   99.227    0.000    4.546    6.263
##    .Q2_9              4.614    0.043  106.823    0.000    4.614    6.743
##    .Q3_1              4.622    0.043  108.150    0.000    4.622    6.826
##    .Q3_2              4.645    0.042  110.452    0.000    4.645    6.972
##    .Q3_3              4.681    0.039  119.610    0.000    4.681    7.550
##    .Q3_4              4.633    0.043  107.852    0.000    4.633    6.808
##    .Q3_5              4.689    0.040  117.841    0.000    4.689    7.438
##    .Q3_6              4.722    0.038  122.959    0.000    4.722    7.780
##    .Q3_7              4.490    0.057   79.153    0.000    4.490    4.996
##    .Q3_8              4.311    0.072   59.766    0.000    4.311    3.772
##    .Q3_9              4.076    0.083   49.359    0.000    4.076    3.115
##    .Q3_10             4.470    0.050   88.556    0.000    4.470    5.590
##    .Q4_1              4.637    0.042  109.984    0.000    4.637    6.942
##    .Q4_2              4.562    0.047   96.842    0.000    4.562    6.113
##    .Q4_3              4.705    0.039  120.420    0.000    4.705    7.601
##    .Q4_4              4.697    0.040  118.501    0.000    4.697    7.480
##    .Q4_5              4.709    0.040  118.336    0.000    4.709    7.469
##    .Q4_6              4.641    0.044  106.470    0.000    4.641    6.720
##    .Q4_7              4.466    0.056   79.573    0.000    4.466    5.023
##    .Q4_8              4.749    0.038  126.219    0.000    4.749    7.967
##    .Q4_9              4.363    0.060   73.161    0.000    4.363    4.618
##    .Q4_10             4.629    0.043  107.638    0.000    4.629    6.794
##    .Q5_1              4.534    0.048   95.344    0.000    4.534    6.018
##    .Q5_2              4.629    0.043  107.638    0.000    4.629    6.794
##    .Q5_4              4.721    0.038  124.580    0.000    4.721    7.863
##    .Q5_5              4.665    0.038  122.159    0.000    4.665    7.711
##    .Q5_6              4.701    0.039  120.065    0.000    4.701    7.578
##    .Q5_7              4.681    0.040  117.206    0.000    4.681    7.398
##    .Q5_8              4.546    0.053   85.952    0.000    4.546    5.425
##    .Q5_9              4.745    0.036  133.424    0.000    4.745    8.422
##    .Q5_10             4.570    0.046  100.012    0.000    4.570    6.313
##    .Q5_11             4.705    0.039  121.692    0.000    4.705    7.681
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .Q2_1              0.213    0.037    5.800    0.000    0.213    0.306
##    .Q2_2              0.519    0.083    6.244    0.000    0.519    0.608
##    .Q2_3              0.111    0.017    6.372    0.000    0.111    0.277
##    .Q2_4              0.240    0.045    5.303    0.000    0.240    0.375
##    .Q2_5              0.251    0.040    6.206    0.000    0.251    0.408
##    .Q2_6              0.196    0.046    4.239    0.000    0.196    0.395
##    .Q2_7              0.124    0.024    5.168    0.000    0.124    0.294
##    .Q2_8              0.253    0.039    6.426    0.000    0.253    0.479
##    .Q2_9              0.257    0.042    6.149    0.000    0.257    0.548
##    .Q3_1              0.073    0.013    5.536    0.000    0.073    0.160
##    .Q3_2              0.092    0.024    3.793    0.000    0.092    0.208
##    .Q3_3              0.090    0.023    3.910    0.000    0.090    0.234
##    .Q3_4              0.075    0.018    4.139    0.000    0.075    0.163
##    .Q3_5              0.088    0.018    4.930    0.000    0.088    0.222
##    .Q3_6              0.176    0.038    4.667    0.000    0.176    0.478
##    .Q3_7              0.309    0.046    6.676    0.000    0.309    0.383
##    .Q3_8              0.741    0.128    5.787    0.000    0.741    0.567
##    .Q3_9              1.031    0.134    7.719    0.000    1.031    0.602
##    .Q3_10             0.334    0.075    4.441    0.000    0.334    0.523
##    .Q4_1              0.066    0.018    3.659    0.000    0.066    0.148
##    .Q4_2              0.193    0.047    4.127    0.000    0.193    0.347
##    .Q4_3              0.048    0.009    5.258    0.000    0.048    0.126
##    .Q4_4              0.069    0.018    3.824    0.000    0.069    0.176
##    .Q4_5              0.144    0.030    4.747    0.000    0.144    0.362
##    .Q4_6              0.097    0.016    6.079    0.000    0.097    0.203
##    .Q4_7              0.239    0.039    6.187    0.000    0.239    0.302
##    .Q4_8              0.124    0.023    5.309    0.000    0.124    0.350
##    .Q4_9              0.757    0.107    7.051    0.000    0.757    0.849
##    .Q4_10             0.115    0.024    4.818    0.000    0.115    0.249
##    .Q5_1              0.197    0.036    5.517    0.000    0.197    0.347
##    .Q5_2              0.188    0.047    4.018    0.000    0.188    0.404
##    .Q5_4              0.080    0.019    4.147    0.000    0.080    0.223
##    .Q5_5              0.181    0.030    6.055    0.000    0.181    0.494
##    .Q5_6              0.131    0.023    5.765    0.000    0.131    0.340
##    .Q5_7              0.116    0.026    4.532    0.000    0.116    0.289
##    .Q5_8              0.556    0.109    5.109    0.000    0.556    0.792
##    .Q5_9              0.092    0.016    5.921    0.000    0.092    0.291
##    .Q5_10             0.285    0.047    6.126    0.000    0.285    0.545
##    .Q5_11             0.065    0.015    4.465    0.000    0.065    0.175
##     CSE               1.000                               1.000    1.000
dynamic::cfaOne(csek12one.mod4.fit.nooutliers, plot = TRUE) #still does not meet dynamic fit indices
## Your DFI cutoffs: 
##                SRMR RMSEA  CFI
## Level 1: 95/5  NONE  NONE NONE
## Level 1: 90/10 .024  NONE NONE
## Level 2: 95/5  .024   .03 .985
## Level 2: 90/10   --    --   --
## Level 3: 95/5  .024  .039 .975
## Level 3: 90/10   --    --   --
## 
## Empirical fit indices: 
##  Chi-Square  df p-value   SRMR   RMSEA    CFI
##    2401.021 687       0  0.045     0.1  0.853
## 
##  The distributions for each level are in the Plots tab 
## [[1]]

## 
## [[2]]

## 
## [[3]]

#invariance testing with outliers removed
#examining invariance by school aged children or not when outliers are removed
csek12.schoolage1 <- subset(csek12.nooutliers, Parent != 3) #sub-setting to remove participants who do not have children
csek12one.config.nooutlier <- cfa(csek12one.mod4, data = csek12.schoolage1, std.lv = TRUE, missing = "FIML", estimator = "MLR", group = "Parent") #configural model
## Warning: lavaan->lav_mvnorm_missing_h1_estimate_moments():  
##    The smallest eigenvalue of the EM estimated variance-covariance matrix 
##    (Sigma) is smaller than 1e-05; this may cause numerical instabilities; 
##    interpret the results with caution.
## Warning: lavaan->lav_model_vcov():  
##    The variance-covariance matrix of the estimated parameters (vcov) does not 
##    appear to be positive definite! The smallest eigenvalue (= -1.536235e-14) 
##    is smaller than zero. This may be a symptom that the model is not 
##    identified.
summary(csek12one.config.nooutlier, fit.measures = TRUE)
## lavaan 0.6-18 ended normally after 156 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       264
## 
##   Number of observations per group:                   
##     1                                               54
##     2                                               55
##   Number of missing patterns per group:               
##     1                                                1
##     2                                                1
## 
## Model Test User Model:
##                                               Standard      Scaled
##   Test Statistic                              5373.220    5339.097
##   Degrees of freedom                              1374        1374
##   P-value (Chi-square)                           0.000       0.000
##   Scaling correction factor                                  1.006
##     Yuan-Bentler correction (Mplus variant)                       
##   Test statistic for each group:
##     1                                         2629.175    2612.478
##     2                                         2744.044    2726.618
## 
## Model Test Baseline Model:
## 
##   Test statistic                              9704.117    8467.492
##   Degrees of freedom                              1482        1482
##   P-value                                        0.000       0.000
##   Scaling correction factor                                  1.146
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.514       0.432
##   Tucker-Lewis Index (TLI)                       0.475       0.388
##                                                                   
##   Robust Comparative Fit Index (CFI)                         0.517
##   Robust Tucker-Lewis Index (TLI)                            0.479
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -2316.961   -2316.961
##   Scaling correction factor                                  2.089
##       for the MLR correction                                      
##   Loglikelihood unrestricted model (H1)             NA          NA
##   Scaling correction factor                                  1.181
##       for the MLR correction                                      
##                                                                   
##   Akaike (AIC)                                5161.922    5161.922
##   Bayesian (BIC)                              5872.438    5872.438
##   Sample-size adjusted Bayesian (SABIC)       5038.232    5038.232
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.231       0.230
##   90 Percent confidence interval - lower         0.225       0.224
##   90 Percent confidence interval - upper         0.238       0.237
##   P-value H_0: RMSEA <= 0.050                    0.000       0.000
##   P-value H_0: RMSEA >= 0.080                    1.000       1.000
##                                                                   
##   Robust RMSEA                                               0.229
##   90 Percent confidence interval - lower                     0.223
##   90 Percent confidence interval - upper                     0.236
##   P-value H_0: Robust RMSEA <= 0.050                         0.000
##   P-value H_0: Robust RMSEA >= 0.080                         1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.080       0.080
## 
## Parameter Estimates:
## 
##   Standard errors                             Sandwich
##   Information bread                           Observed
##   Observed information based on                Hessian
## 
## 
## Group 1 [1]:
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   CSE =~                                              
##     Q2_1              0.503    0.111    4.535    0.000
##     Q2_2              0.397    0.140    2.832    0.005
##     Q2_3              0.508    0.087    5.811    0.000
##     Q2_4              0.633    0.114    5.554    0.000
##     Q2_5              0.476    0.140    3.396    0.001
##     Q2_6              0.380    0.079    4.788    0.000
##     Q2_7              0.413    0.101    4.108    0.000
##     Q2_8              0.401    0.070    5.688    0.000
##     Q2_9              0.282    0.064    4.368    0.000
##     Q3_1              0.461    0.048    9.697    0.000
##     Q3_2              0.466    0.071    6.525    0.000
##     Q3_3              0.397    0.034   11.752    0.000
##     Q3_4              0.472    0.066    7.199    0.000
##     Q3_5              0.428    0.078    5.459    0.000
##     Q3_6              0.342    0.080    4.247    0.000
##     Q3_7              0.508    0.134    3.794    0.000
##     Q3_8              0.507    0.169    3.000    0.003
##     Q3_9              0.874    0.177    4.947    0.000
##     Q3_10             0.430    0.076    5.671    0.000
##     Q4_1              0.425    0.055    7.680    0.000
##     Q4_2              0.465    0.069    6.749    0.000
##     Q4_3              0.375    0.070    5.323    0.000
##     Q4_4              0.319    0.054    5.911    0.000
##     Q4_5              0.298    0.062    4.783    0.000
##     Q4_6              0.466    0.097    4.800    0.000
##     Q4_7              0.748    0.137    5.474    0.000
##     Q4_8              0.408    0.146    2.783    0.005
##     Q4_9              0.185    0.082    2.263    0.024
##     Q4_10             0.352    0.052    6.833    0.000
##     Q5_1              0.496    0.070    7.040    0.000
##     Q5_2              0.382    0.066    5.781    0.000
##     Q5_4              0.362    0.071    5.094    0.000
##     Q5_5              0.346    0.064    5.396    0.000
##     Q5_6              0.287    0.079    3.627    0.000
##     Q5_7              0.310    0.062    4.992    0.000
##     Q5_8              0.311    0.123    2.528    0.011
##     Q5_9              0.284    0.085    3.322    0.001
##     Q5_10             0.324    0.076    4.250    0.000
##     Q5_11             0.381    0.040    9.523    0.000
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##  .Q2_3 ~~                                             
##    .Q2_4             -0.000    0.038   -0.012    0.991
##    .Q2_5              0.034    0.041    0.834    0.404
##    .Q5_5             -0.017    0.036   -0.487    0.627
##    .Q5_6              0.027    0.023    1.156    0.248
##  .Q2_4 ~~                                             
##    .Q2_5              0.154    0.066    2.327    0.020
##    .Q5_5             -0.011    0.032   -0.345    0.730
##    .Q5_6             -0.046    0.029   -1.585    0.113
##  .Q2_5 ~~                                             
##    .Q5_5              0.062    0.038    1.649    0.099
##    .Q5_6             -0.021    0.041   -0.526    0.599
##  .Q5_5 ~~                                             
##    .Q5_6              0.010    0.038    0.253    0.800
##  .Q4_4 ~~                                             
##    .Q4_5              0.008    0.023    0.329    0.742
##    .Q4_6             -0.030    0.021   -1.414    0.157
##  .Q4_5 ~~                                             
##    .Q4_6              0.060    0.042    1.431    0.153
##  .Q4_7 ~~                                             
##    .Q4_8             -0.009    0.055   -0.170    0.865
##  .Q2_8 ~~                                             
##    .Q2_9              0.080    0.065    1.240    0.215
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .Q2_1              4.463    0.093   47.795    0.000
##    .Q2_2              4.352    0.131   33.130    0.000
##    .Q2_3              4.611    0.085   54.553    0.000
##    .Q2_4              4.444    0.110   40.376    0.000
##    .Q2_5              4.519    0.107   42.168    0.000
##    .Q2_6              4.593    0.089   51.670    0.000
##    .Q2_7              4.667    0.079   59.397    0.000
##    .Q2_8              4.556    0.081   55.948    0.000
##    .Q2_9              4.685    0.068   68.483    0.000
##    .Q3_1              4.648    0.070   66.341    0.000
##    .Q3_2              4.648    0.075   62.142    0.000
##    .Q3_3              4.722    0.061   77.475    0.000
##    .Q3_4              4.648    0.079   58.651    0.000
##    .Q3_5              4.704    0.077   61.140    0.000
##    .Q3_6              4.685    0.078   60.224    0.000
##    .Q3_7              4.389    0.115   38.032    0.000
##    .Q3_8              4.037    0.166   24.384    0.000
##    .Q3_9              3.796    0.202   18.811    0.000
##    .Q3_10             4.463    0.104   42.991    0.000
##    .Q4_1              4.648    0.075   62.142    0.000
##    .Q4_2              4.556    0.089   50.927    0.000
##    .Q4_3              4.778    0.062   76.637    0.000
##    .Q4_4              4.778    0.057   84.450    0.000
##    .Q4_5              4.796    0.061   78.960    0.000
##    .Q4_6              4.704    0.081   57.878    0.000
##    .Q4_7              4.426    0.127   34.786    0.000
##    .Q4_8              4.741    0.088   54.126    0.000
##    .Q4_9              4.519    0.093   48.337    0.000
##    .Q4_10             4.722    0.061   77.475    0.000
##    .Q5_1              4.593    0.089   51.670    0.000
##    .Q5_2              4.722    0.066   71.182    0.000
##    .Q5_4              4.796    0.061   78.960    0.000
##    .Q5_5              4.741    0.075   63.272    0.000
##    .Q5_6              4.778    0.062   76.637    0.000
##    .Q5_7              4.778    0.062   76.637    0.000
##    .Q5_8              4.741    0.075   63.272    0.000
##    .Q5_9              4.796    0.061   78.960    0.000
##    .Q5_10             4.667    0.079   59.397    0.000
##    .Q5_11             4.759    0.058   81.802    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .Q2_1              0.217    0.054    4.024    0.000
##    .Q2_2              0.774    0.285    2.717    0.007
##    .Q2_3              0.128    0.035    3.640    0.000
##    .Q2_4              0.254    0.065    3.904    0.000
##    .Q2_5              0.394    0.112    3.531    0.000
##    .Q2_6              0.282    0.111    2.535    0.011
##    .Q2_7              0.163    0.050    3.226    0.001
##    .Q2_8              0.197    0.063    3.116    0.002
##    .Q2_9              0.173    0.069    2.512    0.012
##    .Q3_1              0.053    0.017    3.052    0.002
##    .Q3_2              0.085    0.029    2.974    0.003
##    .Q3_3              0.043    0.015    2.921    0.003
##    .Q3_4              0.116    0.060    1.934    0.053
##    .Q3_5              0.136    0.064    2.114    0.035
##    .Q3_6              0.210    0.090    2.340    0.019
##    .Q3_7              0.461    0.121    3.803    0.000
##    .Q3_8              1.224    0.286    4.279    0.000
##    .Q3_9              1.436    0.315    4.565    0.000
##    .Q3_10             0.397    0.259    1.534    0.125
##    .Q4_1              0.122    0.060    2.012    0.044
##    .Q4_2              0.216    0.091    2.371    0.018
##    .Q4_3              0.069    0.022    3.124    0.002
##    .Q4_4              0.071    0.024    2.995    0.003
##    .Q4_5              0.110    0.046    2.397    0.017
##    .Q4_6              0.139    0.047    2.948    0.003
##    .Q4_7              0.315    0.078    4.030    0.000
##    .Q4_8              0.248    0.069    3.592    0.000
##    .Q4_9              0.438    0.105    4.151    0.000
##    .Q4_10             0.076    0.030    2.577    0.010
##    .Q5_1              0.181    0.075    2.401    0.016
##    .Q5_2              0.091    0.031    2.911    0.004
##    .Q5_4              0.068    0.024    2.804    0.005
##    .Q5_5              0.183    0.075    2.457    0.014
##    .Q5_6              0.127    0.037    3.476    0.001
##    .Q5_7              0.114    0.047    2.425    0.015
##    .Q5_8              0.206    0.075    2.764    0.006
##    .Q5_9              0.119    0.037    3.240    0.001
##    .Q5_10             0.228    0.094    2.433    0.015
##    .Q5_11             0.038    0.012    3.109    0.002
##     CSE               1.000                           
## 
## 
## Group 2 [2]:
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   CSE =~                                              
##     Q2_1              0.834    0.119    7.013    0.000
##     Q2_2              0.714    0.123    5.804    0.000
##     Q2_3              0.698    0.122    5.736    0.000
##     Q2_4              0.726    0.109    6.660    0.000
##     Q2_5              0.611    0.127    4.814    0.000
##     Q2_6              0.713    0.132    5.400    0.000
##     Q2_7              0.615    0.133    4.610    0.000
##     Q2_8              0.561    0.137    4.087    0.000
##     Q2_9              0.619    0.135    4.572    0.000
##     Q3_1              0.742    0.110    6.717    0.000
##     Q3_2              0.695    0.124    5.608    0.000
##     Q3_3              0.616    0.113    5.462    0.000
##     Q3_4              0.740    0.115    6.433    0.000
##     Q3_5              0.692    0.100    6.888    0.000
##     Q3_6              0.639    0.106    6.026    0.000
##     Q3_7              0.721    0.106    6.835    0.000
##     Q3_8              0.842    0.115    7.301    0.000
##     Q3_9              0.867    0.141    6.149    0.000
##     Q3_10             0.662    0.094    7.044    0.000
##     Q4_1              0.733    0.116    6.345    0.000
##     Q4_2              0.715    0.115    6.229    0.000
##     Q4_3              0.740    0.117    6.346    0.000
##     Q4_4              0.695    0.125    5.578    0.000
##     Q4_5              0.645    0.145    4.459    0.000
##     Q4_6              0.716    0.119    6.015    0.000
##     Q4_7              0.734    0.100    7.354    0.000
##     Q4_8              0.633    0.112    5.670    0.000
##     Q4_9              0.369    0.174    2.120    0.034
##     Q4_10             0.667    0.132    5.062    0.000
##     Q5_1              0.671    0.120    5.574    0.000
##     Q5_2              0.551    0.127    4.350    0.000
##     Q5_4              0.690    0.135    5.127    0.000
##     Q5_5              0.564    0.111    5.079    0.000
##     Q5_6              0.582    0.108    5.398    0.000
##     Q5_7              0.636    0.109    5.854    0.000
##     Q5_8              0.384    0.156    2.467    0.014
##     Q5_9              0.639    0.109    5.855    0.000
##     Q5_10             0.601    0.135    4.441    0.000
##     Q5_11             0.651    0.145    4.505    0.000
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##  .Q2_3 ~~                                             
##    .Q2_4              0.027    0.029    0.935    0.350
##    .Q2_5              0.045    0.031    1.463    0.144
##    .Q5_5             -0.022    0.030   -0.722    0.470
##    .Q5_6              0.014    0.035    0.386    0.699
##  .Q2_4 ~~                                             
##    .Q2_5              0.085    0.055    1.565    0.118
##    .Q5_5              0.001    0.015    0.034    0.973
##    .Q5_6             -0.024    0.020   -1.239    0.215
##  .Q2_5 ~~                                             
##    .Q5_5             -0.033    0.025   -1.295    0.195
##    .Q5_6             -0.020    0.022   -0.894    0.371
##  .Q5_5 ~~                                             
##    .Q5_6              0.032    0.029    1.116    0.264
##  .Q4_4 ~~                                             
##    .Q4_5             -0.001    0.013   -0.048    0.962
##    .Q4_6              0.047    0.034    1.397    0.162
##  .Q4_5 ~~                                             
##    .Q4_6              0.034    0.026    1.328    0.184
##  .Q4_7 ~~                                             
##    .Q4_8             -0.032    0.024   -1.331    0.183
##  .Q2_8 ~~                                             
##    .Q2_9              0.103    0.066    1.571    0.116
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .Q2_1              4.309    0.136   31.743    0.000
##    .Q2_2              4.236    0.136   31.156    0.000
##    .Q2_3              4.545    0.105   43.106    0.000
##    .Q2_4              4.455    0.109   41.041    0.000
##    .Q2_5              4.436    0.108   40.936    0.000
##    .Q2_6              4.527    0.109   41.669    0.000
##    .Q2_7              4.600    0.091   50.399    0.000
##    .Q2_8              4.491    0.099   45.288    0.000
##    .Q2_9              4.527    0.102   44.219    0.000
##    .Q3_1              4.491    0.109   41.313    0.000
##    .Q3_2              4.545    0.105   43.106    0.000
##    .Q3_3              4.600    0.095   48.511    0.000
##    .Q3_4              4.564    0.102   44.702    0.000
##    .Q3_5              4.600    0.098   46.820    0.000
##    .Q3_6              4.582    0.102   44.984    0.000
##    .Q3_7              4.455    0.120   37.089    0.000
##    .Q3_8              4.236    0.158   26.740    0.000
##    .Q3_9              3.909    0.175   22.349    0.000
##    .Q3_10             4.400    0.114   38.652    0.000
##    .Q4_1              4.564    0.102   44.702    0.000
##    .Q4_2              4.527    0.106   42.887    0.000
##    .Q4_3              4.582    0.102   44.984    0.000
##    .Q4_4              4.582    0.102   44.984    0.000
##    .Q4_5              4.636    0.101   46.002    0.000
##    .Q4_6              4.564    0.102   44.702    0.000
##    .Q4_7              4.291    0.125   34.298    0.000
##    .Q4_8              4.636    0.094   49.325    0.000
##    .Q4_9              4.327    0.123   35.050    0.000
##    .Q4_10             4.618    0.098   47.181    0.000
##    .Q5_1              4.473    0.109   41.167    0.000
##    .Q5_2              4.545    0.105   43.106    0.000
##    .Q5_4              4.636    0.101   46.002    0.000
##    .Q5_5              4.618    0.087   52.984    0.000
##    .Q5_6              4.564    0.095   47.840    0.000
##    .Q5_7              4.618    0.094   48.899    0.000
##    .Q5_8              4.600    0.111   41.481    0.000
##    .Q5_9              4.636    0.094   49.325    0.000
##    .Q5_10             4.473    0.112   40.060    0.000
##    .Q5_11             4.655    0.100   46.403    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .Q2_1              0.319    0.090    3.534    0.000
##    .Q2_2              0.506    0.109    4.626    0.000
##    .Q2_3              0.125    0.041    3.055    0.002
##    .Q2_4              0.121    0.056    2.179    0.029
##    .Q2_5              0.273    0.094    2.906    0.004
##    .Q2_6              0.141    0.046    3.046    0.002
##    .Q2_7              0.080    0.029    2.747    0.006
##    .Q2_8              0.226    0.068    3.337    0.001
##    .Q2_9              0.193    0.075    2.567    0.010
##    .Q3_1              0.099    0.032    3.074    0.002
##    .Q3_2              0.128    0.072    1.776    0.076
##    .Q3_3              0.116    0.071    1.630    0.103
##    .Q3_4              0.026    0.016    1.618    0.106
##    .Q3_5              0.052    0.023    2.281    0.023
##    .Q3_6              0.162    0.073    2.222    0.026
##    .Q3_7              0.273    0.101    2.708    0.007
##    .Q3_8              0.672    0.263    2.550    0.011
##    .Q3_9              0.931    0.229    4.065    0.000
##    .Q3_10             0.275    0.104    2.643    0.008
##    .Q4_1              0.035    0.021    1.723    0.085
##    .Q4_2              0.101    0.042    2.420    0.016
##    .Q4_3              0.023    0.014    1.631    0.103
##    .Q4_4              0.087    0.068    1.278    0.201
##    .Q4_5              0.143    0.059    2.414    0.016
##    .Q4_6              0.061    0.026    2.327    0.020
##    .Q4_7              0.321    0.093    3.441    0.001
##    .Q4_8              0.086    0.034    2.507    0.012
##    .Q4_9              0.702    0.150    4.690    0.000
##    .Q4_10             0.082    0.047    1.725    0.084
##    .Q5_1              0.199    0.086    2.322    0.020
##    .Q5_2              0.308    0.109    2.821    0.005
##    .Q5_4              0.082    0.034    2.447    0.014
##    .Q5_5              0.100    0.043    2.322    0.020
##    .Q5_6              0.162    0.071    2.289    0.022
##    .Q5_7              0.087    0.032    2.671    0.008
##    .Q5_8              0.529    0.269    1.970    0.049
##    .Q5_9              0.078    0.031    2.465    0.014
##    .Q5_10             0.325    0.118    2.761    0.006
##    .Q5_11             0.129    0.056    2.324    0.020
##     CSE               1.000
csek12one.metric.nooutlier <- cfa(csek12one.mod4, data = csek12.schoolage1, std.lv = TRUE, missing = "FIML", estimator = "MLR", group = "Parent", group.equal = "loadings") #metric model
## Warning: lavaan->lav_mvnorm_missing_h1_estimate_moments():  
##    The smallest eigenvalue of the EM estimated variance-covariance matrix 
##    (Sigma) is smaller than 1e-05; this may cause numerical instabilities; 
##    interpret the results with caution.
## Warning: lavaan->lav_model_vcov():  
##    The variance-covariance matrix of the estimated parameters (vcov) does not 
##    appear to be positive definite! The smallest eigenvalue (= -9.173493e-17) 
##    is smaller than zero. This may be a symptom that the model is not 
##    identified.
summary(compareFit(csek12one.metric.nooutlier, csek12one.config.nooutlier))
## ################### Nested Model Comparison #########################
## 
## Scaled Chi-Squared Difference Test (method = "satorra.bentler.2001")
## 
## lavaan->unknown():  
##    lavaan NOTE: The "Chisq" column contains standard test statistics, not the 
##    robust test that should be reported per model. A robust difference test is 
##    a function of two standard (not robust) statistics.
##                              Df    AIC    BIC  Chisq Chisq diff Df diff
## csek12one.config.nooutlier 1374 5161.9 5872.4 5373.2                   
## csek12one.metric.nooutlier 1412 5140.2 5748.4 5427.5     39.249      38
##                            Pr(>Chisq)
## csek12one.config.nooutlier           
## csek12one.metric.nooutlier     0.4137
## 
## ####################### Model Fit Indices ###########################
##                            chisq.scaled df.scaled pvalue.scaled rmsea.robust
## csek12one.config.nooutlier    5339.097†      1374          .000        .229 
## csek12one.metric.nooutlier    5339.305       1412          .000        .226†
##                            cfi.robust tli.robust  srmr       aic       bic
## csek12one.config.nooutlier      .517†      .479  .080† 5161.922  5872.438 
## csek12one.metric.nooutlier      .516       .492† .106  5140.187† 5748.431†
## 
## ################## Differences in Fit Indices #######################
##                                                         df.scaled rmsea.robust
## csek12one.metric.nooutlier - csek12one.config.nooutlier        38       -0.003
##                                                         cfi.robust tli.robust
## csek12one.metric.nooutlier - csek12one.config.nooutlier          0      0.014
##                                                          srmr     aic      bic
## csek12one.metric.nooutlier - csek12one.config.nooutlier 0.026 -21.735 -124.007
csek12one.scalar.nooutlier <- cfa(csek12one.mod4, data = csek12.schoolage1, std.lv = TRUE, missing = "FIML", estimator = "MLR", group = "Parent", group.equal = c("loadings", "intercepts")) #metric model
## Warning: lavaan->lav_mvnorm_missing_h1_estimate_moments():  
##    The smallest eigenvalue of the EM estimated variance-covariance matrix 
##    (Sigma) is smaller than 1e-05; this may cause numerical instabilities; 
##    interpret the results with caution.
## Warning: lavaan->lav_model_vcov():  
##    The variance-covariance matrix of the estimated parameters (vcov) does not 
##    appear to be positive definite! The smallest eigenvalue (= -2.901192e-18) 
##    is smaller than zero. This may be a symptom that the model is not 
##    identified.
summary(compareFit(csek12one.metric.nooutlier, csek12one.scalar.nooutlier))
## ################### Nested Model Comparison #########################
## 
## Scaled Chi-Squared Difference Test (method = "satorra.bentler.2001")
## 
## lavaan->unknown():  
##    lavaan NOTE: The "Chisq" column contains standard test statistics, not the 
##    robust test that should be reported per model. A robust difference test is 
##    a function of two standard (not robust) statistics.
##                              Df    AIC    BIC  Chisq Chisq diff Df diff
## csek12one.metric.nooutlier 1412 5140.2 5748.4 5427.5                   
## csek12one.scalar.nooutlier 1450 5093.2 5599.2 5456.5      32.51      38
##                            Pr(>Chisq)
## csek12one.metric.nooutlier           
## csek12one.scalar.nooutlier     0.7208
## 
## ####################### Model Fit Indices ###########################
##                            chisq.scaled df.scaled pvalue.scaled rmsea.robust
## csek12one.metric.nooutlier    5339.305†      1412          .000        .226 
## csek12one.scalar.nooutlier    5385.142       1450          .000        .223†
##                            cfi.robust tli.robust  srmr       aic       bic
## csek12one.metric.nooutlier      .516       .492  .106† 5140.187  5748.431 
## csek12one.scalar.nooutlier      .517†      .507† .107  5093.179† 5599.153†
## 
## ################## Differences in Fit Indices #######################
##                                                         df.scaled rmsea.robust
## csek12one.scalar.nooutlier - csek12one.metric.nooutlier        38       -0.003
##                                                         cfi.robust tli.robust
## csek12one.scalar.nooutlier - csek12one.metric.nooutlier      0.001      0.014
##                                                          srmr     aic      bic
## csek12one.scalar.nooutlier - csek12one.metric.nooutlier 0.001 -47.007 -149.279
#examining invariance by gender when outliers are removed
csek12.gender1 <- subset(csek12.nooutliers, Gender_3cat != 3) #removal of participants who did not identify as either male or female in the no outlier data
csek12one.config1.nooutlier <- cfa(csek12one.mod4, data = csek12.gender1, std.lv = TRUE, missing = "FIML", estimator = "MLR", group = "Gender_3cat")
## Warning: lavaan->lav_model_vcov():  
##    The variance-covariance matrix of the estimated parameters (vcov) does not 
##    appear to be positive definite! The smallest eigenvalue (= -5.690865e-16) 
##    is smaller than zero. This may be a symptom that the model is not 
##    identified.
csek12one.metric1.nooutlier <- cfa(csek12one.mod4, data = csek12.gender1, std.lv = TRUE, missing = "FIML", estimator = "MLR", group = "Gender_3cat", group.equal = "loadings")
## Warning: lavaan->lav_model_vcov():  
##    The variance-covariance matrix of the estimated parameters (vcov) does not 
##    appear to be positive definite! The smallest eigenvalue (= -1.218020e-18) 
##    is smaller than zero. This may be a symptom that the model is not 
##    identified.
summary(compareFit(csek12one.metric1.nooutlier, csek12one.config1.nooutlier))
## ################### Nested Model Comparison #########################
## 
## Scaled Chi-Squared Difference Test (method = "satorra.bentler.2001")
## 
## lavaan->unknown():  
##    lavaan NOTE: The "Chisq" column contains standard test statistics, not the 
##    robust test that should be reported per model. A robust difference test is 
##    a function of two standard (not robust) statistics.
##                               Df   AIC   BIC  Chisq Chisq diff Df diff
## csek12one.config1.nooutlier 1374 11109 12027 4095.8                   
## csek12one.metric1.nooutlier 1412 11075 11861 4137.7     28.647      38
##                             Pr(>Chisq)
## csek12one.config1.nooutlier           
## csek12one.metric1.nooutlier     0.8639
## 
## ####################### Model Fit Indices ###########################
##                             chisq.scaled df.scaled pvalue.scaled rmsea.robust
## csek12one.config1.nooutlier    2860.095†      1374          .000        .111 
## csek12one.metric1.nooutlier    2887.750       1412          .000        .109†
##                             cfi.robust tli.robust  srmr        aic        bic
## csek12one.config1.nooutlier      .822       .809  .054† 11109.126  12026.913 
## csek12one.metric1.nooutlier      .823†      .814† .073  11074.980† 11860.660†
## 
## ################## Differences in Fit Indices #######################
##                                                           df.scaled
## csek12one.metric1.nooutlier - csek12one.config1.nooutlier        38
##                                                           rmsea.robust
## csek12one.metric1.nooutlier - csek12one.config1.nooutlier       -0.002
##                                                           cfi.robust tli.robust
## csek12one.metric1.nooutlier - csek12one.config1.nooutlier      0.001      0.006
##                                                            srmr     aic
## csek12one.metric1.nooutlier - csek12one.config1.nooutlier 0.019 -34.146
##                                                                bic
## csek12one.metric1.nooutlier - csek12one.config1.nooutlier -166.252
csek12one.scalar1.nooutlier <- cfa(csek12one.mod4, data = csek12.gender1, std.lv = TRUE, missing = "FIML", estimator = "MLR", group = "Gender_3cat", group.equal = c("loadings", "intercepts"))
## Warning: lavaan->lav_model_vcov():  
##    The variance-covariance matrix of the estimated parameters (vcov) does not 
##    appear to be positive definite! The smallest eigenvalue (= 2.989826e-16) 
##    is close to zero. This may be a symptom that the model is not identified.
summary(compareFit(csek12one.scalar1.nooutlier, csek12one.metric1.nooutlier))
## ################### Nested Model Comparison #########################
## 
## Scaled Chi-Squared Difference Test (method = "satorra.bentler.2001")
## 
## lavaan->unknown():  
##    lavaan NOTE: The "Chisq" column contains standard test statistics, not the 
##    robust test that should be reported per model. A robust difference test is 
##    a function of two standard (not robust) statistics.
##                               Df   AIC   BIC  Chisq Chisq diff Df diff
## csek12one.metric1.nooutlier 1412 11075 11861 4137.7                   
## csek12one.scalar1.nooutlier 1450 11019 11673 4158.0     19.977      38
##                             Pr(>Chisq)
## csek12one.metric1.nooutlier           
## csek12one.scalar1.nooutlier     0.9929
## 
## ####################### Model Fit Indices ###########################
##                             chisq.scaled df.scaled pvalue.scaled rmsea.robust
## csek12one.metric1.nooutlier    2887.750†      1412          .000        .109 
## csek12one.scalar1.nooutlier    2924.218       1450          .000        .108†
##                             cfi.robust tli.robust  srmr        aic        bic
## csek12one.metric1.nooutlier      .823       .814  .073† 11074.980  11860.660 
## csek12one.scalar1.nooutlier      .825†      .821† .073  11019.272† 11672.847†
## 
## ################## Differences in Fit Indices #######################
##                                                           df.scaled
## csek12one.scalar1.nooutlier - csek12one.metric1.nooutlier        38
##                                                           rmsea.robust
## csek12one.scalar1.nooutlier - csek12one.metric1.nooutlier       -0.002
##                                                           cfi.robust tli.robust
## csek12one.scalar1.nooutlier - csek12one.metric1.nooutlier      0.002      0.006
##                                                            srmr     aic
## csek12one.scalar1.nooutlier - csek12one.metric1.nooutlier 0.001 -55.708
##                                                                bic
## csek12one.scalar1.nooutlier - csek12one.metric1.nooutlier -187.813
#examining invariance by education when outliers are removed
csek12one.config2.nooutliers <- cfa(csek12one.mod4, data = csek12.nooutliers, std.lv = TRUE, missing = "FIML", estimator = "MLR", group = "highered") #configural model
## Warning: lavaan->lav_model_vcov():  
##    The variance-covariance matrix of the estimated parameters (vcov) does not 
##    appear to be positive definite! The smallest eigenvalue (= -1.257637e-15) 
##    is smaller than zero. This may be a symptom that the model is not 
##    identified.
lavInspect(csek12one.config2.nooutliers, "cov.lv")
## $`1`
##     CSE
## CSE   1
## 
## $`0`
##     CSE
## CSE   1
csek12one.metric2.nooutliers <- cfa(csek12one.mod4, data = csek12.nooutliers, std.lv = TRUE, missing = "FIML", estimator = "MLR", group = "highered", group.equal = "loadings") #metric model
## Warning: lavaan->lav_model_vcov():  
##    The variance-covariance matrix of the estimated parameters (vcov) does not 
##    appear to be positive definite! The smallest eigenvalue (= -2.690439e-18) 
##    is smaller than zero. This may be a symptom that the model is not 
##    identified.
summary(compareFit(csek12one.metric2.nooutliers, csek12one.config2.nooutliers))
## ################### Nested Model Comparison #########################
## 
## Scaled Chi-Squared Difference Test (method = "satorra.bentler.2001")
## 
## lavaan->unknown():  
##    lavaan NOTE: The "Chisq" column contains standard test statistics, not the 
##    robust test that should be reported per model. A robust difference test is 
##    a function of two standard (not robust) statistics.
##                                Df   AIC   BIC  Chisq Chisq diff Df diff
## csek12one.config2.nooutliers 1374 11353 12284 4247.4                   
## csek12one.metric2.nooutliers 1412 11330 12127 4300.3     38.864      38
##                              Pr(>Chisq)
## csek12one.config2.nooutliers           
## csek12one.metric2.nooutliers     0.4306
## 
## ####################### Model Fit Indices ###########################
##                              chisq.scaled df.scaled pvalue.scaled rmsea.robust
## csek12one.config2.nooutliers    2906.883†      1374          .000        .112 
## csek12one.metric2.nooutliers    2948.460       1412          .000        .110†
##                              cfi.robust tli.robust  srmr        aic        bic
## csek12one.config2.nooutliers      .827†      .813  .052† 11353.248  12283.968 
## csek12one.metric2.nooutliers      .826       .818† .070  11330.229† 12126.981†
## 
## ################## Differences in Fit Indices #######################
##                                                             df.scaled
## csek12one.metric2.nooutliers - csek12one.config2.nooutliers        38
##                                                             rmsea.robust
## csek12one.metric2.nooutliers - csek12one.config2.nooutliers       -0.001
##                                                             cfi.robust
## csek12one.metric2.nooutliers - csek12one.config2.nooutliers          0
##                                                             tli.robust  srmr
## csek12one.metric2.nooutliers - csek12one.config2.nooutliers      0.005 0.017
##                                                                 aic      bic
## csek12one.metric2.nooutliers - csek12one.config2.nooutliers -23.019 -156.986
csek12one.scalar2.nooutliers <- cfa(csek12one.mod4, data = csek12.nooutliers, std.lv = TRUE, missing = "FIML", estimator = "MLR", group = "highered", group.equal = c("loadings", "intercepts")) #scalar model
## Warning: lavaan->lav_model_vcov():  
##    The variance-covariance matrix of the estimated parameters (vcov) does not 
##    appear to be positive definite! The smallest eigenvalue (= 1.483280e-16) 
##    is close to zero. This may be a symptom that the model is not identified.
summary(compareFit(csek12one.scalar2.nooutliers, csek12one.metric2.nooutliers)) 
## ################### Nested Model Comparison #########################
## 
## Scaled Chi-Squared Difference Test (method = "satorra.bentler.2001")
## 
## lavaan->unknown():  
##    lavaan NOTE: The "Chisq" column contains standard test statistics, not the 
##    robust test that should be reported per model. A robust difference test is 
##    a function of two standard (not robust) statistics.
##                                Df   AIC   BIC  Chisq Chisq diff Df diff
## csek12one.metric2.nooutliers 1412 11330 12127 4300.3                   
## csek12one.scalar2.nooutliers 1450 11304 11967 4350.1     54.357      38
##                              Pr(>Chisq)  
## csek12one.metric2.nooutliers             
## csek12one.scalar2.nooutliers    0.04151 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## ####################### Model Fit Indices ###########################
##                              chisq.scaled df.scaled pvalue.scaled rmsea.robust
## csek12one.metric2.nooutliers    2948.460†      1412          .000        .110 
## csek12one.scalar2.nooutliers    3011.970       1450          .000        .109†
##                              cfi.robust tli.robust  srmr        aic        bic
## csek12one.metric2.nooutliers      .826†      .818  .070† 11330.229  12126.981 
## csek12one.scalar2.nooutliers      .825       .822† .070  11303.982† 11966.767†
## 
## ################## Differences in Fit Indices #######################
##                                                             df.scaled
## csek12one.scalar2.nooutliers - csek12one.metric2.nooutliers        38
##                                                             rmsea.robust
## csek12one.scalar2.nooutliers - csek12one.metric2.nooutliers       -0.001
##                                                             cfi.robust
## csek12one.scalar2.nooutliers - csek12one.metric2.nooutliers     -0.001
##                                                             tli.robust  srmr
## csek12one.scalar2.nooutliers - csek12one.metric2.nooutliers      0.004 0.001
##                                                                 aic      bic
## csek12one.scalar2.nooutliers - csek12one.metric2.nooutliers -26.247 -160.214
#running validity tests w/ outliers removed
csek12one.val3.nooutliers <- '
             CSE =~ Q2_1 + Q2_2 + Q2_3 + Q2_4 + Q2_5 + Q2_6 + Q2_7 + Q2_8 + Q2_9 + Q3_1 + Q3_2 + Q3_3 + Q3_4 + Q3_5 + Q3_6 + Q3_7 + Q3_8 + Q3_9 + Q3_10 + Q4_1 + Q4_2 + Q4_3 + Q4_4 + Q4_5 + Q4_6 + Q4_7 + Q4_8 + Q4_9 + Q4_10 + Q5_1 + Q5_2 + Q5_4 + Q5_5 + Q5_6 + Q5_7 + Q5_8 + Q5_9 + Q5_10 + Q5_11
        
          #covariances
          Q2_3 ~~ Q2_4
          Q2_3 ~~ Q2_5
          Q2_3 ~~ Q5_5
          Q2_3 ~~ Q5_6
          Q2_4 ~~ Q2_5
          Q2_4 ~~ Q5_5
          Q2_4 ~~ Q5_6
          Q2_5 ~~ Q5_5
          Q2_5 ~~ Q5_6
          Q5_5 ~~ Q5_6
          Q4_4 ~~ Q4_5
          Q4_4 ~~ Q4_6
          Q4_5 ~~ Q4_6
          Q4_7 ~~ Q4_8
          Q2_8 ~~ Q2_9
          CSE ~~ Important_Middle
          CSE ~~ Important_High
          CSE ~~ Sex_Pos
          CSE ~~ Sex_Neg
          CSE ~~ PolAff
          
          #regressions
          Sex_Pos ~ Vote1
          Sex_Neg ~ Vote1
'
csek12one.fit.val3.nooutliers <- cfa(csek12one.val3.nooutliers, data = csek12.nooutliers, std.lv = TRUE, estimator = "MLR")
summary(csek12one.fit.val3.nooutliers, fit.measures = TRUE, standardized = TRUE)
## lavaan 0.6-18 ended normally after 218 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       106
## 
##                                                   Used       Total
##   Number of observations                           231         251
## 
## Model Test User Model:
##                                               Standard      Scaled
##   Test Statistic                              3208.422    2066.647
##   Degrees of freedom                               928         928
##   P-value (Chi-square)                           0.000       0.000
##   Scaling correction factor                                  1.552
##     Yuan-Bentler correction (Mplus variant)                       
## 
## Model Test Baseline Model:
## 
##   Test statistic                             12776.441    7745.073
##   Degrees of freedom                               990         990
##   P-value                                        0.000       0.000
##   Scaling correction factor                                  1.650
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.807       0.831
##   Tucker-Lewis Index (TLI)                       0.794       0.820
##                                                                   
##   Robust Comparative Fit Index (CFI)                         0.841
##   Robust Tucker-Lewis Index (TLI)                            0.831
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -7040.482   -7040.482
##   Scaling correction factor                                  3.371
##       for the MLR correction                                      
##   Loglikelihood unrestricted model (H1)             NA          NA
##   Scaling correction factor                                  1.739
##       for the MLR correction                                      
##                                                                   
##   Akaike (AIC)                               14292.965   14292.965
##   Bayesian (BIC)                             14657.861   14657.861
##   Sample-size adjusted Bayesian (SABIC)      14321.901   14321.901
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.103       0.073
##   90 Percent confidence interval - lower         0.099       0.069
##   90 Percent confidence interval - upper         0.107       0.076
##   P-value H_0: RMSEA <= 0.050                    0.000       0.000
##   P-value H_0: RMSEA >= 0.080                    1.000       0.000
##                                                                   
##   Robust RMSEA                                               0.091
##   90 Percent confidence interval - lower                     0.086
##   90 Percent confidence interval - upper                     0.096
##   P-value H_0: Robust RMSEA <= 0.050                         0.000
##   P-value H_0: Robust RMSEA >= 0.080                         1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.194       0.194
## 
## Parameter Estimates:
## 
##   Standard errors                             Sandwich
##   Information bread                           Observed
##   Observed information based on                Hessian
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   CSE =~                                                                
##     Q2_1              0.608    0.059   10.273    0.000    0.608    0.810
##     Q2_2              0.509    0.056    9.015    0.000    0.509    0.576
##     Q2_3              0.481    0.045   10.757    0.000    0.481    0.840
##     Q2_4              0.552    0.050   11.063    0.000    0.552    0.787
##     Q2_5              0.530    0.055    9.642    0.000    0.530    0.767
##     Q2_6              0.457    0.062    7.421    0.000    0.457    0.740
##     Q2_7              0.472    0.069    6.806    0.000    0.472    0.821
##     Q2_8              0.446    0.056    7.922    0.000    0.446    0.673
##     Q2_9              0.380    0.062    6.135    0.000    0.380    0.609
##     Q3_1              0.537    0.050   10.680    0.000    0.537    0.900
##     Q3_2              0.508    0.054    9.467    0.000    0.508    0.862
##     Q3_3              0.468    0.049    9.534    0.000    0.468    0.863
##     Q3_4              0.530    0.051   10.420    0.000    0.530    0.893
##     Q3_5              0.476    0.050    9.546    0.000    0.476    0.849
##     Q3_6              0.367    0.047    7.772    0.000    0.367    0.703
##     Q3_7              0.598    0.057   10.426    0.000    0.598    0.762
##     Q3_8              0.674    0.066   10.198    0.000    0.674    0.644
##     Q3_9              0.732    0.065   11.254    0.000    0.732    0.605
##     Q3_10             0.484    0.056    8.687    0.000    0.484    0.687
##     Q4_1              0.535    0.052   10.324    0.000    0.535    0.899
##     Q4_2              0.520    0.053    9.839    0.000    0.520    0.756
##     Q4_3              0.498    0.056    8.942    0.000    0.498    0.920
##     Q4_4              0.469    0.058    8.141    0.000    0.469    0.884
##     Q4_5              0.435    0.057    7.666    0.000    0.435    0.781
##     Q4_6              0.532    0.054    9.929    0.000    0.532    0.876
##     Q4_7              0.603    0.055   10.900    0.000    0.603    0.816
##     Q4_8              0.398    0.056    7.153    0.000    0.398    0.768
##     Q4_9              0.311    0.069    4.469    0.000    0.311    0.329
##     Q4_10             0.491    0.055    8.871    0.000    0.491    0.825
##     Q5_1              0.517    0.048   10.707    0.000    0.517    0.781
##     Q5_2              0.444    0.052    8.510    0.000    0.444    0.705
##     Q5_4              0.436    0.058    7.545    0.000    0.436    0.838
##     Q5_5              0.379    0.044    8.650    0.000    0.379    0.686
##     Q5_6              0.429    0.049    8.830    0.000    0.429    0.780
##     Q5_7              0.449    0.053    8.546    0.000    0.449    0.827
##     Q5_8              0.353    0.061    5.750    0.000    0.353    0.425
##     Q5_9              0.407    0.046    8.868    0.000    0.407    0.819
##     Q5_10             0.409    0.062    6.603    0.000    0.409    0.601
##     Q5_11             0.469    0.059    7.939    0.000    0.469    0.870
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Sex_Pos ~                                                             
##     Vote1             5.096    2.697    1.890    0.059    5.096    0.166
##   Sex_Neg ~                                                             
##     Vote1            -2.395    1.266   -1.892    0.059   -2.395   -0.160
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##  .Q2_3 ~~                                                               
##    .Q2_4              0.011    0.013    0.864    0.387    0.011    0.085
##    .Q2_5              0.011    0.015    0.785    0.432    0.011    0.083
##    .Q5_5              0.014    0.015    0.949    0.343    0.014    0.116
##    .Q5_6              0.020    0.012    1.625    0.104    0.020    0.185
##  .Q2_4 ~~                                                               
##    .Q2_5              0.084    0.022    3.761    0.000    0.084    0.439
##    .Q5_5              0.030    0.017    1.763    0.078    0.030    0.174
##    .Q5_6             -0.024    0.012   -2.055    0.040   -0.024   -0.163
##  .Q2_5 ~~                                                               
##    .Q5_5              0.019    0.017    1.105    0.269    0.019    0.105
##    .Q5_6             -0.027    0.015   -1.831    0.067   -0.027   -0.178
##  .Q5_5 ~~                                                               
##    .Q5_6              0.017    0.017    1.024    0.306    0.017    0.123
##  .Q4_4 ~~                                                               
##    .Q4_5              0.016    0.010    1.641    0.101    0.016    0.188
##    .Q4_6              0.007    0.010    0.674    0.500    0.007    0.096
##  .Q4_5 ~~                                                               
##    .Q4_6              0.033    0.012    2.733    0.006    0.033    0.327
##  .Q4_7 ~~                                                               
##    .Q4_8             -0.002    0.017   -0.098    0.922   -0.002   -0.012
##  .Q2_8 ~~                                                               
##    .Q2_9              0.123    0.034    3.591    0.000    0.123    0.509
##   CSE ~~                                                                
##     Important_Mddl   -0.426    0.099   -4.320    0.000   -0.426   -0.466
##     Important_High   -0.190    0.084   -2.271    0.023   -0.190   -0.368
##    .Sex_Pos           0.752    0.610    1.232    0.218    0.752    0.095
##    .Sex_Neg           0.225    0.389    0.579    0.563    0.225    0.058
##     PolAff            0.205    0.146    1.408    0.159    0.205    0.121
##  .Sex_Pos ~~                                                            
##    .Sex_Neg         -15.606    5.757   -2.711    0.007  -15.606   -0.511
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .Q2_1              0.194    0.037    5.291    0.000    0.194    0.344
##    .Q2_2              0.522    0.089    5.871    0.000    0.522    0.668
##    .Q2_3              0.097    0.017    5.681    0.000    0.097    0.295
##    .Q2_4              0.187    0.033    5.694    0.000    0.187    0.381
##    .Q2_5              0.196    0.035    5.585    0.000    0.196    0.411
##    .Q2_6              0.172    0.048    3.612    0.000    0.172    0.452
##    .Q2_7              0.108    0.022    4.836    0.000    0.108    0.326
##    .Q2_8              0.240    0.040    5.946    0.000    0.240    0.547
##    .Q2_9              0.245    0.043    5.735    0.000    0.245    0.629
##    .Q3_1              0.068    0.012    5.468    0.000    0.068    0.191
##    .Q3_2              0.089    0.026    3.471    0.001    0.089    0.257
##    .Q3_3              0.075    0.023    3.222    0.001    0.075    0.255
##    .Q3_4              0.072    0.019    3.784    0.000    0.072    0.203
##    .Q3_5              0.088    0.019    4.709    0.000    0.088    0.279
##    .Q3_6              0.138    0.036    3.875    0.000    0.138    0.505
##    .Q3_7              0.258    0.044    5.852    0.000    0.258    0.419
##    .Q3_8              0.639    0.125    5.098    0.000    0.639    0.585
##    .Q3_9              0.930    0.136    6.844    0.000    0.930    0.634
##    .Q3_10             0.263    0.055    4.799    0.000    0.263    0.528
##    .Q4_1              0.068    0.019    3.563    0.000    0.068    0.191
##    .Q4_2              0.202    0.050    4.025    0.000    0.202    0.428
##    .Q4_3              0.045    0.008    5.442    0.000    0.045    0.153
##    .Q4_4              0.062    0.018    3.454    0.001    0.062    0.219
##    .Q4_5              0.121    0.026    4.689    0.000    0.121    0.390
##    .Q4_6              0.086    0.015    5.751    0.000    0.086    0.233
##    .Q4_7              0.183    0.036    5.038    0.000    0.183    0.335
##    .Q4_8              0.110    0.024    4.589    0.000    0.110    0.410
##    .Q4_9              0.795    0.115    6.942    0.000    0.795    0.892
##    .Q4_10             0.113    0.026    4.407    0.000    0.113    0.319
##    .Q5_1              0.171    0.035    4.856    0.000    0.171    0.390
##    .Q5_2              0.200    0.050    3.967    0.000    0.200    0.503
##    .Q5_4              0.081    0.020    3.967    0.000    0.081    0.298
##    .Q5_5              0.161    0.029    5.527    0.000    0.161    0.529
##    .Q5_6              0.119    0.023    5.126    0.000    0.119    0.392
##    .Q5_7              0.093    0.020    4.567    0.000    0.093    0.316
##    .Q5_8              0.566    0.117    4.841    0.000    0.566    0.819
##    .Q5_9              0.081    0.015    5.327    0.000    0.081    0.330
##    .Q5_10             0.297    0.050    5.940    0.000    0.297    0.639
##    .Q5_11             0.071    0.016    4.430    0.000    0.071    0.243
##    .Sex_Pos          62.581    7.620    8.212    0.000   62.581    0.972
##    .Sex_Neg          14.891    6.199    2.402    0.016   14.891    0.974
##     Important_Mddl    0.833    0.115    7.216    0.000    0.833    1.000
##     Important_High    0.266    0.101    2.624    0.009    0.266    1.000
##     PolAff            2.867    0.247   11.606    0.000    2.867    1.000
##     CSE               1.000                               1.000    1.000
psych::describeBy(csek12.nooutliers$Sex_Pos, group = csek12.nooutliers$Vote1)
## 
##  Descriptive statistics by group 
## group: 1
##    vars  n  mean    sd median trimmed   mad min max range skew kurtosis   se
## X1    1 17 33.94 10.09     33    34.2 13.34  16  48    32 -0.3    -1.11 2.45
## ------------------------------------------------------------ 
## group: 2
##    vars   n mean   sd median trimmed mad min max range  skew kurtosis   se
## X1    1 219 40.1 7.73     40   41.11 8.9   8  48    40 -1.18     1.73 0.52
psych::describeBy(csek12.nooutliers$Sex_Neg, group = csek12.nooutliers$Vote1)
## 
##  Descriptive statistics by group 
## group: 1
##    vars  n  mean  sd median trimmed  mad min max range skew kurtosis   se
## X1    1 17 12.65 4.8     10    12.2 2.97   8  24    16 0.77    -0.57 1.16
## ------------------------------------------------------------ 
## group: 2
##    vars   n  mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 219 10.57 3.76     10    9.92 2.97   8  48    40 5.24     44.1 0.25
#running validity tests w/ outliers removed
csek12one.val3.nooutliers1 <- '
             CSE =~ Q2_1 + Q2_2 + Q2_3 + Q2_4 + Q2_5 + Q2_6 + Q2_7 + Q2_8 + Q2_9 + Q3_1 + Q3_2 + Q3_3 + Q3_4 + Q3_5 + Q3_6 + Q3_7 + Q3_8 + Q3_9 + Q3_10 + Q4_1 + Q4_2 + Q4_3 + Q4_4 + Q4_5 + Q4_6 + Q4_7 + Q4_8 + Q4_9 + Q4_10 + Q5_1 + Q5_2 + Q5_4 + Q5_5 + Q5_6 + Q5_7 + Q5_8 + Q5_9 + Q5_10 + Q5_11
        
          #covariances
          Q2_3 ~~ Q2_4
          Q2_3 ~~ Q2_5
          Q2_3 ~~ Q5_5
          Q2_3 ~~ Q5_6
          Q2_4 ~~ Q2_5
          Q2_4 ~~ Q5_5
          Q2_4 ~~ Q5_6
          Q2_5 ~~ Q5_5
          Q2_5 ~~ Q5_6
          Q5_5 ~~ Q5_6
          Q4_4 ~~ Q4_5
          Q4_4 ~~ Q4_6
          Q4_5 ~~ Q4_6
          Q4_7 ~~ Q4_8
          Q2_8 ~~ Q2_9
          CSE ~~ Important_Middle
          CSE ~~ Important_High
          CSE ~~ Sex_Pos
          CSE ~~ Sex_Neg
          CSE ~~ PolAff
          
          #regressions
          Vote1 ~ CSE
'
csek12one.fit.val3.nooutliers1 <- cfa(csek12one.val3.nooutliers1, data = csek12.nooutliers, std.lv = TRUE, estimator = "DWLS")
## Warning: lavaan->lav_options_est_dwls():  
##    estimator "DWLS" is not recommended for continuous data. Did you forget to 
##    set the ordered= argument?
## Warning: lavaan->lav_data_full():  
##    some observed variances are (at least) a factor 1000 times larger than 
##    others; use varTable(fit) to investigate
## Warning: lavaan->lav_samplestats_from_data():  
##    number of observations (231) too small to compute Gamma
summary(csek12one.fit.val3.nooutliers1, fit.measures = TRUE, standardized = TRUE)
## lavaan 0.6-18 ended normally after 91 iterations
## 
##   Estimator                                       DWLS
##   Optimization method                           NLMINB
##   Number of model parameters                       105
## 
##                                                   Used       Total
##   Number of observations                           231         251
## 
## Model Test User Model:
##                                                       
##   Test statistic                               301.901
##   Degrees of freedom                               930
##   P-value (Chi-square)                           1.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                             19157.721
##   Degrees of freedom                               990
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.037
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent confidence interval - lower         0.000
##   90 Percent confidence interval - upper         0.000
##   P-value H_0: RMSEA <= 0.050                    1.000
##   P-value H_0: RMSEA >= 0.080                    0.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.060
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model        Unstructured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   CSE =~                                                                
##     Q2_1              0.696    0.022   31.964    0.000    0.696    0.852
##     Q2_2              0.562    0.018   31.021    0.000    0.562    0.608
##     Q2_3              0.539    0.018   30.781    0.000    0.539    0.860
##     Q2_4              0.640    0.021   31.148    0.000    0.640    0.843
##     Q2_5              0.607    0.021   28.917    0.000    0.607    0.814
##     Q2_6              0.518    0.019   27.309    0.000    0.518    0.782
##     Q2_7              0.519    0.019   26.823    0.000    0.519    0.828
##     Q2_8              0.511    0.018   28.327    0.000    0.511    0.727
##     Q2_9              0.425    0.017   25.536    0.000    0.425    0.649
##     Q3_1              0.602    0.019   32.109    0.000    0.602    0.912
##     Q3_2              0.570    0.019   30.339    0.000    0.570    0.880
##     Q3_3              0.528    0.018   30.134    0.000    0.528    0.886
##     Q3_4              0.598    0.019   31.771    0.000    0.598    0.911
##     Q3_5              0.527    0.018   29.855    0.000    0.527    0.859
##     Q3_6              0.408    0.015   26.823    0.000    0.408    0.732
##     Q3_7              0.685    0.022   31.450    0.000    0.685    0.809
##     Q3_8              0.767    0.025   31.239    0.000    0.767    0.694
##     Q3_9              0.846    0.025   34.281    0.000    0.846    0.665
##     Q3_10             0.563    0.019   30.339    0.000    0.563    0.751
##     Q4_1              0.604    0.019   31.738    0.000    0.604    0.918
##     Q4_2              0.585    0.019   31.245    0.000    0.585    0.790
##     Q4_3              0.553    0.019   29.436    0.000    0.553    0.919
##     Q4_4              0.523    0.019   27.937    0.000    0.523    0.894
##     Q4_5              0.487    0.018   27.617    0.000    0.487    0.810
##     Q4_6              0.601    0.020   30.231    0.000    0.601    0.898
##     Q4_7              0.687    0.021   32.176    0.000    0.687    0.852
##     Q4_8              0.441    0.017   25.548    0.000    0.441    0.789
##     Q4_9              0.364    0.018   20.365    0.000    0.364    0.380
##     Q4_10             0.557    0.018   30.253    0.000    0.557    0.857
##     Q5_1              0.595    0.018   32.183    0.000    0.595    0.830
##     Q5_2              0.495    0.017   28.452    0.000    0.495    0.736
##     Q5_4              0.482    0.017   27.748    0.000    0.482    0.848
##     Q5_5              0.436    0.015   28.585    0.000    0.436    0.741
##     Q5_6              0.487    0.018   27.599    0.000    0.487    0.819
##     Q5_7              0.509    0.017   29.334    0.000    0.509    0.859
##     Q5_8              0.391    0.017   22.580    0.000    0.391    0.459
##     Q5_9              0.458    0.015   29.742    0.000    0.458    0.846
##     Q5_10             0.465    0.018   26.148    0.000    0.465    0.650
##     Q5_11             0.526    0.019   28.420    0.000    0.526    0.887
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Vote1 ~                                                               
##     CSE               0.184    0.008   23.845    0.000    0.184    0.704
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##  .Q2_3 ~~                                                               
##    .Q2_4              0.006    0.060    0.093    0.926    0.006    0.043
##    .Q2_5              0.010    0.062    0.162    0.872    0.010    0.073
##    .Q5_5              0.013    0.047    0.268    0.788    0.013    0.100
##    .Q5_6              0.021    0.055    0.377    0.706    0.021    0.190
##  .Q2_4 ~~                                                               
##    .Q2_5              0.070    0.078    0.896    0.370    0.070    0.393
##    .Q5_5              0.019    0.055    0.341    0.733    0.019    0.116
##    .Q5_6             -0.034    0.061   -0.559    0.576   -0.034   -0.245
##  .Q2_5 ~~                                                               
##    .Q5_5              0.011    0.055    0.198    0.843    0.011    0.064
##    .Q5_6             -0.033    0.063   -0.516    0.606   -0.033   -0.221
##  .Q5_5 ~~                                                               
##    .Q5_6              0.012    0.050    0.248    0.804    0.012    0.091
##  .Q4_4 ~~                                                               
##    .Q4_5              0.021    0.064    0.334    0.738    0.021    0.231
##    .Q4_6              0.011    0.070    0.158    0.874    0.011    0.144
##  .Q4_5 ~~                                                               
##    .Q4_6              0.036    0.067    0.532    0.594    0.036    0.343
##  .Q4_7 ~~                                                               
##    .Q4_8              0.002    0.070    0.029    0.977    0.002    0.014
##  .Q2_8 ~~                                                               
##    .Q2_9              0.123    0.065    1.892    0.059    0.123    0.509
##   CSE ~~                                                                
##     Important_Mddl   -0.572    0.021  -27.764    0.000   -0.572   -0.626
##     Important_High   -0.286    0.017  -16.612    0.000   -0.286   -0.554
##     Sex_Pos           2.506    0.113   22.110    0.000    2.506    0.310
##     Sex_Neg          -0.426    0.049   -8.661    0.000   -0.426   -0.109
##     PolAff            0.745    0.027   28.003    0.000    0.745    0.439
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .Q2_1              0.182    0.116    1.572    0.116    0.182    0.273
##    .Q2_2              0.540    0.120    4.510    0.000    0.540    0.631
##    .Q2_3              0.102    0.063    1.632    0.103    0.102    0.260
##    .Q2_4              0.167    0.081    2.067    0.039    0.167    0.290
##    .Q2_5              0.188    0.085    2.207    0.027    0.188    0.337
##    .Q2_6              0.171    0.084    2.030    0.042    0.171    0.389
##    .Q2_7              0.124    0.086    1.433    0.152    0.124    0.315
##    .Q2_8              0.234    0.073    3.185    0.001    0.234    0.472
##    .Q2_9              0.249    0.066    3.799    0.000    0.249    0.579
##    .Q3_1              0.074    0.073    1.011    0.312    0.074    0.169
##    .Q3_2              0.094    0.074    1.280    0.201    0.094    0.225
##    .Q3_3              0.076    0.066    1.155    0.248    0.076    0.215
##    .Q3_4              0.073    0.074    0.985    0.324    0.073    0.170
##    .Q3_5              0.099    0.069    1.427    0.153    0.099    0.263
##    .Q3_6              0.144    0.057    2.533    0.011    0.144    0.464
##    .Q3_7              0.247    0.116    2.134    0.033    0.247    0.345
##    .Q3_8              0.633    0.172    3.675    0.000    0.633    0.518
##    .Q3_9              0.903    0.176    5.123    0.000    0.903    0.558
##    .Q3_10             0.245    0.088    2.793    0.005    0.245    0.436
##    .Q4_1              0.068    0.077    0.887    0.375    0.068    0.158
##    .Q4_2              0.206    0.080    2.573    0.010    0.206    0.376
##    .Q4_3              0.056    0.074    0.763    0.446    0.056    0.155
##    .Q4_4              0.069    0.072    0.959    0.337    0.069    0.201
##    .Q4_5              0.125    0.069    1.808    0.071    0.125    0.344
##    .Q4_6              0.086    0.079    1.088    0.277    0.086    0.193
##    .Q4_7              0.177    0.101    1.751    0.080    0.177    0.273
##    .Q4_8              0.118    0.071    1.679    0.093    0.118    0.378
##    .Q4_9              0.789    0.113    6.990    0.000    0.789    0.856
##    .Q4_10             0.112    0.073    1.534    0.125    0.112    0.265
##    .Q5_1              0.160    0.072    2.223    0.026    0.160    0.311
##    .Q5_2              0.207    0.073    2.832    0.005    0.207    0.458
##    .Q5_4              0.091    0.068    1.344    0.179    0.091    0.281
##    .Q5_5              0.156    0.052    3.000    0.003    0.156    0.451
##    .Q5_6              0.116    0.064    1.824    0.068    0.116    0.329
##    .Q5_7              0.092    0.066    1.387    0.165    0.092    0.262
##    .Q5_8              0.574    0.117    4.907    0.000    0.574    0.790
##    .Q5_9              0.083    0.055    1.524    0.128    0.083    0.284
##    .Q5_10             0.295    0.071    4.162    0.000    0.295    0.577
##    .Q5_11             0.075    0.073    1.029    0.303    0.075    0.213
##    .Vote1             0.035    0.015    2.308    0.021    0.035    0.504
##     Important_Mddl    0.837    0.116    7.232    0.000    0.837    1.000
##     Important_High    0.267    0.101    2.630    0.009    0.267    1.000
##     Sex_Pos          65.394    7.884    8.294    0.000   65.394    1.000
##     Sex_Neg          15.241    6.162    2.473    0.013   15.241    1.000
##     PolAff            2.879    0.248   11.631    0.000    2.879    1.000
##     CSE               1.000                               1.000    1.000