MMPI scales vs. g
#predict income
list(
ols(income ~ g, data = d),
ols(as.formula(str_glue("income ~ {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
ols(as.formula(str_glue("income ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d)
) %>%
summarize_models()
#education
list(
ols(education ~ g, data = d),
ols(as.formula(str_glue("education ~ {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
ols(as.formula(str_glue("education ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d)
) %>%
summarize_models()
#occupational status
# list(
# ols(occu_status ~ g, data = d),
# ols(as.formula(str_glue("occu_status ~ {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
# ols(as.formula(str_glue("occu_status ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d)
# ) %>%
# summarize_models()
#unemployment
list(
ols(unemployment ~ g, data = d),
ols(as.formula(str_glue("unemployment ~ {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
ols(as.formula(str_glue("unemployment ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d)
) %>%
summarize_models()
#military rank
list(
ols(military_rank ~ g, data = d),
ols(as.formula(str_glue("military_rank ~ {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
ols(as.formula(str_glue("military_rank ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d)
) %>%
summarize_models()
#discharge status
list(
lrm(discharge_ok ~ g, data = d),
lrm(as.formula(str_glue("discharge_ok ~ {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
lrm(as.formula(str_glue("discharge_ok ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d)
)
## [[1]]
## Logistic Regression Model
##
## lrm(formula = discharge_ok ~ g, data = d)
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4462 LR chi2 39.50 R2 0.052 C 0.701
## FALSE 84 d.f. 1 R2(1,4462)0.009 Dxy 0.402
## TRUE 4378 Pr(> chi2) <0.0001 R2(1,247.3)0.144 gamma 0.404
## max |deriv| 2e-14 Brier 0.018 tau-a 0.015
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 4.3110 0.1461 29.51 <0.0001
## g 0.6463 0.1051 6.15 <0.0001
##
##
## [[2]]
## Logistic Regression Model
##
## lrm(formula = as.formula(str_glue("discharge_ok ~ {str_c(MMPI_vars, collapse = ' + ')}")),
## data = d)
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4462 LR chi2 54.38 R2 0.071 C 0.725
## FALSE 84 d.f. 14 R2(14,4462)0.009 Dxy 0.450
## TRUE 4378 Pr(> chi2) <0.0001 R2(14,247.3)0.151 gamma 0.451
## max |deriv| 4e-09 Brier 0.018 tau-a 0.017
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 4.3651 0.1501 29.08 <0.0001
## MMPI_L -0.2666 0.1183 -2.25 0.0242
## MMPI_F -0.1077 0.1749 -0.62 0.5380
## MMPI_K 0.4514 0.2142 2.11 0.0351
## MMPI_HS -0.1093 0.1900 -0.58 0.5650
## MMPI_D -0.0742 0.1933 -0.38 0.7012
## MMPI_HY 0.2758 0.1929 1.43 0.1529
## MMPI_PD -0.5328 0.1501 -3.55 0.0004
## MMPI_MF 0.2218 0.1246 1.78 0.0750
## MMPI_PA 0.2514 0.1474 1.71 0.0881
## MMPI_PT 0.0411 0.2288 0.18 0.8576
## MMPI_SC 0.0319 0.2457 0.13 0.8966
## MMPI_MA -0.2854 0.1540 -1.85 0.0639
## MMPI_SI 0.1497 0.1986 0.75 0.4510
## MMPI_ES 0.0391 0.1859 0.21 0.8335
##
##
## [[3]]
## Logistic Regression Model
##
## lrm(formula = as.formula(str_glue("discharge_ok ~ g + {str_c(MMPI_vars, collapse = ' + ')}")),
## data = d)
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4462 LR chi2 71.15 R2 0.093 C 0.756
## FALSE 84 d.f. 15 R2(15,4462)0.013 Dxy 0.511
## TRUE 4378 Pr(> chi2) <0.0001 R2(15,247.3)0.203 gamma 0.513
## max |deriv| 3e-08 Brier 0.018 tau-a 0.019
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 4.5296 0.1655 27.36 <0.0001
## g 0.5596 0.1391 4.02 <0.0001
## MMPI_L -0.0985 0.1256 -0.78 0.4330
## MMPI_F -0.1043 0.1753 -0.60 0.5517
## MMPI_K 0.3838 0.2172 1.77 0.0772
## MMPI_HS -0.0687 0.1911 -0.36 0.7190
## MMPI_D 0.0001 0.1939 0.00 0.9995
## MMPI_HY 0.1524 0.1961 0.78 0.4372
## MMPI_PD -0.5377 0.1521 -3.53 0.0004
## MMPI_MF 0.0301 0.1334 0.23 0.8216
## MMPI_PA 0.1999 0.1479 1.35 0.1767
## MMPI_PT 0.0502 0.2284 0.22 0.8260
## MMPI_SC 0.0693 0.2474 0.28 0.7793
## MMPI_MA -0.2432 0.1531 -1.59 0.1122
## MMPI_SI 0.0563 0.2013 0.28 0.7798
## MMPI_ES -0.2050 0.1951 -1.05 0.2935
##
#marrital status
list(
lrm(married ~ g, data = d),
lrm(as.formula(str_glue("married ~ {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
lrm(as.formula(str_glue("married ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d)
)
## [[1]]
## Frequencies of Missing Values Due to Each Variable
## married g
## 3 0
##
## Logistic Regression Model
##
## lrm(formula = married ~ g, data = d)
##
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4459 LR chi2 44.35 R2 0.014 C 0.561
## FALSE 1184 d.f. 1 R2(1,4459)0.010 Dxy 0.123
## TRUE 3275 Pr(> chi2) <0.0001 R2(1,2608.8)0.016 gamma 0.123
## max |deriv| 4e-14 Brier 0.193 tau-a 0.048
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 1.0698 0.0354 30.20 <0.0001
## g 0.2107 0.0318 6.64 <0.0001
##
##
## [[2]]
## Frequencies of Missing Values Due to Each Variable
## married MMPI_L MMPI_F MMPI_K MMPI_HS MMPI_D MMPI_HY MMPI_PD MMPI_MF MMPI_PA
## 3 0 0 0 0 0 0 0 0 0
## MMPI_PT MMPI_SC MMPI_MA MMPI_SI MMPI_ES
## 0 0 0 0 0
##
## Logistic Regression Model
##
## lrm(formula = as.formula(str_glue("married ~ {str_c(MMPI_vars, collapse = ' + ')}")),
## data = d)
##
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4459 LR chi2 395.26 R2 0.124 C 0.689
## FALSE 1184 d.f. 14 R2(14,4459)0.082 Dxy 0.378
## TRUE 3275 Pr(> chi2) <0.0001 R2(14,2608.8)0.136 gamma 0.378
## max |deriv| 1e-08 Brier 0.178 tau-a 0.147
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 1.1866 0.0384 30.89 <0.0001
## MMPI_L -0.2369 0.0392 -6.04 <0.0001
## MMPI_F -0.0276 0.0614 -0.45 0.6526
## MMPI_K 0.1014 0.0693 1.46 0.1437
## MMPI_HS 0.0583 0.0629 0.93 0.3544
## MMPI_D -0.4114 0.0641 -6.42 <0.0001
## MMPI_HY 0.3516 0.0636 5.53 <0.0001
## MMPI_PD -0.3288 0.0504 -6.53 <0.0001
## MMPI_MF -0.2990 0.0394 -7.58 <0.0001
## MMPI_PA 0.0148 0.0488 0.30 0.7622
## MMPI_PT 0.2143 0.0760 2.82 0.0048
## MMPI_SC -0.2545 0.0826 -3.08 0.0021
## MMPI_MA -0.1484 0.0506 -2.93 0.0034
## MMPI_SI 0.3610 0.0645 5.60 <0.0001
## MMPI_ES 0.0624 0.0611 1.02 0.3070
##
##
## [[3]]
## Frequencies of Missing Values Due to Each Variable
## married g MMPI_L MMPI_F MMPI_K MMPI_HS MMPI_D MMPI_HY MMPI_PD MMPI_MF
## 3 0 0 0 0 0 0 0 0 0
## MMPI_PA MMPI_PT MMPI_SC MMPI_MA MMPI_SI MMPI_ES
## 0 0 0 0 0 0
##
## Logistic Regression Model
##
## lrm(formula = as.formula(str_glue("married ~ g + {str_c(MMPI_vars, collapse = ' + ')}")),
## data = d)
##
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4459 LR chi2 421.30 R2 0.131 C 0.696
## FALSE 1184 d.f. 15 R2(15,4459)0.087 Dxy 0.392
## TRUE 3275 Pr(> chi2) <0.0001 R2(15,2608.8)0.144 gamma 0.392
## max |deriv| 2e-08 Brier 0.177 tau-a 0.153
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 1.2162 0.0392 31.02 <0.0001
## g 0.2171 0.0427 5.08 <0.0001
## MMPI_L -0.1730 0.0412 -4.20 <0.0001
## MMPI_F -0.0314 0.0616 -0.51 0.6108
## MMPI_K 0.0637 0.0699 0.91 0.3622
## MMPI_HS 0.0836 0.0633 1.32 0.1869
## MMPI_D -0.3929 0.0643 -6.11 <0.0001
## MMPI_HY 0.3077 0.0643 4.78 <0.0001
## MMPI_PD -0.3242 0.0505 -6.41 <0.0001
## MMPI_MF -0.3707 0.0421 -8.81 <0.0001
## MMPI_PA -0.0131 0.0492 -0.27 0.7908
## MMPI_PT 0.2209 0.0761 2.90 0.0037
## MMPI_SC -0.2400 0.0828 -2.90 0.0037
## MMPI_MA -0.1336 0.0507 -2.63 0.0084
## MMPI_SI 0.3282 0.0650 5.05 <0.0001
## MMPI_ES -0.0297 0.0639 -0.47 0.6415
##
#omega comparisons
groups1 = list(g = "g", MMPI = MMPI_vars)
compare_total_effects(
lm(as.formula(str_glue("income ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
groups1
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ----------------------------------------------------------------------------------------------------------------------------------------------
## g | 255.817 | 255.817 | 1 | 305.486 | < .001 | 0.064 | 0.065 | 0.063 | 0.065 | 0.063 | 0.265 | 1.000
## MMPI_L | 16.898 | 16.898 | 1 | 20.179 | < .001 | 0.004 | 0.005 | 0.004 | 0.004 | 0.004 | 0.068 | 0.994
## MMPI_F | 2.796 | 2.796 | 1 | 3.339 | 0.068 | 0.001 | 0.001 | 0.000 | 0.001 | 0.000 | 0.028 | 0.447
## MMPI_K | 4.566 | 4.566 | 1 | 5.452 | 0.020 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.035 | 0.646
## MMPI_HS | 1.330 | 1.330 | 1 | 1.588 | 0.208 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.019 | 0.243
## MMPI_D | 0.169 | 0.169 | 1 | 0.201 | 0.654 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.007 | 0.073
## MMPI_HY | 5.970 | 5.970 | 1 | 7.129 | 0.008 | 0.001 | 0.002 | 0.001 | 0.001 | 0.001 | 0.040 | 0.761
## MMPI_PD | 56.599 | 56.599 | 1 | 67.589 | < .001 | 0.014 | 0.015 | 0.014 | 0.015 | 0.014 | 0.125 | 1.000
## MMPI_MF | 1.091 | 1.091 | 1 | 1.303 | 0.254 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.017 | 0.208
## MMPI_PA | 2.143 | 2.143 | 1 | 2.559 | 0.110 | 0.001 | 0.001 | 0.000 | 0.000 | 0.000 | 0.024 | 0.359
## MMPI_PT | 3.901 | 3.901 | 1 | 4.658 | 0.031 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.033 | 0.579
## MMPI_SC | 1.586 | 1.586 | 1 | 1.894 | 0.169 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.021 | 0.280
## MMPI_MA | 3.857 | 3.857 | 1 | 4.606 | 0.032 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.033 | 0.574
## MMPI_SI | 0.034 | 0.034 | 1 | 0.040 | 0.841 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.003 | 0.055
## MMPI_ES | 16.158 | 16.158 | 1 | 19.296 | < .001 | 0.004 | 0.004 | 0.004 | 0.004 | 0.004 | 0.067 | 0.993
## Residuals | 3651.117 | 0.837 | 4360 | | | | | | | | |
##
## $sums
## # A tibble: 2 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.063 0.251
## 2 MMPI 0.026 0.161
compare_total_effects(
lm(as.formula(str_glue("education ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
groups1
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ----------------------------------------------------------------------------------------------------------------------------------------------
## g | 567.508 | 567.508 | 1 | 902.796 | < .001 | 0.161 | 0.169 | 0.160 | 0.168 | 0.161 | 0.451 | 1.000
## MMPI_L | 0.513 | 0.513 | 1 | 0.816 | 0.366 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.014 | 0.147
## MMPI_F | 3.410 | 3.410 | 1 | 5.425 | 0.020 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.035 | 0.644
## MMPI_K | 20.984 | 20.984 | 1 | 33.382 | < .001 | 0.006 | 0.007 | 0.006 | 0.007 | 0.006 | 0.087 | 1.000
## MMPI_HS | 4.108 | 4.108 | 1 | 6.535 | 0.011 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.038 | 0.725
## MMPI_D | 5.962 | 5.962 | 1 | 9.484 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.046 | 0.869
## MMPI_HY | 1.522 | 1.522 | 1 | 2.422 | 0.120 | 0.000 | 0.001 | 0.000 | 0.000 | 0.000 | 0.023 | 0.343
## MMPI_PD | 38.312 | 38.312 | 1 | 60.946 | < .001 | 0.011 | 0.014 | 0.011 | 0.013 | 0.011 | 0.117 | 1.000
## MMPI_MF | 53.998 | 53.998 | 1 | 85.900 | < .001 | 0.015 | 0.019 | 0.015 | 0.019 | 0.015 | 0.139 | 1.000
## MMPI_PA | 5.786 | 5.786 | 1 | 9.205 | 0.002 | 0.002 | 0.002 | 0.001 | 0.002 | 0.001 | 0.046 | 0.859
## MMPI_PT | 2.958 | 2.958 | 1 | 4.705 | 0.030 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.033 | 0.583
## MMPI_SC | 10.214 | 10.214 | 1 | 16.248 | < .001 | 0.003 | 0.004 | 0.003 | 0.003 | 0.003 | 0.060 | 0.981
## MMPI_MA | 8.259 | 8.259 | 1 | 13.138 | < .001 | 0.002 | 0.003 | 0.002 | 0.003 | 0.002 | 0.054 | 0.952
## MMPI_SI | 13.249 | 13.249 | 1 | 21.077 | < .001 | 0.004 | 0.005 | 0.004 | 0.004 | 0.004 | 0.069 | 0.996
## MMPI_ES | 1.283 | 1.283 | 1 | 2.041 | 0.153 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.021 | 0.298
## Residuals | 2793.549 | 0.629 | 4444 | | | | | | | | |
##
## $sums
## # A tibble: 2 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.16 0.4
## 2 MMPI 0.047 0.217
compare_total_effects(
lm(as.formula(str_glue("unemployment ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
groups1
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ---------------------------------------------------------------------------------------------------------------------------------------------
## g | 43.907 | 43.907 | 1 | 41.322 | < .001 | 0.009 | 0.009 | 0.009 | 0.009 | 0.009 | 0.097 | 1.000
## MMPI_L | 8.392 | 8.392 | 1 | 7.898 | 0.005 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.042 | 0.802
## MMPI_F | 19.409 | 19.409 | 1 | 18.266 | < .001 | 0.004 | 0.004 | 0.004 | 0.004 | 0.004 | 0.064 | 0.990
## MMPI_K | 4.193 | 4.193 | 1 | 3.946 | 0.047 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.030 | 0.511
## MMPI_HS | 0.773 | 0.773 | 1 | 0.727 | 0.394 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.013 | 0.137
## MMPI_D | 12.217 | 12.217 | 1 | 11.498 | 0.001 | 0.003 | 0.003 | 0.002 | 0.002 | 0.002 | 0.051 | 0.924
## MMPI_HY | 0.448 | 0.448 | 1 | 0.422 | 0.516 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.010 | 0.100
## MMPI_PD | 33.274 | 33.274 | 1 | 31.315 | < .001 | 0.007 | 0.007 | 0.007 | 0.007 | 0.007 | 0.084 | 1.000
## MMPI_MF | 0.099 | 0.099 | 1 | 0.093 | 0.761 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.005 | 0.061
## MMPI_PA | 0.298 | 0.298 | 1 | 0.280 | 0.597 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.008 | 0.083
## MMPI_PT | 14.259 | 14.259 | 1 | 13.420 | < .001 | 0.003 | 0.003 | 0.003 | 0.003 | 0.003 | 0.055 | 0.956
## MMPI_SC | 8.188 | 8.188 | 1 | 7.706 | 0.006 | 0.002 | 0.002 | 0.001 | 0.002 | 0.001 | 0.042 | 0.793
## MMPI_MA | 1.707 | 1.707 | 1 | 1.607 | 0.205 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.019 | 0.245
## MMPI_SI | 10.342 | 10.342 | 1 | 9.734 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.047 | 0.877
## MMPI_ES | 7.930 | 7.930 | 1 | 7.463 | 0.006 | 0.002 | 0.002 | 0.001 | 0.001 | 0.001 | 0.041 | 0.780
## Residuals | 4708.191 | 1.063 | 4431 | | | | | | | | |
##
## $sums
## # A tibble: 2 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.009 0.0949
## 2 MMPI 0.023 0.152
compare_total_effects(
lm(as.formula(str_glue("military_rank ~ g + {str_c(MMPI_vars, collapse = ' + ')}")), data = d),
groups1
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ----------------------------------------------------------------------------------------------------------------------------------------------
## g | 159.978 | 159.978 | 1 | 155.954 | < .001 | 0.033 | 0.034 | 0.033 | 0.034 | 0.033 | 0.187 | 1.000
## MMPI_L | 9.115 | 9.115 | 1 | 8.886 | 0.003 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.045 | 0.846
## MMPI_F | 8.319 | 8.319 | 1 | 8.110 | 0.004 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.043 | 0.813
## MMPI_K | 8.287 | 8.287 | 1 | 8.078 | 0.005 | 0.002 | 0.002 | 0.001 | 0.002 | 0.001 | 0.043 | 0.811
## MMPI_HS | 1.059 | 1.059 | 1 | 1.032 | 0.310 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.015 | 0.174
## MMPI_D | 0.107 | 0.107 | 1 | 0.105 | 0.746 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.005 | 0.062
## MMPI_HY | 9.021 | 9.021 | 1 | 8.794 | 0.003 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.044 | 0.843
## MMPI_PD | 79.707 | 79.707 | 1 | 77.702 | < .001 | 0.016 | 0.017 | 0.016 | 0.017 | 0.016 | 0.132 | 1.000
## MMPI_MF | 2.147 | 2.147 | 1 | 2.093 | 0.148 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.022 | 0.304
## MMPI_PA | 2.869 | 2.869 | 1 | 2.796 | 0.095 | 0.001 | 0.001 | 0.000 | 0.000 | 0.000 | 0.025 | 0.387
## MMPI_PT | 0.672 | 0.672 | 1 | 0.655 | 0.418 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.012 | 0.128
## MMPI_SC | 0.002 | 0.002 | 1 | 0.002 | 0.967 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.001 | 0.050
## MMPI_MA | 1.680 | 1.680 | 1 | 1.638 | 0.201 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.019 | 0.249
## MMPI_SI | 2.614 | 2.614 | 1 | 2.548 | 0.110 | 0.001 | 0.001 | 0.000 | 0.000 | 0.000 | 0.024 | 0.358
## MMPI_ES | 0.077 | 0.077 | 1 | 0.075 | 0.784 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.004 | 0.059
## Residuals | 4560.725 | 1.026 | 4446 | | | | | | | | |
##
## $sums
## # A tibble: 2 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.033 0.182
## 2 MMPI 0.023 0.152
#control for race and age
groups2 = list(g = "g", MMPI = MMPI_vars, age_race = c("age", "race"))
compare_total_effects(
lm(as.formula(str_glue("income ~ g + {str_c(MMPI_vars, collapse = ' + ')} + age + race")), data = d),
groups2
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ----------------------------------------------------------------------------------------------------------------------------------------------
## g | 210.325 | 210.325 | 1 | 256.456 | < .001 | 0.053 | 0.056 | 0.053 | 0.055 | 0.053 | 0.243 | 1.000
## MMPI_L | 13.489 | 13.489 | 1 | 16.448 | < .001 | 0.003 | 0.004 | 0.003 | 0.004 | 0.003 | 0.061 | 0.982
## MMPI_F | 2.039 | 2.039 | 1 | 2.486 | 0.115 | 0.001 | 0.001 | 0.000 | 0.000 | 0.000 | 0.024 | 0.351
## MMPI_K | 2.738 | 2.738 | 1 | 3.339 | 0.068 | 0.001 | 0.001 | 0.000 | 0.001 | 0.000 | 0.028 | 0.447
## MMPI_HS | 1.380 | 1.380 | 1 | 1.683 | 0.195 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.020 | 0.254
## MMPI_D | 0.399 | 0.399 | 1 | 0.486 | 0.486 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.011 | 0.107
## MMPI_HY | 4.336 | 4.336 | 1 | 5.287 | 0.022 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.035 | 0.633
## MMPI_PD | 43.811 | 43.811 | 1 | 53.420 | < .001 | 0.011 | 0.012 | 0.011 | 0.012 | 0.011 | 0.111 | 1.000
## MMPI_MF | 1.123 | 1.123 | 1 | 1.370 | 0.242 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.018 | 0.216
## MMPI_PA | 1.249 | 1.249 | 1 | 1.523 | 0.217 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.019 | 0.235
## MMPI_PT | 4.802 | 4.802 | 1 | 5.855 | 0.016 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.037 | 0.677
## MMPI_SC | 1.256 | 1.256 | 1 | 1.532 | 0.216 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.019 | 0.236
## MMPI_MA | 5.066 | 5.066 | 1 | 6.178 | 0.013 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.038 | 0.700
## MMPI_SI | 0.026 | 0.026 | 1 | 0.032 | 0.859 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.003 | 0.054
## MMPI_ES | 16.996 | 16.996 | 1 | 20.724 | < .001 | 0.004 | 0.005 | 0.004 | 0.004 | 0.004 | 0.069 | 0.995
## age | 73.667 | 73.667 | 1 | 89.825 | < .001 | 0.019 | 0.020 | 0.018 | 0.020 | 0.018 | 0.144 | 1.000
## race | 6.621 | 1.655 | 4 | 2.018 | 0.089 | 0.002 | 0.002 | 0.001 | 0.001 | 0.001 | 0.043 | 0.609
## Residuals | 3571.637 | 0.820 | 4355 | | | | | | | | |
##
## $sums
## # A tibble: 3 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.053 0.230
## 2 MMPI 0.021 0.145
## 3 age_race 0.019 0.138
compare_total_effects(
lm(as.formula(str_glue("education ~ g + {str_c(MMPI_vars, collapse = ' + ')} + age + race")), data = d),
groups2
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ----------------------------------------------------------------------------------------------------------------------------------------------
## g | 638.306 | 638.306 | 1 | 1072.575 | < .001 | 0.180 | 0.195 | 0.180 | 0.194 | 0.180 | 0.492 | 1.000
## MMPI_L | 1.001 | 1.001 | 1 | 1.681 | 0.195 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.019 | 0.254
## MMPI_F | 1.422 | 1.422 | 1 | 2.389 | 0.122 | 0.000 | 0.001 | 0.000 | 0.000 | 0.000 | 0.023 | 0.340
## MMPI_K | 12.638 | 12.638 | 1 | 21.236 | < .001 | 0.004 | 0.005 | 0.003 | 0.005 | 0.003 | 0.069 | 0.996
## MMPI_HS | 4.197 | 4.197 | 1 | 7.053 | 0.008 | 0.001 | 0.002 | 0.001 | 0.001 | 0.001 | 0.040 | 0.757
## MMPI_D | 2.705 | 2.705 | 1 | 4.546 | 0.033 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.032 | 0.568
## MMPI_HY | 0.250 | 0.250 | 1 | 0.420 | 0.517 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.010 | 0.099
## MMPI_PD | 28.413 | 28.413 | 1 | 47.744 | < .001 | 0.008 | 0.011 | 0.008 | 0.010 | 0.008 | 0.104 | 1.000
## MMPI_MF | 42.522 | 42.522 | 1 | 71.451 | < .001 | 0.012 | 0.016 | 0.012 | 0.016 | 0.012 | 0.127 | 1.000
## MMPI_PA | 5.876 | 5.876 | 1 | 9.874 | 0.002 | 0.002 | 0.002 | 0.001 | 0.002 | 0.001 | 0.047 | 0.881
## MMPI_PT | 0.429 | 0.429 | 1 | 0.721 | 0.396 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.013 | 0.136
## MMPI_SC | 5.958 | 5.958 | 1 | 10.012 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.047 | 0.886
## MMPI_MA | 3.301 | 3.301 | 1 | 5.547 | 0.019 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.035 | 0.654
## MMPI_SI | 10.856 | 10.856 | 1 | 18.242 | < .001 | 0.003 | 0.004 | 0.003 | 0.004 | 0.003 | 0.064 | 0.990
## MMPI_ES | 0.001 | 0.001 | 1 | 0.001 | 0.973 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.001 | 0.050
## age | 48.973 | 48.973 | 1 | 82.292 | < .001 | 0.014 | 0.018 | 0.014 | 0.018 | 0.014 | 0.136 | 1.000
## race | 96.416 | 24.104 | 4 | 40.503 | < .001 | 0.027 | 0.035 | 0.027 | 0.034 | 0.027 | 0.191 | 1.000
## Residuals | 2641.717 | 0.595 | 4439 | | | | | | | | |
##
## $sums
## # A tibble: 3 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.18 0.424
## 2 MMPI 0.032 0.179
## 3 age_race 0.041 0.202
compare_total_effects(
lm(as.formula(str_glue("unemployment ~ g + {str_c(MMPI_vars, collapse = ' + ')} + age + race")), data = d),
groups2
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ---------------------------------------------------------------------------------------------------------------------------------------------
## g | 20.962 | 20.962 | 1 | 19.943 | < .001 | 0.004 | 0.004 | 0.004 | 0.004 | 0.004 | 0.067 | 0.994
## MMPI_L | 7.377 | 7.377 | 1 | 7.018 | 0.008 | 0.002 | 0.002 | 0.001 | 0.001 | 0.001 | 0.040 | 0.755
## MMPI_F | 21.525 | 21.525 | 1 | 20.479 | < .001 | 0.004 | 0.005 | 0.004 | 0.004 | 0.004 | 0.068 | 0.995
## MMPI_K | 4.074 | 4.074 | 1 | 3.876 | 0.049 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.030 | 0.504
## MMPI_HS | 0.688 | 0.688 | 1 | 0.654 | 0.419 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.012 | 0.128
## MMPI_D | 12.279 | 12.279 | 1 | 11.682 | 0.001 | 0.003 | 0.003 | 0.002 | 0.002 | 0.002 | 0.051 | 0.928
## MMPI_HY | 1.598 | 1.598 | 1 | 1.520 | 0.218 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.019 | 0.234
## MMPI_PD | 25.135 | 25.135 | 1 | 23.914 | < .001 | 0.005 | 0.005 | 0.005 | 0.005 | 0.005 | 0.074 | 0.998
## MMPI_MF | 0.722 | 0.722 | 1 | 0.686 | 0.407 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.012 | 0.132
## MMPI_PA | 0.028 | 0.028 | 1 | 0.026 | 0.871 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.002 | 0.053
## MMPI_PT | 13.309 | 13.309 | 1 | 12.662 | < .001 | 0.003 | 0.003 | 0.003 | 0.003 | 0.003 | 0.053 | 0.945
## MMPI_SC | 6.925 | 6.925 | 1 | 6.588 | 0.010 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.039 | 0.728
## MMPI_MA | 0.311 | 0.311 | 1 | 0.296 | 0.586 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.008 | 0.085
## MMPI_SI | 8.552 | 8.552 | 1 | 8.137 | 0.004 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 | 0.043 | 0.814
## MMPI_ES | 6.460 | 6.460 | 1 | 6.146 | 0.013 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.037 | 0.698
## age | 18.943 | 18.943 | 1 | 18.023 | < .001 | 0.004 | 0.004 | 0.004 | 0.004 | 0.004 | 0.064 | 0.989
## race | 38.327 | 9.582 | 4 | 9.116 | < .001 | 0.008 | 0.008 | 0.007 | 0.007 | 0.007 | 0.091 | 1.000
## Residuals | 4652.076 | 1.051 | 4426 | | | | | | | | |
##
## $sums
## # A tibble: 3 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.004 0.0632
## 2 MMPI 0.02 0.141
## 3 age_race 0.011 0.105
compare_total_effects(
lm(as.formula(str_glue("military_rank ~ g + {str_c(MMPI_vars, collapse = ' + ')} + age + race")), data = d),
groups2
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ----------------------------------------------------------------------------------------------------------------------------------------------
## g | 101.845 | 101.845 | 1 | 105.113 | < .001 | 0.021 | 0.023 | 0.021 | 0.023 | 0.021 | 0.154 | 1.000
## MMPI_L | 5.489 | 5.489 | 1 | 5.665 | 0.017 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.036 | 0.663
## MMPI_F | 7.621 | 7.621 | 1 | 7.866 | 0.005 | 0.002 | 0.002 | 0.001 | 0.002 | 0.001 | 0.042 | 0.801
## MMPI_K | 4.647 | 4.647 | 1 | 4.796 | 0.029 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.033 | 0.591
## MMPI_HS | 0.812 | 0.812 | 1 | 0.838 | 0.360 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.014 | 0.150
## MMPI_D | 0.020 | 0.020 | 1 | 0.021 | 0.885 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.002 | 0.052
## MMPI_HY | 4.025 | 4.025 | 1 | 4.154 | 0.042 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.031 | 0.531
## MMPI_PD | 51.963 | 51.963 | 1 | 53.631 | < .001 | 0.011 | 0.012 | 0.011 | 0.012 | 0.011 | 0.110 | 1.000
## MMPI_MF | 1.120 | 1.120 | 1 | 1.156 | 0.282 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.016 | 0.189
## MMPI_PA | 1.061 | 1.061 | 1 | 1.095 | 0.295 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.016 | 0.182
## MMPI_PT | 1.287 | 1.287 | 1 | 1.328 | 0.249 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.017 | 0.211
## MMPI_SC | 0.070 | 0.070 | 1 | 0.073 | 0.787 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.004 | 0.058
## MMPI_MA | 0.106 | 0.106 | 1 | 0.109 | 0.741 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.005 | 0.063
## MMPI_SI | 0.939 | 0.939 | 1 | 0.969 | 0.325 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.015 | 0.166
## MMPI_ES | 0.072 | 0.072 | 1 | 0.075 | 0.785 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.004 | 0.059
## age | 216.309 | 216.309 | 1 | 223.250 | < .001 | 0.046 | 0.048 | 0.045 | 0.047 | 0.045 | 0.224 | 1.000
## race | 44.513 | 11.128 | 4 | 11.485 | < .001 | 0.009 | 0.010 | 0.009 | 0.009 | 0.009 | 0.102 | 1.000
## Residuals | 4302.915 | 0.969 | 4441 | | | | | | | | |
##
## $sums
## # A tibble: 3 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.021 0.145
## 2 MMPI 0.015 0.122
## 3 age_race 0.054 0.232
MMPI g vs. g
#predict income
list(
ols(income ~ g, data = d),
ols(income ~ MMPI_p, data = d),
ols(income ~ g + MMPI_p, data = d)
) %>%
summarize_models()
#education
list(
ols(education ~ g, data = d),
ols(education ~ MMPI_p, data = d),
ols(education ~ g + MMPI_p, data = d)
) %>%
summarize_models()
#occupational status
# list(
# ols(occu_status ~ g, data = d),
# ols(occu_status ~ MMPI_p, data = d),
# ols(occu_status ~ g + MMPI_p, data = d)
# ) %>%
# summarize_models()
#unemployment
list(
ols(unemployment ~ g, data = d),
ols(unemployment ~ MMPI_p, data = d),
ols(unemployment ~ g + MMPI_p, data = d)
) %>%
summarize_models()
#military rank
list(
ols(military_rank ~ g, data = d),
ols(military_rank ~ MMPI_p, data = d),
ols(military_rank ~ g + MMPI_p, data = d)
) %>%
summarize_models()
#discharge status
list(
lrm(discharge_ok ~ g, data = d),
lrm(discharge_ok ~ MMPI_p, data = d),
lrm(discharge_ok ~ g + MMPI_p, data = d)
)
## [[1]]
## Logistic Regression Model
##
## lrm(formula = discharge_ok ~ g, data = d)
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4462 LR chi2 39.50 R2 0.052 C 0.701
## FALSE 84 d.f. 1 R2(1,4462)0.009 Dxy 0.402
## TRUE 4378 Pr(> chi2) <0.0001 R2(1,247.3)0.144 gamma 0.404
## max |deriv| 2e-14 Brier 0.018 tau-a 0.015
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 4.3110 0.1461 29.51 <0.0001
## g 0.6463 0.1051 6.15 <0.0001
##
##
## [[2]]
## Logistic Regression Model
##
## lrm(formula = discharge_ok ~ MMPI_p, data = d)
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4462 LR chi2 16.80 R2 0.022 C 0.642
## FALSE 84 d.f. 1 R2(1,4462)0.004 Dxy 0.284
## TRUE 4378 Pr(> chi2) <0.0001 R2(1,247.3)0.062 gamma 0.286
## max |deriv| 4e-09 Brier 0.018 tau-a 0.010
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 4.0841 0.1238 32.99 <0.0001
## MMPI_p -0.4552 0.1119 -4.07 <0.0001
##
##
## [[3]]
## Logistic Regression Model
##
## lrm(formula = discharge_ok ~ g + MMPI_p, data = d)
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4462 LR chi2 43.48 R2 0.057 C 0.712
## FALSE 84 d.f. 2 R2(2,4462)0.009 Dxy 0.424
## TRUE 4378 Pr(> chi2) <0.0001 R2(2,247.3)0.154 gamma 0.426
## max |deriv| 2e-13 Brier 0.018 tau-a 0.016
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 4.3362 0.1482 29.25 <0.0001
## g 0.5682 0.1120 5.07 <0.0001
## MMPI_p -0.2384 0.1200 -1.99 0.0469
##
#marrital status
list(
lrm(married ~ g, data = d),
lrm(married ~ MMPI_p, data = d),
lrm(married ~ g + MMPI_p, data = d)
)
## [[1]]
## Frequencies of Missing Values Due to Each Variable
## married g
## 3 0
##
## Logistic Regression Model
##
## lrm(formula = married ~ g, data = d)
##
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4459 LR chi2 44.35 R2 0.014 C 0.561
## FALSE 1184 d.f. 1 R2(1,4459)0.010 Dxy 0.123
## TRUE 3275 Pr(> chi2) <0.0001 R2(1,2608.8)0.016 gamma 0.123
## max |deriv| 4e-14 Brier 0.193 tau-a 0.048
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 1.0698 0.0354 30.20 <0.0001
## g 0.2107 0.0318 6.64 <0.0001
##
##
## [[2]]
## Frequencies of Missing Values Due to Each Variable
## married MMPI_p
## 3 0
##
## Logistic Regression Model
##
## lrm(formula = married ~ MMPI_p, data = d)
##
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4459 LR chi2 95.30 R2 0.031 C 0.597
## FALSE 1184 d.f. 1 R2(1,4459)0.021 Dxy 0.193
## TRUE 3275 Pr(> chi2) <0.0001 R2(1,2608.8)0.036 gamma 0.193
## max |deriv| 2e-13 Brier 0.191 tau-a 0.075
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 1.0667 0.0351 30.35 <0.0001
## MMPI_p -0.3361 0.0350 -9.59 <0.0001
##
##
## [[3]]
## Frequencies of Missing Values Due to Each Variable
## married g MMPI_p
## 3 0 0
##
## Logistic Regression Model
##
## lrm(formula = married ~ g + MMPI_p, data = d)
##
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 4459 LR chi2 107.37 R2 0.035 C 0.602
## FALSE 1184 d.f. 2 R2(2,4459)0.023 Dxy 0.204
## TRUE 3275 Pr(> chi2) <0.0001 R2(2,2608.8)0.040 gamma 0.204
## max |deriv| 3e-13 Brier 0.190 tau-a 0.080
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 1.0894 0.0360 30.28 <0.0001
## g 0.1178 0.0339 3.47 0.0005
## MMPI_p -0.2919 0.0372 -7.84 <0.0001
##
#control for race and age
groups3 = list(g = "g", MMPI = "MMPI_p", age_race = c("age", "race"))
compare_total_effects(
lm(as.formula(str_glue("income ~ g + MMPI_p + age + race")), data = d),
groups3
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ----------------------------------------------------------------------------------------------------------------------------------------------
## g | 354.070 | 354.070 | 1 | 420.604 | < .001 | 0.084 | 0.088 | 0.084 | 0.087 | 0.084 | 0.310 | 1.000
## MMPI_p | 95.433 | 95.433 | 1 | 113.367 | < .001 | 0.023 | 0.025 | 0.022 | 0.025 | 0.022 | 0.161 | 1.000
## age | 83.352 | 83.352 | 1 | 99.015 | < .001 | 0.020 | 0.022 | 0.020 | 0.022 | 0.020 | 0.151 | 1.000
## race | 9.299 | 2.325 | 4 | 2.762 | 0.026 | 0.002 | 0.003 | 0.001 | 0.002 | 0.001 | 0.050 | 0.764
## Residuals | 3677.038 | 0.842 | 4368 | | | | | | | | |
##
## $sums
## # A tibble: 3 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.084 0.290
## 2 MMPI 0.022 0.148
## 3 age_race 0.021 0.145
compare_total_effects(
lm(as.formula(str_glue("education ~ g + MMPI_p + age + race")), data = d),
groups3
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## -----------------------------------------------------------------------------------------------------------------------------------------------
## g | 1102.071 | 1102.071 | 1 | 1772.141 | < .001 | 0.269 | 0.285 | 0.269 | 0.284 | 0.269 | 0.631 | 1
## MMPI_p | 27.874 | 27.874 | 1 | 44.822 | < .001 | 0.007 | 0.010 | 0.007 | 0.010 | 0.007 | 0.100 | 1
## age | 49.151 | 49.151 | 1 | 79.036 | < .001 | 0.012 | 0.017 | 0.012 | 0.017 | 0.012 | 0.133 | 1
## race | 148.644 | 37.161 | 4 | 59.755 | < .001 | 0.036 | 0.051 | 0.036 | 0.050 | 0.036 | 0.232 | 1
## Residuals | 2768.639 | 0.622 | 4452 | | | | | | | | |
##
## $sums
## # A tibble: 3 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.269 0.519
## 2 MMPI 0.007 0.0837
## 3 age_race 0.048 0.219
compare_total_effects(
lm(as.formula(str_glue("unemployment ~ g + MMPI_p + age + race")), data = d),
groups3
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ----------------------------------------------------------------------------------------------------------------------------------------------
## g | 53.008 | 53.008 | 1 | 47.428 | < .001 | 0.010 | 0.011 | 0.010 | 0.010 | 0.010 | 0.103 | 1.000
## MMPI_p | 160.674 | 160.674 | 1 | 143.759 | < .001 | 0.031 | 0.031 | 0.030 | 0.031 | 0.030 | 0.180 | 1.000
## age | 30.577 | 30.577 | 1 | 27.358 | < .001 | 0.006 | 0.006 | 0.006 | 0.006 | 0.006 | 0.079 | 0.999
## race | 48.542 | 12.136 | 4 | 10.858 | < .001 | 0.009 | 0.010 | 0.008 | 0.009 | 0.008 | 0.099 | 1.000
## Residuals | 4961.305 | 1.118 | 4439 | | | | | | | | |
##
## $sums
## # A tibble: 3 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.01 0.1
## 2 MMPI 0.03 0.173
## 3 age_race 0.014 0.118
compare_total_effects(
lm(as.formula(str_glue("military_rank ~ g + MMPI_p + age + race")), data = d),
groups3
)
## $anova_stats
## term | sumsq | meansq | df | statistic | p.value | etasq | partial.etasq | omegasq | partial.omegasq | epsilonsq | cohens.f | power
## ----------------------------------------------------------------------------------------------------------------------------------------------
## g | 145.557 | 145.557 | 1 | 147.437 | < .001 | 0.030 | 0.032 | 0.030 | 0.032 | 0.030 | 0.182 | 1
## MMPI_p | 31.670 | 31.670 | 1 | 32.079 | < .001 | 0.006 | 0.007 | 0.006 | 0.007 | 0.006 | 0.085 | 1
## age | 260.625 | 260.625 | 1 | 263.991 | < .001 | 0.053 | 0.056 | 0.053 | 0.056 | 0.053 | 0.243 | 1
## race | 57.822 | 14.456 | 4 | 14.642 | < .001 | 0.012 | 0.013 | 0.011 | 0.012 | 0.011 | 0.115 | 1
## Residuals | 4397.205 | 0.987 | 4454 | | | | | | | | |
##
## $sums
## # A tibble: 3 × 3
## group sum_omegasq sum_omega
## <chr> <dbl> <dbl>
## 1 g 0.03 0.173
## 2 MMPI 0.006 0.0775
## 3 age_race 0.064 0.253