Data Cleaning
RPL_THEMES Erroneous values
mh_deidv3 %>%
dplyr::select(sbj_id, age_yrs, PATIENT_GENDER_CD, PATIENT_RACE_DESC, PATIENT_ETHNIC_GROUP_DESC, PATIENT_LANGUAGE_DESC, PATIENT_RELIGION_DESC, PATIENT_MARITAL_STATUS_DESC, PATIENT_STATE_CD, EDU_YEARS, TOBACCO_DESC, depression, anxiety, ptsd, bipolar, body_image, ocd, stress, seasonalAD, panic, any_psych_dx,ST_ABBR, E_TOTPOP, RPL_THEMES, RPL_THEME1, RPL_THEME2, RPL_THEME3, RPL_THEME4) -> exampledf1
exampledf1 %>%
mutate(RPL_THEMES = na_if(RPL_THEMES, "-999")) %>%
mutate(RPL_THEMES = na_if(RPL_THEMES, "0")) %>%
mutate(RPL_THEME1 = na_if(RPL_THEME1, "-999")) %>%
mutate(RPL_THEME1 = na_if(RPL_THEME1, "0")) %>%
mutate(RPL_THEME2 = na_if(RPL_THEME2, "-999")) %>%
mutate(RPL_THEME2 = na_if(RPL_THEME2, "0")) %>%
mutate(RPL_THEME3 = na_if(RPL_THEME3, "-999")) %>%
mutate(RPL_THEME3 = na_if(RPL_THEME3, "0")) %>%
mutate(RPL_THEME4 = na_if(RPL_THEME4, "-999")) %>%
mutate(RPL_THEME4 = na_if(RPL_THEME4, "0")) -> exampledf1NA
Mental health data dich
exampledf1NA %>% mutate(across(depression:any_psych_dx, ~if_else(.x>0.5, 1, 0),
.names = "{col}_2")) -> exampledf1NADi2
Marital status
exampledf1NADi2 %>%
mutate(mstat_5 = as_factor(PATIENT_MARITAL_STATUS_DESC),
mstat_5 = fct_recode(mstat_5, DivorcedSeparated = "DIVORCED",
DivorcedSeparated = "LEGALLY SEPARATED", Widow = "WIDOWED",
Married = "MARRIED", Unmarried = "SINGLE",
Unknown = "UNKNOWN", Unknown = "OTHER",
Unmarried = "SIGNIFICANT OTHER"),
mstat_5 = fct_relevel(mstat_5, ref = 'Married'))-> exampledf1NADi2MA
Religion
exampledf1NADi2MA %>%
mutate(relig_affil = as_factor(PATIENT_RELIGION_DESC),
relig_affil = fct_recode(relig_affil, Yes = "CATHOLIC",
No = "NONE",
Yes = "CHRISTIAN", Yes = "LUTHERAN",
Yes = "RUSSIAN ORTHODOX",
Yes = "PROTESTANT", Yes = "BAPTIST",
Yes = "METHODIST", Yes = "PRESBYTERIAN",
Yes = "NON-DENOMINATIONAL", Yes = "JEWISH",
Yes = "MUSLIM", Yes = "OTHER",
Yes = "EPISCOPALIAN", Yes = "PENTECOSTAL",
No = "AGNOSTIC", No = "ATHEIST",
Yes = "JEHOVAH'S WITNESS", Yes = "HINDU",
Yes = "GREEK ORTHODOX", Yes = "CHURCH OF JESUS CHRIST OF LATTER-DAY SAINTS", Yes = "BAHAI", No = "SPIRITUAL", Yes = "CHURCH OF CHRIST",
Yes = "SEVENTH DAY ADVENTIST", Yes = "APOSTOLIC", Yes = "BUDDHIST", Yes = "NAZARENE", Yes = "CONGREGATIONAL", Yes = "UNITED CHURCH OF CHR", Yes = "REFORMED", Yes = "PAGAN", Yes = "JAIN", Yes = "ASSEMBLY OF GOD", Yes = "REORG CHR OF LAT DAY", Yes = "QUAKER", Yes = "UNITARIAN UNIVERSALIST", Yes = "MENNONITE", Yes = "FREE METHODIST", Yes = "NATIVE AMER SPIRITL", Yes = "WICCAN", Yes = "ORTHODOX", Yes = "SALVATION ARMY", Yes = "DISCIPLES OF CHRIST", Yes = "AFRICAN METHODIST EP", Yes = "SIKH", Yes = "CHURCH OF GOD", Yes = "TAOIST", Yes = "ANGLICAN"),
relig_affil = fct_relevel(relig_affil, ref = 'Yes')) %>%
mutate(relig_affil = na_if(relig_affil, "UNKNOWN")) %>%
mutate(relig_affil = na_if(relig_affil, "PATIENT REFUSED")) -> exampledf1NADi2MARel
Race
exampledf1NADi2MARel %>%
mutate(race_5 = as_factor(PATIENT_RACE_DESC),
race_5 = fct_recode(race_5, Other = "OTHER",
Other = "UNKNOWN", Other = "CHOOSE NOT TO DISCLOSE",
Other = "NATIVE HAWAIIAN AND OTHER PACIFIC ISLANDER",
Other = "MIDDLE EASTERN/NORTH AFRICAN",
Asian = "ASIAN",
Asian = "ASIAN INDIAN", Asian = "OTHER ASIAN",
Asian = "JAPANESE", Asian = "KOREAN", Asian = "FILIPINO",
Asian = "CHINESE", White = "WHITE OR CAUCASIAN", Black = "BLACK OR AFRICAN AMERICAN",
Native = "AMERICAN INDIAN AND ALASKA NATIVE"),
race_5 = fct_relevel(race_5, ref = 'White')) -> exampledf1NADi2MARelRa
Gender
exampledf1NADi2MARelRa %>%
mutate(gender = as_factor(PATIENT_GENDER_CD),
gender = fct_recode(gender, Male = "M", Female = "F"),
gender = fct_relevel(gender, ref = "Male")) -> exampledf1NADi2MARelRaG
Language
exampledf1NADi2MARelRaG %>%
mutate(lang_3 = as_factor(PATIENT_LANGUAGE_DESC),
lang_3 = fct_recode(lang_3, English = "ENGLISH",
Other = "ARABIC", Other = "JAPANESE",
Other = "CHINESE, MANDARIN",
Other = "KOREAN", Other = "SIGN LANGUAGE",
Other = "RUSSIAN", Other = "SPANISH", Other = "ARMENIAN",
Other = "HINDI", Other = "BENGALI", Other = "FARSI; PERSIAN", Other = "ALBANIAN", Other = "HMONG", Other = "ROMANIAN",
Other = "PUNJABI", Other = "CROATIAN", Other = "CHALDEAN",
Other = "BURMESE", Other = "PORTUGUESE",
Other = "TAGALOG", Other = "FRENCH",
Other = "GERMAN", Other = "CHINESE, CANTONESE",
Other = "BOSNIAN", Other = "URDU", Other = "TURKISH",
Other = "UNKNOWN"),
lang_3 = fct_relevel(lang_3, ref = 'English')) -> exampledf1NADi2MARelRaGL
Ethnicity
exampledf1NADi2MARelRaGL %>%
mutate(ethnic_3 = as_factor(PATIENT_ETHNIC_GROUP_DESC),
ethnic_3 = fct_recode(ethnic_3, Hispanic = "HISPANIC",
NonHispanic = "NON-HISPANIC")) %>%
mutate(ethnic_3 = na_if(ethnic_3, "UNKNOWN")) %>%
mutate(ethnic_3 = na_if(ethnic_3, "CHOOSE NOT TO DISCLOSE")) -> exampledf1NADi2MARelRaGLEth
Tobacco
exampledf1NADi2MARelRaGLEth %>%
mutate(act_tob = as_factor(TOBACCO_DESC),
act_tob = fct_recode(act_tob, Yes = "PASSIVE",
Yes = "YES", No = "QUIT", No = "NEVER"),
act_tob = fct_relevel(act_tob, ref = 'No')) %>%
mutate(act_tob = na_if(act_tob, "NOT ASKED")) -> exampledf1NADi2MARelRaGLEthT
SVI in quartiles
exampledf1NADi2MARelRaGLEthT$RPL_4 <- cut(exampledf1NADi2MARelRaGLEthT$RPL_THEMES,
breaks=c(0.0, 0.25, 0.50, 0.75, 1.0),
labels=c('First', 'Second', 'Third', 'Fourth'))
Baseline Characteristics
Average
mh_clean1 %>%
dplyr::select(age_yrs, gender, race_5, ethnic_3, lang_3, relig_affil, mstat_5, act_tob, depression_2, anxiety_2, ptsd_2, any_psych_dx_2, RPL_THEMES, RPL_THEME1, RPL_THEME2, RPL_THEME3, RPL_THEME4, RPL_4) -> baseline
baseline %>% tbl_summary(label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status", depression_2 ~ "Depression", anxiety_2 ~ "Anxiety", any_psych_dx_2 ~ "Any Psychiatric Diagnosis", RPL_THEMES ~ "Total SVI", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", RPL_4 ~ "SVI Quartile", act_tob ~ "Active Tobacco Use"),
statistic = list(all_continuous() ~ "{mean} ({sd})"),
missing_text = "(Missing)")
| Characteristic |
N = 15,245 |
| Age |
49 (19) |
| Gender |
|
| Â Â Â Â Male |
6,973 (46%) |
| Â Â Â Â Female |
8,272 (54%) |
| Race |
|
| Â Â Â Â White |
13,230 (87%) |
| Â Â Â Â Black |
946 (6.2%) |
| Â Â Â Â Other |
638 (4.2%) |
| Â Â Â Â Asian |
375 (2.5%) |
| Â Â Â Â Native |
56 (0.4%) |
| Ethnicity |
|
| Â Â Â Â NonHispanic |
14,401 (98%) |
| Â Â Â Â UNKNOWN |
0 (0%) |
| Â Â Â Â CHOOSE NOT TO DISCLOSE |
0 (0%) |
| Â Â Â Â Hispanic |
302 (2.1%) |
| Â Â Â Â (Missing) |
542 |
| English Speaking |
|
| Â Â Â Â English |
15,081 (99%) |
| Â Â Â Â Other |
164 (1.1%) |
| Any Religious Affiliation |
|
| Â Â Â Â Yes |
8,211 (57%) |
| Â Â Â Â No |
6,085 (43%) |
| Â Â Â Â PATIENT REFUSED |
0 (0%) |
| Â Â Â Â UNKNOWN |
0 (0%) |
| Â Â Â Â (Missing) |
949 |
| Marital Status |
|
| Â Â Â Â Married |
6,198 (41%) |
| Â Â Â Â Unknown |
3,236 (21%) |
| Â Â Â Â Unmarried |
4,997 (33%) |
| Â Â Â Â DivorcedSeparated |
507 (3.3%) |
| Â Â Â Â Widow |
307 (2.0%) |
| Active Tobacco Use |
|
| Â Â Â Â No |
12,612 (87%) |
| Â Â Â Â Yes |
1,890 (13%) |
| Â Â Â Â NOT ASKED |
0 (0%) |
| Â Â Â Â (Missing) |
743 |
| Depression |
2,606 (17%) |
| Anxiety |
2,811 (18%) |
| ptsd_2 |
160 (1.0%) |
| Any Psychiatric Diagnosis |
4,316 (28%) |
| Total SVI |
0.37 (0.26) |
| Â Â Â Â (Missing) |
288 |
| Soceioeconomic Status |
0.35 (0.26) |
| Â Â Â Â (Missing) |
338 |
| Household Composition |
0.40 (0.27) |
| Â Â Â Â (Missing) |
287 |
| Minority Status and Language |
0.48 (0.29) |
| Â Â Â Â (Missing) |
279 |
| Housing and Transportation |
0.44 (0.29) |
| Â Â Â Â (Missing) |
310 |
| SVI Quartile |
|
| Â Â Â Â First |
5,843 (39%) |
| Â Â Â Â Second |
4,506 (30%) |
| Â Â Â Â Third |
3,063 (20%) |
| Â Â Â Â Fourth |
1,545 (10%) |
| Â Â Â Â (Missing) |
288 |
By SVI Quartile
baseline %>% tbl_summary(by = RPL_4,
label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status", depression_2 ~ "Depression", anxiety_2 ~ "Anxiety", any_psych_dx_2 ~ "Any Psychiatric Diagnosis", RPL_THEMES ~ "Total SVI", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", RPL_4 ~ "SVI Quartile", act_tob ~ "Active Tobacco Use"),
statistic = list(all_continuous() ~ "{mean} ({sd})"),
missing_text = "(Missing)") %>% add_p()
288 observations missing `RPL_4` have been removed. To include these observations, use `forcats::fct_explicit_na()` on `RPL_4` column before passing to `tbl_summary()`.
There was an error in 'add_p()/add_difference()' for variable 'relig_affil', p-value omitted:
Error in stats::fisher.test(structure(c(2L, NA, 1L, NA, 1L, 2L, 2L, 1L, : FEXACT error 6. LDKEY=534 is too small for this problem,
(ii := key2[itp=940] = 42828805, ldstp=16020)
Try increasing the size of the workspace and possibly 'mult'
There was an error in 'add_p()/add_difference()' for variable 'act_tob', p-value omitted:
Error in stats::fisher.test(structure(c(1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, : FEXACT error 6. LDKEY=533 is too small for this problem,
(ii := key2[itp=674] = 21415546, ldstp=15990)
Try increasing the size of the workspace and possibly 'mult'
| Characteristic |
First, N = 5,843 |
Second, N = 4,506 |
Third, N = 3,063 |
Fourth, N = 1,545 |
p-value |
| Age |
49 (20) |
50 (19) |
50 (19) |
48 (19) |
0.007 |
| Gender |
|
|
|
|
<0.001 |
| Â Â Â Â Male |
2,761 (47%) |
2,053 (46%) |
1,305 (43%) |
692 (45%) |
|
| Â Â Â Â Female |
3,082 (53%) |
2,453 (54%) |
1,758 (57%) |
853 (55%) |
|
| Race |
|
|
|
|
<0.001 |
| Â Â Â Â White |
5,301 (91%) |
3,969 (88%) |
2,627 (86%) |
1,093 (71%) |
|
| Â Â Â Â Black |
139 (2.4%) |
204 (4.5%) |
239 (7.8%) |
345 (22%) |
|
| Â Â Â Â Other |
236 (4.0%) |
167 (3.7%) |
122 (4.0%) |
93 (6.0%) |
|
| Â Â Â Â Asian |
153 (2.6%) |
142 (3.2%) |
65 (2.1%) |
7 (0.5%) |
|
| Â Â Â Â Native |
14 (0.2%) |
24 (0.5%) |
10 (0.3%) |
7 (0.5%) |
|
| Ethnicity |
|
|
|
|
0.007 |
| Â Â Â Â NonHispanic |
5,525 (98%) |
4,274 (98%) |
2,897 (98%) |
1,441 (97%) |
|
| Â Â Â Â UNKNOWN |
0 (0%) |
0 (0%) |
0 (0%) |
0 (0%) |
|
| Â Â Â Â CHOOSE NOT TO DISCLOSE |
0 (0%) |
0 (0%) |
0 (0%) |
0 (0%) |
|
| Â Â Â Â Hispanic |
100 (1.8%) |
87 (2.0%) |
60 (2.0%) |
49 (3.3%) |
|
| Â Â Â Â (Missing) |
218 |
145 |
106 |
55 |
|
| English Speaking |
|
|
|
|
<0.001 |
| Â Â Â Â English |
5,809 (99%) |
4,454 (99%) |
3,019 (99%) |
1,513 (98%) |
|
| Â Â Â Â Other |
34 (0.6%) |
52 (1.2%) |
44 (1.4%) |
32 (2.1%) |
|
| Any Religious Affiliation |
|
|
|
|
|
| Â Â Â Â Yes |
3,238 (59%) |
2,403 (57%) |
1,657 (58%) |
779 (55%) |
|
| Â Â Â Â No |
2,286 (41%) |
1,816 (43%) |
1,205 (42%) |
643 (45%) |
|
| Â Â Â Â PATIENT REFUSED |
0 (0%) |
0 (0%) |
0 (0%) |
0 (0%) |
|
| Â Â Â Â UNKNOWN |
0 (0%) |
0 (0%) |
0 (0%) |
0 (0%) |
|
| Â Â Â Â (Missing) |
319 |
287 |
201 |
123 |
|
| Marital Status |
|
|
|
|
<0.001 |
| Â Â Â Â Married |
2,700 (46%) |
1,857 (41%) |
1,115 (36%) |
444 (29%) |
|
| Â Â Â Â Unknown |
1,137 (19%) |
946 (21%) |
705 (23%) |
389 (25%) |
|
| Â Â Â Â Unmarried |
1,763 (30%) |
1,434 (32%) |
1,041 (34%) |
620 (40%) |
|
| Â Â Â Â DivorcedSeparated |
133 (2.3%) |
168 (3.7%) |
128 (4.2%) |
72 (4.7%) |
|
| Â Â Â Â Widow |
110 (1.9%) |
101 (2.2%) |
74 (2.4%) |
20 (1.3%) |
|
| Active Tobacco Use |
|
|
|
|
|
| Â Â Â Â No |
5,137 (91%) |
3,719 (87%) |
2,394 (83%) |
1,121 (78%) |
|
| Â Â Â Â Yes |
480 (8.5%) |
570 (13%) |
506 (17%) |
309 (22%) |
|
| Â Â Â Â NOT ASKED |
0 (0%) |
0 (0%) |
0 (0%) |
0 (0%) |
|
| Â Â Â Â (Missing) |
226 |
217 |
163 |
115 |
|
| Depression |
938 (16%) |
805 (18%) |
539 (18%) |
297 (19%) |
0.009 |
| Anxiety |
1,109 (19%) |
864 (19%) |
538 (18%) |
268 (17%) |
0.2 |
| ptsd_2 |
53 (0.9%) |
44 (1.0%) |
47 (1.5%) |
16 (1.0%) |
0.044 |
| Any Psychiatric Diagnosis |
1,625 (28%) |
1,315 (29%) |
874 (29%) |
450 (29%) |
0.4 |
| Total SVI |
0.12 (0.07) |
0.37 (0.07) |
0.61 (0.07) |
0.86 (0.07) |
<0.001 |
| Soceioeconomic Status |
0.13 (0.11) |
0.34 (0.16) |
0.56 (0.15) |
0.78 (0.11) |
<0.001 |
| Â Â Â Â (Missing) |
51 |
0 |
0 |
0 |
|
| Household Composition |
0.21 (0.14) |
0.38 (0.22) |
0.58 (0.24) |
0.76 (0.19) |
<0.001 |
| Minority Status and Language |
0.41 (0.27) |
0.47 (0.29) |
0.52 (0.28) |
0.66 (0.25) |
<0.001 |
| Housing and Transportation |
0.19 (0.16) |
0.49 (0.20) |
0.64 (0.21) |
0.81 (0.17) |
<0.001 |
| Â Â Â Â (Missing) |
22 |
0 |
0 |
0 |
|
Bivariate Analysis
Depression
tbl_uv_depression <-
tbl_uvregression(
mh_clean1[c("depression_2", "age_yrs", "gender", "race_5", "ethnic_3", "lang_3", "relig_affil", "mstat_5", "RPL_THEMES", "RPL_THEME1", "RPL_THEME2", "RPL_THEME3", "RPL_THEME4", "act_tob")],
method = glm,
y = depression_2,
method.args = list(family = binomial),
exponentiate = TRUE,
label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status", RPL_THEMES ~ "Total SVI", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", act_tob ~ "Active Tobacco Use"))
print(tbl_uv_depression, method = render)
`...` must be empty.
✖ Problematic argument:
• method = render
| Characteristic |
N |
OR |
95% CI |
p-value |
| Age |
15,245 |
1.01 |
1.00, 1.01 |
<0.001 |
| Gender |
15,245 |
|
|
|
| Â Â Â Â Male |
|
— |
— |
|
| Â Â Â Â Female |
|
1.81 |
1.66, 1.98 |
<0.001 |
| Race |
15,245 |
|
|
|
| Â Â Â Â White |
|
— |
— |
|
| Â Â Â Â Black |
|
1.02 |
0.86, 1.21 |
0.8 |
| Â Â Â Â Other |
|
0.74 |
0.58, 0.93 |
0.011 |
| Â Â Â Â Asian |
|
0.50 |
0.35, 0.70 |
<0.001 |
| Â Â Â Â Native |
|
1.43 |
0.74, 2.60 |
0.3 |
| Ethnicity |
14,703 |
|
|
|
| Â Â Â Â NonHispanic |
|
— |
— |
|
| Â Â Â Â Hispanic |
|
0.88 |
0.63, 1.19 |
0.4 |
| English Speaking |
15,245 |
|
|
|
| Â Â Â Â English |
|
— |
— |
|
| Â Â Â Â Other |
|
0.41 |
0.22, 0.70 |
0.002 |
| Any Religious Affiliation |
14,296 |
|
|
|
| Â Â Â Â Yes |
|
— |
— |
|
| Â Â Â Â No |
|
0.95 |
0.87, 1.03 |
0.2 |
| Marital Status |
15,245 |
|
|
|
| Â Â Â Â Married |
|
— |
— |
|
| Â Â Â Â Unknown |
|
1.01 |
0.89, 1.13 |
>0.9 |
| Â Â Â Â Unmarried |
|
1.19 |
1.07, 1.31 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
|
2.16 |
1.76, 2.64 |
<0.001 |
| Â Â Â Â Widow |
|
1.90 |
1.45, 2.46 |
<0.001 |
| Total SVI |
14,957 |
1.32 |
1.12, 1.55 |
<0.001 |
| Soceioeconomic Status |
14,907 |
1.36 |
1.15, 1.60 |
<0.001 |
| Household Composition |
14,958 |
1.04 |
0.89, 1.22 |
0.6 |
| Minority Status and Language |
14,966 |
1.18 |
1.02, 1.37 |
0.028 |
| Housing and Transportation |
14,935 |
1.23 |
1.06, 1.43 |
0.005 |
| Active Tobacco Use |
14,502 |
|
|
|
| Â Â Â Â No |
|
— |
— |
|
| Â Â Â Â Yes |
|
1.46 |
1.30, 1.64 |
<0.001 |
NULL
Anxiety
tbl_uv_anxiety <-
tbl_uvregression(
mh_clean1[c("anxiety_2", "age_yrs", "gender", "race_5", "ethnic_3", "lang_3", "relig_affil", "mstat_5", "RPL_THEMES", "RPL_THEME1", "RPL_THEME2", "RPL_THEME3", "RPL_THEME4", "act_tob")],
method = glm,
y = anxiety_2,
method.args = list(family = binomial),
exponentiate = TRUE,
label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status", RPL_THEMES ~ "Total SVI", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", act_tob ~ "Active Tobacco Use"))
print(tbl_uv_anxiety, method = render)
`...` must be empty.
✖ Problematic argument:
• method = render
| Characteristic |
N |
OR |
95% CI |
p-value |
| Age |
15,245 |
0.99 |
0.99, 1.00 |
<0.001 |
| Gender |
15,245 |
|
|
|
| Â Â Â Â Male |
|
— |
— |
|
| Â Â Â Â Female |
|
1.97 |
1.81, 2.15 |
<0.001 |
| Race |
15,245 |
|
|
|
| Â Â Â Â White |
|
— |
— |
|
| Â Â Â Â Black |
|
0.83 |
0.70, 1.0 |
0.047 |
| Â Â Â Â Other |
|
0.84 |
0.67, 1.03 |
0.10 |
| Â Â Â Â Asian |
|
0.51 |
0.36, 0.70 |
<0.001 |
| Â Â Â Â Native |
|
1.43 |
0.75, 2.56 |
0.2 |
| Ethnicity |
14,703 |
|
|
|
| Â Â Â Â NonHispanic |
|
— |
— |
|
| Â Â Â Â Hispanic |
|
0.95 |
0.70, 1.27 |
0.7 |
| English Speaking |
15,245 |
|
|
|
| Â Â Â Â English |
|
— |
— |
|
| Â Â Â Â Other |
|
0.28 |
0.14, 0.51 |
<0.001 |
| Any Religious Affiliation |
14,296 |
|
|
|
| Â Â Â Â Yes |
|
— |
— |
|
| Â Â Â Â No |
|
0.99 |
0.91, 1.08 |
0.9 |
| Marital Status |
15,245 |
|
|
|
| Â Â Â Â Married |
|
— |
— |
|
| Â Â Â Â Unknown |
|
1.07 |
0.96, 1.20 |
0.2 |
| Â Â Â Â Unmarried |
|
1.26 |
1.14, 1.38 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
|
1.81 |
1.46, 2.22 |
<0.001 |
| Â Â Â Â Widow |
|
1.24 |
0.92, 1.64 |
0.2 |
| Total SVI |
14,957 |
0.85 |
0.73, 1.00 |
0.055 |
| Soceioeconomic Status |
14,907 |
0.81 |
0.69, 0.96 |
0.012 |
| Household Composition |
14,958 |
0.75 |
0.64, 0.88 |
<0.001 |
| Minority Status and Language |
14,966 |
1.23 |
1.07, 1.42 |
0.004 |
| Housing and Transportation |
14,935 |
0.96 |
0.83, 1.10 |
0.5 |
| Active Tobacco Use |
14,502 |
|
|
|
| Â Â Â Â No |
|
— |
— |
|
| Â Â Â Â Yes |
|
1.36 |
1.21, 1.52 |
<0.001 |
NULL
Any Psych Diagnosis
tbl_uv_any <-
tbl_uvregression(
mh_clean1[c("any_psych_dx_2", "age_yrs", "gender", "race_5", "ethnic_3", "lang_3", "relig_affil", "mstat_5", "RPL_THEMES", "RPL_THEME1", "RPL_THEME2", "RPL_THEME3", "RPL_THEME4", "act_tob")],
method = glm,
y = any_psych_dx_2,
method.args = list(family = binomial),
exponentiate = TRUE,
label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status", RPL_THEMES ~ "Total SVI", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", act_tob ~ "Active Tobacco Use"))
print(tbl_uv_any, method = render)
`...` must be empty.
✖ Problematic argument:
• method = render
| Characteristic |
N |
OR |
95% CI |
p-value |
| Age |
15,245 |
1.00 |
1.00, 1.00 |
0.8 |
| Gender |
15,245 |
|
|
|
| Â Â Â Â Male |
|
— |
— |
|
| Â Â Â Â Female |
|
1.81 |
1.68, 1.95 |
<0.001 |
| Race |
15,245 |
|
|
|
| Â Â Â Â White |
|
— |
— |
|
| Â Â Â Â Black |
|
0.98 |
0.85, 1.14 |
0.8 |
| Â Â Â Â Other |
|
0.80 |
0.67, 0.96 |
0.020 |
| Â Â Â Â Asian |
|
0.62 |
0.48, 0.80 |
<0.001 |
| Â Â Â Â Native |
|
1.38 |
0.78, 2.36 |
0.2 |
| Ethnicity |
14,703 |
|
|
|
| Â Â Â Â NonHispanic |
|
— |
— |
|
| Â Â Â Â Hispanic |
|
0.95 |
0.73, 1.21 |
0.7 |
| English Speaking |
15,245 |
|
|
|
| Â Â Â Â English |
|
— |
— |
|
| Â Â Â Â Other |
|
0.39 |
0.24, 0.60 |
<0.001 |
| Any Religious Affiliation |
14,296 |
|
|
|
| Â Â Â Â Yes |
|
— |
— |
|
| Â Â Â Â No |
|
0.96 |
0.89, 1.03 |
0.3 |
| Marital Status |
15,245 |
|
|
|
| Â Â Â Â Married |
|
— |
— |
|
| Â Â Â Â Unknown |
|
1.00 |
0.91, 1.10 |
>0.9 |
| Â Â Â Â Unmarried |
|
1.19 |
1.09, 1.29 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
|
1.85 |
1.53, 2.23 |
<0.001 |
| Â Â Â Â Widow |
|
1.52 |
1.19, 1.93 |
<0.001 |
| Total SVI |
14,957 |
1.08 |
0.94, 1.24 |
0.3 |
| Soceioeconomic Status |
14,907 |
1.07 |
0.93, 1.23 |
0.4 |
| Household Composition |
14,958 |
0.89 |
0.78, 1.02 |
0.091 |
| Minority Status and Language |
14,966 |
1.22 |
1.07, 1.38 |
0.002 |
| Housing and Transportation |
14,935 |
1.08 |
0.96, 1.23 |
0.2 |
| Active Tobacco Use |
14,502 |
|
|
|
| Â Â Â Â No |
|
— |
— |
|
| Â Â Â Â Yes |
|
1.39 |
1.25, 1.54 |
<0.001 |
NULL
Depression + SVI Multivariable Model
All variables
depression1 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + act_tob + RPL_THEMES,
family = "binomial",
data = mh_clean1)
summary(depression1)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + act_tob + RPL_THEMES, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.1260 -0.6776 -0.5710 -0.4862 2.4520
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.448062 0.103913 -23.559 < 2e-16 ***
mstat_5Unknown 0.081790 0.065595 1.247 0.2124
mstat_5Unmarried 0.330227 0.060886 5.424 5.84e-08 ***
mstat_5DivorcedSeparated 0.621328 0.112049 5.545 2.94e-08 ***
mstat_5Widow 0.279541 0.146526 1.908 0.0564 .
lang_3Other -0.557233 0.313099 -1.780 0.0751 .
age_yrs 0.007199 0.001398 5.148 2.63e-07 ***
race_5Black -0.076737 0.095967 -0.800 0.4239
race_5Other -0.172894 0.152808 -1.131 0.2579
race_5Asian -0.406943 0.186349 -2.184 0.0290 *
race_5Native 0.250426 0.337935 0.741 0.4587
relig_affilNo 0.006495 0.047814 0.136 0.8920
genderFemale 0.566904 0.048022 11.805 < 2e-16 ***
ethnic_3Hispanic 0.037951 0.175481 0.216 0.8288
act_tobYes 0.358004 0.063811 5.610 2.02e-08 ***
RPL_THEMES 0.166515 0.092249 1.805 0.0711 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12438 on 13063 degrees of freedom
Residual deviance: 12145 on 13048 degrees of freedom
(2181 observations deleted due to missingness)
AIC: 12177
Number of Fisher Scoring iterations: 4
broom::glance(depression1)
broom::tidy(depression1, exponentiate = TRUE)
tbl_regression(depression1, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status", act_tob ~ "Active Tobacco Use"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.09 |
0.95, 1.23 |
0.2 |
| Â Â Â Â Unmarried |
1.39 |
1.23, 1.57 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.86 |
1.49, 2.31 |
<0.001 |
| Â Â Â Â Widow |
1.32 |
0.99, 1.75 |
0.056 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.57 |
0.29, 1.02 |
0.075 |
| Age |
1.01 |
1.00, 1.01 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.93 |
0.77, 1.11 |
0.4 |
| Â Â Â Â Other |
0.84 |
0.62, 1.13 |
0.3 |
| Â Â Â Â Asian |
0.67 |
0.45, 0.95 |
0.029 |
| Â Â Â Â Native |
1.28 |
0.64, 2.42 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.01 |
0.92, 1.11 |
0.9 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.76 |
1.60, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.04 |
0.73, 1.45 |
0.8 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.43 |
1.26, 1.62 |
<0.001 |
| Total SVI |
1.18 |
0.99, 1.41 |
0.071 |
## Model performance
model_performance(depression1)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12177.058 | 12296.700 | 0.023 | 0.382 | 0.965 | 0.465 | -Inf | 9.112e-05 | 0.708
performance::check_model(depression1, panel = TRUE)

## Margins
cplot(depression1, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Depression Given SVI")

Drop tobacco use
depression2 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEMES,
family = "binomial",
data = mh_clean1)
summary(depression2)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEMES, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0235 -0.6749 -0.5623 -0.4898 2.4575
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.424509 0.102321 -23.695 < 2e-16 ***
mstat_5Unknown 0.093735 0.064985 1.442 0.1492
mstat_5Unmarried 0.336484 0.060026 5.606 2.07e-08 ***
mstat_5DivorcedSeparated 0.672966 0.110046 6.115 9.64e-10 ***
mstat_5Widow 0.327869 0.142607 2.299 0.0215 *
lang_3Other -0.543394 0.312468 -1.739 0.0820 .
age_yrs 0.006691 0.001374 4.871 1.11e-06 ***
race_5Black -0.083141 0.094727 -0.878 0.3801
race_5Other -0.173846 0.152119 -1.143 0.2531
race_5Asian -0.474324 0.185492 -2.557 0.0106 *
race_5Native 0.222392 0.334890 0.664 0.5066
relig_affilNo 0.019158 0.047149 0.406 0.6845
genderFemale 0.566612 0.047420 11.949 < 2e-16 ***
ethnic_3Hispanic 0.016130 0.174648 0.092 0.9264
RPL_THEMES 0.193405 0.090059 2.148 0.0318 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12783 on 13625 degrees of freedom
Residual deviance: 12519 on 13611 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 12549
Number of Fisher Scoring iterations: 4
broom::glance(depression2)
broom::tidy(depression2, exponentiate = TRUE)
tbl_regression(depression2, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.10 |
0.97, 1.25 |
0.15 |
| Â Â Â Â Unmarried |
1.40 |
1.24, 1.57 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.96 |
1.58, 2.43 |
<0.001 |
| Â Â Â Â Widow |
1.39 |
1.04, 1.83 |
0.021 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.58 |
0.30, 1.03 |
0.082 |
| Age |
1.01 |
1.00, 1.01 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.92 |
0.76, 1.11 |
0.4 |
| Â Â Â Â Other |
0.84 |
0.62, 1.12 |
0.3 |
| Â Â Â Â Asian |
0.62 |
0.43, 0.88 |
0.011 |
| Â Â Â Â Native |
1.25 |
0.62, 2.34 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.02 |
0.93, 1.12 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.76 |
1.61, 1.93 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.02 |
0.71, 1.42 |
>0.9 |
| Total SVI |
1.21 |
1.02, 1.45 |
0.032 |
## Model performance
model_performance(depression2)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12548.600 | 12661.396 | 0.020 | 0.379 | 0.959 | 0.459 | -Inf | 8.292e-05 | 0.712
performance::check_model(depression2, panel = TRUE)

## Margins
cplot(depression2, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Depression Given SVI")

Age and SVI as quadratics
depression3 <- glm(depression_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 + relig_affil
+ gender + ethnic_3 + I(RPL_THEMES^2),
family = "binomial",
data = mh_clean1)
summary(depression3)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + I(age_yrs^2) +
race_5 + relig_affil + gender + ethnic_3 + I(RPL_THEMES^2),
family = "binomial", data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0080 -0.6734 -0.5591 -0.4968 2.4217
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.143e+00 7.496e-02 -28.584 < 2e-16 ***
mstat_5Unknown 5.846e-02 6.457e-02 0.905 0.36525
mstat_5Unmarried 2.797e-01 5.887e-02 4.750 2.03e-06 ***
mstat_5DivorcedSeparated 6.761e-01 1.100e-01 6.147 7.89e-10 ***
mstat_5Widow 3.534e-01 1.443e-01 2.448 0.01437 *
lang_3Other -5.367e-01 3.124e-01 -1.718 0.08583 .
I(age_yrs^2) 3.964e-05 1.317e-05 3.010 0.00262 **
race_5Black -8.794e-02 9.532e-02 -0.923 0.35624
race_5Other -1.824e-01 1.519e-01 -1.201 0.22980
race_5Asian -4.939e-01 1.854e-01 -2.663 0.00774 **
race_5Native 2.272e-01 3.347e-01 0.679 0.49713
relig_affilNo 5.068e-03 4.719e-02 0.107 0.91447
genderFemale 5.690e-01 4.740e-02 12.003 < 2e-16 ***
ethnic_3Hispanic -1.905e-03 1.743e-01 -0.011 0.99128
I(RPL_THEMES^2) 2.079e-01 9.837e-02 2.113 0.03459 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12783 on 13625 degrees of freedom
Residual deviance: 12534 on 13611 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 12564
Number of Fisher Scoring iterations: 4
broom::glance(depression3)
broom::tidy(depression3, exponentiate = TRUE)
tbl_regression(depression3, label = list( gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.06 |
0.93, 1.20 |
0.4 |
| Â Â Â Â Unmarried |
1.32 |
1.18, 1.48 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.97 |
1.58, 2.43 |
<0.001 |
| Â Â Â Â Widow |
1.42 |
1.07, 1.88 |
0.014 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.58 |
0.30, 1.04 |
0.086 |
| I(age_yrs^2) |
1.00 |
1.00, 1.00 |
0.003 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.92 |
0.76, 1.10 |
0.4 |
| Â Â Â Â Other |
0.83 |
0.61, 1.11 |
0.2 |
| Â Â Â Â Asian |
0.61 |
0.42, 0.86 |
0.008 |
| Â Â Â Â Native |
1.26 |
0.62, 2.35 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.01 |
0.92, 1.10 |
>0.9 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.77 |
1.61, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.00 |
0.70, 1.39 |
>0.9 |
| I(RPL_THEMES^2) |
1.23 |
1.01, 1.49 |
0.035 |
## Model performance
model_performance(depression3)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
6.925e+05 | 6.926e+05 | 0.018 | 0.379 | 0.960 | 0.460 | -Inf | 8.314e-05 | 0.712
performance::check_model(depression3, panel = TRUE)

## Margins
cplot(depression3, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Depression Given SVI")

Interaction between RPL_THEMES and Race
depression4 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + relig_affil
+ gender + ethnic_3 + RPL_THEMES*race_5,
family = "binomial",
data = mh_clean1)
summary(depression4)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + relig_affil +
gender + ethnic_3 + RPL_THEMES * race_5, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.9742 -0.6750 -0.5622 -0.4890 2.5195
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.423136 0.103050 -23.514 < 2e-16 ***
mstat_5Unknown 0.094418 0.065014 1.452 0.1464
mstat_5Unmarried 0.337955 0.060053 5.628 1.83e-08 ***
mstat_5DivorcedSeparated 0.678048 0.110109 6.158 7.37e-10 ***
mstat_5Widow 0.327333 0.142642 2.295 0.0217 *
lang_3Other -0.497761 0.314275 -1.584 0.1132
age_yrs 0.006716 0.001374 4.888 1.02e-06 ***
relig_affilNo 0.019154 0.047161 0.406 0.6846
genderFemale 0.567968 0.047446 11.971 < 2e-16 ***
ethnic_3Hispanic 0.036268 0.174680 0.208 0.8355
RPL_THEMES 0.180364 0.096029 1.878 0.0604 .
race_5Black -0.311068 0.225646 -1.379 0.1680
race_5Other 0.129136 0.251287 0.514 0.6073
race_5Asian -0.833035 0.353588 -2.356 0.0185 *
race_5Native 0.787903 0.683141 1.153 0.2488
RPL_THEMES:race_5Black 0.377326 0.340351 1.109 0.2676
RPL_THEMES:race_5Other -0.774057 0.537934 -1.439 0.1502
RPL_THEMES:race_5Asian 1.085951 0.871264 1.246 0.2126
RPL_THEMES:race_5Native -1.376549 1.515888 -0.908 0.3638
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12783 on 13625 degrees of freedom
Residual deviance: 12513 on 13607 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 12551
Number of Fisher Scoring iterations: 4
broom::glance(depression4)
broom::tidy(depression4, exponentiate = TRUE)
tbl_regression(depression4, label = list( gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.10 |
0.97, 1.25 |
0.15 |
| Â Â Â Â Unmarried |
1.40 |
1.25, 1.58 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.97 |
1.58, 2.44 |
<0.001 |
| Â Â Â Â Widow |
1.39 |
1.04, 1.83 |
0.022 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.61 |
0.31, 1.08 |
0.11 |
| age_yrs |
1.01 |
1.00, 1.01 |
<0.001 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.02 |
0.93, 1.12 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.76 |
1.61, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.04 |
0.73, 1.45 |
0.8 |
| RPL_THEMES |
1.20 |
0.99, 1.45 |
0.060 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.73 |
0.47, 1.13 |
0.2 |
| Â Â Â Â Other |
1.14 |
0.68, 1.84 |
0.6 |
| Â Â Â Â Asian |
0.43 |
0.21, 0.84 |
0.018 |
| Â Â Â Â Native |
2.20 |
0.54, 8.24 |
0.2 |
| RPL_THEMES * Race |
|
|
|
| Â Â Â Â RPL_THEMES * Black |
1.46 |
0.75, 2.86 |
0.3 |
| Â Â Â Â RPL_THEMES * Other |
0.46 |
0.16, 1.31 |
0.2 |
| Â Â Â Â RPL_THEMES * Asian |
2.96 |
0.53, 16.4 |
0.2 |
| Â Â Â Â RPL_THEMES * Native |
0.25 |
0.01, 4.35 |
0.4 |
## Model performance
model_performance(depression4)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12550.658 | 12693.533 | 0.020 | 0.379 | 0.959 | 0.459 | -Inf | 7.590e-05 | 0.713
performance::check_model(depression4, panel = TRUE)

## Margins
cplot(depression4, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Depression Given SVI")

SVI Quartiles
depression5 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_4,
family = "binomial",
data = mh_clean1)
summary(depression5)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_4, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0072 -0.6747 -0.5633 -0.4897 2.4637
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.415166 0.101801 -23.724 < 2e-16 ***
mstat_5Unknown 0.096381 0.064966 1.484 0.13792
mstat_5Unmarried 0.339108 0.060009 5.651 1.60e-08 ***
mstat_5DivorcedSeparated 0.674751 0.110018 6.133 8.62e-10 ***
mstat_5Widow 0.329315 0.142654 2.308 0.02097 *
lang_3Other -0.539081 0.312468 -1.725 0.08449 .
age_yrs 0.006729 0.001374 4.899 9.63e-07 ***
race_5Black -0.077966 0.095039 -0.820 0.41201
race_5Other -0.172126 0.152139 -1.131 0.25790
race_5Asian -0.479508 0.185512 -2.585 0.00974 **
race_5Native 0.219477 0.334789 0.656 0.51210
relig_affilNo 0.018262 0.047161 0.387 0.69858
genderFemale 0.567692 0.047431 11.969 < 2e-16 ***
ethnic_3Hispanic 0.015006 0.174686 0.086 0.93154
RPL_4Second 0.101235 0.055096 1.837 0.06615 .
RPL_4Third 0.054166 0.062372 0.868 0.38516
RPL_4Fourth 0.164578 0.080279 2.050 0.04036 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12783 on 13625 degrees of freedom
Residual deviance: 12517 on 13609 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 12551
Number of Fisher Scoring iterations: 4
broom::glance(depression5)
broom::tidy(depression5, exponentiate = TRUE)
tbl_regression(depression5, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_4 ~ "SVI Quartile", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.10 |
0.97, 1.25 |
0.14 |
| Â Â Â Â Unmarried |
1.40 |
1.25, 1.58 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.96 |
1.58, 2.43 |
<0.001 |
| Â Â Â Â Widow |
1.39 |
1.05, 1.83 |
0.021 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.58 |
0.30, 1.03 |
0.084 |
| Age |
1.01 |
1.00, 1.01 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.92 |
0.77, 1.11 |
0.4 |
| Â Â Â Â Other |
0.84 |
0.62, 1.13 |
0.3 |
| Â Â Â Â Asian |
0.62 |
0.42, 0.88 |
0.010 |
| Â Â Â Â Native |
1.25 |
0.62, 2.33 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.02 |
0.93, 1.12 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.76 |
1.61, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.02 |
0.71, 1.42 |
>0.9 |
| SVI Quartile |
|
|
|
| Â Â Â Â First |
— |
— |
|
| Â Â Â Â Second |
1.11 |
0.99, 1.23 |
0.066 |
| Â Â Â Â Third |
1.06 |
0.93, 1.19 |
0.4 |
| Â Â Â Â Fourth |
1.18 |
1.01, 1.38 |
0.040 |
## Model performance
model_performance(depression5)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12551.444 | 12679.279 | 0.020 | 0.379 | 0.959 | 0.459 | -Inf | 1.022e-04 | 0.713
performance::check_model(depression5, panel = TRUE)

## Margins
cplot(depression5, "RPL_4", what = "prediction", main = "Percent Likelihood of Depression Given SVI")

Interaction between SVI quartile and race
depression6 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + relig_affil
+ gender + ethnic_3 + RPL_4*race_5,
family = "binomial",
data = mh_clean1)
summary(depression6)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + relig_affil +
gender + ethnic_3 + RPL_4 * race_5, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0596 -0.6752 -0.5620 -0.4879 2.5717
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.418131 0.102245 -23.650 < 2e-16 ***
mstat_5Unknown 0.099167 0.065009 1.525 0.1272
mstat_5Unmarried 0.342173 0.060041 5.699 1.21e-08 ***
mstat_5DivorcedSeparated 0.687058 0.110287 6.230 4.67e-10 ***
mstat_5Widow 0.330454 0.142745 2.315 0.0206 *
lang_3Other -0.462967 0.314629 -1.471 0.1412
age_yrs 0.006821 0.001375 4.962 6.99e-07 ***
relig_affilNo 0.018682 0.047201 0.396 0.6923
genderFemale 0.570230 0.047480 12.010 < 2e-16 ***
ethnic_3Hispanic 0.029946 0.175066 0.171 0.8642
RPL_4Second 0.086209 0.057561 1.498 0.1342
RPL_4Third 0.047867 0.065610 0.730 0.4657
RPL_4Fourth 0.163462 0.088696 1.843 0.0653 .
race_5Black -0.345389 0.258965 -1.334 0.1823
race_5Other 0.048613 0.226924 0.214 0.8304
race_5Asian -0.841198 0.332092 -2.533 0.0113 *
race_5Native 0.188194 0.655866 0.287 0.7742
RPL_4Second:race_5Black 0.248141 0.323078 0.768 0.4425
RPL_4Third:race_5Black 0.371260 0.313081 1.186 0.2357
RPL_4Fourth:race_5Black 0.295759 0.306337 0.965 0.3343
RPL_4Second:race_5Other -0.149625 0.345958 -0.432 0.6654
RPL_4Third:race_5Other -0.336592 0.401114 -0.839 0.4014
RPL_4Fourth:race_5Other -0.889842 0.497345 -1.789 0.0736 .
RPL_4Second:race_5Asian 0.583008 0.429690 1.357 0.1748
RPL_4Third:race_5Asian 0.317062 0.549441 0.577 0.5639
RPL_4Fourth:race_5Asian 1.667628 0.949734 1.756 0.0791 .
RPL_4Second:race_5Native 0.490149 0.803777 0.610 0.5420
RPL_4Third:race_5Native -11.547177 106.430839 -0.108 0.9136
RPL_4Fourth:race_5Native 0.488855 1.098344 0.445 0.6563
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12783 on 13625 degrees of freedom
Residual deviance: 12501 on 13597 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 12559
Number of Fisher Scoring iterations: 11
broom::glance(depression6)
broom::tidy(depression6, exponentiate = TRUE)
tbl_regression(depression6, label = list(age_yrs ~ "Age", gender~ "Gender", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.10 |
0.97, 1.25 |
0.13 |
| Â Â Â Â Unmarried |
1.41 |
1.25, 1.58 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.99 |
1.60, 2.46 |
<0.001 |
| Â Â Â Â Widow |
1.39 |
1.05, 1.83 |
0.021 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.63 |
0.32, 1.12 |
0.14 |
| Age |
1.01 |
1.00, 1.01 |
<0.001 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.02 |
0.93, 1.12 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.77 |
1.61, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.03 |
0.72, 1.44 |
0.9 |
| RPL_4 |
|
|
|
| Â Â Â Â First |
— |
— |
|
| Â Â Â Â Second |
1.09 |
0.97, 1.22 |
0.13 |
| Â Â Â Â Third |
1.05 |
0.92, 1.19 |
0.5 |
| Â Â Â Â Fourth |
1.18 |
0.99, 1.40 |
0.065 |
| race_5 |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.71 |
0.41, 1.15 |
0.2 |
| Â Â Â Â Other |
1.05 |
0.66, 1.61 |
0.8 |
| Â Â Â Â Asian |
0.43 |
0.21, 0.79 |
0.011 |
| Â Â Â Â Native |
1.21 |
0.27, 3.91 |
0.8 |
| RPL_4 * race_5 |
|
|
|
| Â Â Â Â Second * Black |
1.28 |
0.69, 2.46 |
0.4 |
| Â Â Â Â Third * Black |
1.45 |
0.80, 2.73 |
0.2 |
| Â Â Â Â Fourth * Black |
1.34 |
0.75, 2.50 |
0.3 |
| Â Â Â Â Second * Other |
0.86 |
0.43, 1.69 |
0.7 |
| Â Â Â Â Third * Other |
0.71 |
0.31, 1.54 |
0.4 |
| Â Â Â Â Fourth * Other |
0.41 |
0.14, 1.03 |
0.074 |
| Â Â Â Â Second * Asian |
1.79 |
0.78, 4.29 |
0.2 |
| Â Â Â Â Third * Asian |
1.37 |
0.44, 3.95 |
0.6 |
| Â Â Â Â Fourth * Asian |
5.30 |
0.65, 32.3 |
0.079 |
| Â Â Â Â Second * Native |
1.63 |
0.36, 9.03 |
0.5 |
| Â Â Â Â Third * Native |
0.00 |
|
>0.9 |
| Â Â Â Â Fourth * Native |
1.63 |
0.16, 14.5 |
0.7 |
## Model performance
model_performance(depression6)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12559.293 | 12777.365 | 0.021 | 0.379 | 0.959 | 0.459 | -Inf | 2.202e-04 | 0.713
performance::check_model(depression6, panel = TRUE)

## Margins
cplot(depression6, "RPL_4", what = "prediction", main = "Percent Likelihood of Depression Given SVI")

Interaction between SVI and marital status
depression7 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEMES*mstat_5,
family = "binomial",
data = mh_clean1)
summary(depression7)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEMES * mstat_5, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0361 -0.6757 -0.5622 -0.4893 2.4476
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.434053 0.111883 -21.755 < 2e-16 ***
mstat_5Unknown 0.047426 0.113568 0.418 0.676239
mstat_5Unmarried 0.380124 0.099215 3.831 0.000127 ***
mstat_5DivorcedSeparated 0.536467 0.220287 2.435 0.014879 *
mstat_5Widow 0.528863 0.253594 2.085 0.037027 *
lang_3Other -0.543420 0.312473 -1.739 0.082019 .
age_yrs 0.006761 0.001378 4.906 9.3e-07 ***
race_5Black -0.078362 0.095000 -0.825 0.409451
race_5Other -0.173204 0.152178 -1.138 0.255053
race_5Asian -0.471202 0.185543 -2.540 0.011098 *
race_5Native 0.224991 0.335008 0.672 0.501839
relig_affilNo 0.019471 0.047154 0.413 0.679658
genderFemale 0.566944 0.047426 11.954 < 2e-16 ***
ethnic_3Hispanic 0.013425 0.174738 0.077 0.938758
RPL_THEMES 0.207461 0.148254 1.399 0.161705
mstat_5Unknown:RPL_THEMES 0.114411 0.242354 0.472 0.636867
mstat_5Unmarried:RPL_THEMES -0.107588 0.207880 -0.518 0.604773
mstat_5DivorcedSeparated:RPL_THEMES 0.295013 0.425634 0.693 0.488237
mstat_5Widow:RPL_THEMES -0.544567 0.576105 -0.945 0.344528
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12783 on 13625 degrees of freedom
Residual deviance: 12516 on 13607 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 12554
Number of Fisher Scoring iterations: 4
broom::glance(depression7)
broom::tidy(depression7, exponentiate = TRUE)
tbl_regression(depression7, label = list( gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.05 |
0.84, 1.31 |
0.7 |
| Â Â Â Â Unmarried |
1.46 |
1.20, 1.78 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.71 |
1.10, 2.62 |
0.015 |
| Â Â Â Â Widow |
1.70 |
1.02, 2.77 |
0.037 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.58 |
0.30, 1.03 |
0.082 |
| age_yrs |
1.01 |
1.00, 1.01 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.92 |
0.77, 1.11 |
0.4 |
| Â Â Â Â Other |
0.84 |
0.62, 1.12 |
0.3 |
| Â Â Â Â Asian |
0.62 |
0.43, 0.88 |
0.011 |
| Â Â Â Â Native |
1.25 |
0.62, 2.34 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.02 |
0.93, 1.12 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.76 |
1.61, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.01 |
0.71, 1.41 |
>0.9 |
| RPL_THEMES |
1.23 |
0.92, 1.64 |
0.2 |
| Marital Status * RPL_THEMES |
|
|
|
| Â Â Â Â Unknown * RPL_THEMES |
1.12 |
0.70, 1.80 |
0.6 |
| Â Â Â Â Unmarried * RPL_THEMES |
0.90 |
0.60, 1.35 |
0.6 |
| Â Â Â Â DivorcedSeparated * RPL_THEMES |
1.34 |
0.58, 3.10 |
0.5 |
| Â Â Â Â Widow * RPL_THEMES |
0.58 |
0.18, 1.78 |
0.3 |
## Model performance
model_performance(depression7)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12554.214 | 12697.089 | 0.020 | 0.379 | 0.959 | 0.459 | -Inf | 8.134e-05 | 0.713
performance::check_model(depression7, panel = TRUE)

## Margins
cplot(depression7, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Depression Given SVI")

Interaction between SVI and smoking
depression8 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + act_tob*RPL_THEMES,
family = "binomial",
data = mh_clean1)
summary(depression8)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + act_tob * RPL_THEMES, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.1129 -0.6771 -0.5717 -0.4854 2.4557
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.462064 0.104897 -23.471 < 2e-16 ***
mstat_5Unknown 0.081123 0.065598 1.237 0.216208
mstat_5Unmarried 0.329571 0.060888 5.413 6.21e-08 ***
mstat_5DivorcedSeparated 0.620312 0.112045 5.536 3.09e-08 ***
mstat_5Widow 0.279787 0.146533 1.909 0.056214 .
lang_3Other -0.557695 0.313072 -1.781 0.074853 .
age_yrs 0.007176 0.001399 5.131 2.89e-07 ***
race_5Black -0.077663 0.095942 -0.809 0.418242
race_5Other -0.172171 0.152824 -1.127 0.259914
race_5Asian -0.406380 0.186376 -2.180 0.029225 *
race_5Native 0.254527 0.337828 0.753 0.451197
relig_affilNo 0.006317 0.047816 0.132 0.894904
genderFemale 0.568234 0.048045 11.827 < 2e-16 ***
ethnic_3Hispanic 0.034034 0.175551 0.194 0.846278
act_tobYes 0.464345 0.123245 3.768 0.000165 ***
RPL_THEMES 0.207263 0.100716 2.058 0.039600 *
act_tobYes:RPL_THEMES -0.237884 0.237482 -1.002 0.316492
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12438 on 13063 degrees of freedom
Residual deviance: 12144 on 13047 degrees of freedom
(2181 observations deleted due to missingness)
AIC: 12178
Number of Fisher Scoring iterations: 4
broom::glance(depression8)
broom::tidy(depression8, exponentiate = TRUE)
tbl_regression(depression8, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status", act_tob ~ "Active Tobacco Use"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.08 |
0.95, 1.23 |
0.2 |
| Â Â Â Â Unmarried |
1.39 |
1.23, 1.57 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.86 |
1.49, 2.31 |
<0.001 |
| Â Â Â Â Widow |
1.32 |
0.99, 1.75 |
0.056 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.57 |
0.29, 1.02 |
0.075 |
| Age |
1.01 |
1.00, 1.01 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.93 |
0.76, 1.11 |
0.4 |
| Â Â Â Â Other |
0.84 |
0.62, 1.13 |
0.3 |
| Â Â Â Â Asian |
0.67 |
0.45, 0.95 |
0.029 |
| Â Â Â Â Native |
1.29 |
0.64, 2.43 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.01 |
0.92, 1.11 |
0.9 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.77 |
1.61, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.03 |
0.73, 1.45 |
0.8 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.59 |
1.25, 2.02 |
<0.001 |
| Total SVI |
1.23 |
1.01, 1.50 |
0.040 |
| Active Tobacco Use * Total SVI |
|
|
|
| Â Â Â Â Yes * Total SVI |
0.79 |
0.49, 1.26 |
0.3 |
## Model performance
model_performance(depression8)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12178.054 | 12305.174 | 0.023 | 0.382 | 0.965 | 0.465 | -Inf | 8.515e-05 | 0.708
performance::check_model(depression8, panel = TRUE)

## Margins
cplot(depression8, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Depression Given SVI")

Interaction between smoking and SVI quartiles
depression9 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + act_tob*RPL_4,
family = "binomial",
data = mh_clean1)
summary(depression9)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + act_tob * RPL_4, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.1202 -0.6758 -0.5742 -0.4855 2.4603
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.448734 0.104001 -23.545 < 2e-16 ***
mstat_5Unknown 0.083633 0.065581 1.275 0.202217
mstat_5Unmarried 0.331636 0.060893 5.446 5.15e-08 ***
mstat_5DivorcedSeparated 0.621796 0.112057 5.549 2.87e-08 ***
mstat_5Widow 0.279708 0.146600 1.908 0.056395 .
lang_3Other -0.552181 0.313067 -1.764 0.077770 .
age_yrs 0.007223 0.001399 5.164 2.42e-07 ***
race_5Black -0.074607 0.096291 -0.775 0.438453
race_5Other -0.171558 0.152869 -1.122 0.261756
race_5Asian -0.410471 0.186414 -2.202 0.027670 *
race_5Native 0.249345 0.337820 0.738 0.460454
relig_affilNo 0.005405 0.047832 0.113 0.910023
genderFemale 0.569654 0.048059 11.853 < 2e-16 ***
ethnic_3Hispanic 0.035001 0.175610 0.199 0.842018
act_tobYes 0.419717 0.121084 3.466 0.000528 ***
RPL_4Second 0.107968 0.059901 1.802 0.071477 .
RPL_4Third 0.031490 0.069451 0.453 0.650254
RPL_4Fourth 0.193773 0.091847 2.110 0.034881 *
act_tobYes:RPL_4Second -0.071401 0.165123 -0.432 0.665443
act_tobYes:RPL_4Third -0.002906 0.173899 -0.017 0.986667
act_tobYes:RPL_4Fourth -0.230671 0.202208 -1.141 0.253970
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12438 on 13063 degrees of freedom
Residual deviance: 12142 on 13043 degrees of freedom
(2181 observations deleted due to missingness)
AIC: 12184
Number of Fisher Scoring iterations: 4
broom::glance(depression9)
broom::tidy(depression9, exponentiate = TRUE)
tbl_regression(depression9, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_4 ~ "SVI Quartiles", mstat_5 ~ "Marital Status", act_tob ~ "Active Tobacco Use"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.09 |
0.96, 1.24 |
0.2 |
| Â Â Â Â Unmarried |
1.39 |
1.24, 1.57 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.86 |
1.49, 2.31 |
<0.001 |
| Â Â Â Â Widow |
1.32 |
0.99, 1.75 |
0.056 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.58 |
0.30, 1.02 |
0.078 |
| Age |
1.01 |
1.00, 1.01 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.93 |
0.77, 1.12 |
0.4 |
| Â Â Â Â Other |
0.84 |
0.62, 1.13 |
0.3 |
| Â Â Â Â Asian |
0.66 |
0.45, 0.94 |
0.028 |
| Â Â Â Â Native |
1.28 |
0.63, 2.42 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.01 |
0.92, 1.10 |
>0.9 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.77 |
1.61, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.04 |
0.73, 1.45 |
0.8 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.52 |
1.20, 1.92 |
<0.001 |
| SVI Quartiles |
|
|
|
| Â Â Â Â First |
— |
— |
|
| Â Â Â Â Second |
1.11 |
0.99, 1.25 |
0.071 |
| Â Â Â Â Third |
1.03 |
0.90, 1.18 |
0.7 |
| Â Â Â Â Fourth |
1.21 |
1.01, 1.45 |
0.035 |
| Active Tobacco Use * SVI Quartiles |
|
|
|
| Â Â Â Â Yes * Second |
0.93 |
0.67, 1.29 |
0.7 |
| Â Â Â Â Yes * Third |
1.00 |
0.71, 1.40 |
>0.9 |
| Â Â Â Â Yes * Fourth |
0.79 |
0.53, 1.18 |
0.3 |
## Model performance
model_performance(depression9)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12183.842 | 12340.872 | 0.023 | 0.382 | 0.965 | 0.465 | -Inf | 1.199e-04 | 0.708
performance::check_model(depression9, panel = TRUE)

## Margins
cplot(depression9, "RPL_4", what = "prediction", main = "Percent Likelihood of Depression Given SVI Quartile")

Depression + All themes: Multivariable Models
All Variables
depress1 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + act_tob + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = mh_clean1)
summary(depress1)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + act_tob + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.1438 -0.6749 -0.5754 -0.4810 2.5217
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.513159 0.114191 -22.008 < 2e-16 ***
mstat_5Unknown 0.076902 0.065845 1.168 0.2428
mstat_5Unmarried 0.317268 0.061116 5.191 2.09e-07 ***
mstat_5DivorcedSeparated 0.622235 0.112249 5.543 2.97e-08 ***
mstat_5Widow 0.261389 0.147462 1.773 0.0763 .
lang_3Other -0.651480 0.314365 -2.072 0.0382 *
age_yrs 0.007532 0.001404 5.364 8.15e-08 ***
race_5Black -0.127666 0.097709 -1.307 0.1914
race_5Other -0.193184 0.152999 -1.263 0.2067
race_5Asian -0.478072 0.188249 -2.540 0.0111 *
race_5Native 0.268098 0.339359 0.790 0.4295
relig_affilNo 0.009112 0.048032 0.190 0.8495
genderFemale 0.566983 0.048201 11.763 < 2e-16 ***
ethnic_3Hispanic 0.028343 0.175476 0.162 0.8717
act_tobYes 0.355758 0.064205 5.541 3.01e-08 ***
RPL_THEME1 0.386070 0.131801 2.929 0.0034 **
RPL_THEME2 -0.336934 0.114298 -2.948 0.0032 **
RPL_THEME3 0.174358 0.084814 2.056 0.0398 *
RPL_THEME4 0.072003 0.096109 0.749 0.4537
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12369 on 12995 degrees of freedom
Residual deviance: 12060 on 12977 degrees of freedom
(2249 observations deleted due to missingness)
AIC: 12098
Number of Fisher Scoring iterations: 4
broom::glance(depress1)
broom::tidy(depress1, exponentiate = TRUE)
tbl_regression(depress1, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", mstat_5 ~ "Marital Status", act_tob ~ "Active Tobacco Use"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.08 |
0.95, 1.23 |
0.2 |
| Â Â Â Â Unmarried |
1.37 |
1.22, 1.55 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.86 |
1.49, 2.32 |
<0.001 |
| Â Â Â Â Widow |
1.30 |
0.97, 1.73 |
0.076 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.52 |
0.27, 0.93 |
0.038 |
| Age |
1.01 |
1.00, 1.01 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.88 |
0.72, 1.06 |
0.2 |
| Â Â Â Â Other |
0.82 |
0.61, 1.10 |
0.2 |
| Â Â Â Â Asian |
0.62 |
0.42, 0.88 |
0.011 |
| Â Â Â Â Native |
1.31 |
0.65, 2.47 |
0.4 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.01 |
0.92, 1.11 |
0.8 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.76 |
1.60, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.03 |
0.72, 1.44 |
0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.43 |
1.26, 1.62 |
<0.001 |
| Soceioeconomic Status |
1.47 |
1.14, 1.90 |
0.003 |
| Household Composition |
0.71 |
0.57, 0.89 |
0.003 |
| Minority Status and Language |
1.19 |
1.01, 1.41 |
0.040 |
| Housing and Transportation |
1.07 |
0.89, 1.30 |
0.5 |
## Model performance
model_performance(depress1)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12097.944 | 12239.920 | 0.024 | 0.382 | 0.964 | 0.464 | -Inf | 8.381e-05 | 0.708
performance::check_model(depress1, panel = TRUE)

## Margins
cplot(depress1, "RPL_THEME1", what = "prediction", main = "Percent Likelihood of Depression Given Theme 1")

cplot(depress1, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Depression Given Theme 2")

cplot(depress1, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Depression Given Theme 3")

cplot(depress1, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Depression Given Theme 4")

Drop tobacco use
depress2 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = mh_clean1)
summary(depress2)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEME1 + RPL_THEME2 +
RPL_THEME3 + RPL_THEME4, family = "binomial", data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0286 -0.6712 -0.5661 -0.4847 2.5279
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.488326 0.112402 -22.138 < 2e-16 ***
mstat_5Unknown 0.088955 0.065230 1.364 0.172660
mstat_5Unmarried 0.323580 0.060256 5.370 7.87e-08 ***
mstat_5DivorcedSeparated 0.676217 0.110224 6.135 8.52e-10 ***
mstat_5Widow 0.307402 0.143531 2.142 0.032216 *
lang_3Other -0.639635 0.313639 -2.039 0.041410 *
age_yrs 0.007017 0.001379 5.088 3.63e-07 ***
race_5Black -0.135159 0.096449 -1.401 0.161110
race_5Other -0.193460 0.152262 -1.271 0.203881
race_5Asian -0.540656 0.187452 -2.884 0.003924 **
race_5Native 0.234911 0.336216 0.699 0.484744
relig_affilNo 0.021146 0.047365 0.446 0.655280
genderFemale 0.566274 0.047592 11.899 < 2e-16 ***
ethnic_3Hispanic 0.007388 0.174620 0.042 0.966254
RPL_THEME1 0.431487 0.129536 3.331 0.000865 ***
RPL_THEME2 -0.331451 0.112723 -2.940 0.003278 **
RPL_THEME3 0.177126 0.083691 2.116 0.034308 *
RPL_THEME4 0.049342 0.094824 0.520 0.602819
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12713 on 13555 degrees of freedom
Residual deviance: 12431 on 13538 degrees of freedom
(1689 observations deleted due to missingness)
AIC: 12467
Number of Fisher Scoring iterations: 4
broom::glance(depress2)
broom::tidy(depress2, exponentiate = TRUE)
tbl_regression(depress2, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.09 |
0.96, 1.24 |
0.2 |
| Â Â Â Â Unmarried |
1.38 |
1.23, 1.56 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.97 |
1.58, 2.44 |
<0.001 |
| Â Â Â Â Widow |
1.36 |
1.02, 1.79 |
0.032 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.53 |
0.27, 0.94 |
0.041 |
| Age |
1.01 |
1.00, 1.01 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.87 |
0.72, 1.05 |
0.2 |
| Â Â Â Â Other |
0.82 |
0.61, 1.10 |
0.2 |
| Â Â Â Â Asian |
0.58 |
0.40, 0.83 |
0.004 |
| Â Â Â Â Native |
1.26 |
0.63, 2.37 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.02 |
0.93, 1.12 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.76 |
1.61, 1.93 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.01 |
0.71, 1.41 |
>0.9 |
| Soceioeconomic Status |
1.54 |
1.19, 1.98 |
<0.001 |
| Household Composition |
0.72 |
0.58, 0.90 |
0.003 |
| Minority Status and Language |
1.19 |
1.01, 1.41 |
0.034 |
| Housing and Transportation |
1.05 |
0.87, 1.26 |
0.6 |
## Model performance
model_performance(depress2)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12467.492 | 12602.754 | 0.021 | 0.379 | 0.958 | 0.459 | -Inf | 7.544e-05 | 0.713
performance::check_model(depress2, panel = TRUE)

## Margins
cplot(depress2, "RPL_THEME1", what = "prediction", main = "Percent Likelihood of Depression Given Theme 1")

cplot(depress2, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Depression Given Theme 2")

cplot(depress2, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Depression Given Theme 3")

cplot(depress2, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Depression Given Theme 4")

Drop theme 4
depress3 <- glm(depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + act_tob + RPL_THEME1 + RPL_THEME2 + RPL_THEME3,
family = "binomial",
data = mh_clean1)
summary(depress3)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + act_tob + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3, family = "binomial", data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.1361 -0.6749 -0.5749 -0.4811 2.5192
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.500675 0.113217 -22.087 < 2e-16 ***
mstat_5Unknown 0.079170 0.065772 1.204 0.228705
mstat_5Unmarried 0.320286 0.061029 5.248 1.54e-07 ***
mstat_5DivorcedSeparated 0.624831 0.112195 5.569 2.56e-08 ***
mstat_5Widow 0.263800 0.147454 1.789 0.073609 .
lang_3Other -0.651973 0.314397 -2.074 0.038105 *
age_yrs 0.007515 0.001403 5.355 8.57e-08 ***
race_5Black -0.132293 0.097612 -1.355 0.175326
race_5Other -0.194889 0.152962 -1.274 0.202627
race_5Asian -0.473820 0.188124 -2.519 0.011780 *
race_5Native 0.252310 0.338204 0.746 0.455650
relig_affilNo 0.009603 0.047972 0.200 0.841344
genderFemale 0.566983 0.048149 11.776 < 2e-16 ***
ethnic_3Hispanic 0.030678 0.175401 0.175 0.861158
act_tobYes 0.361198 0.064100 5.635 1.75e-08 ***
RPL_THEME1 0.421917 0.121151 3.483 0.000497 ***
RPL_THEME2 -0.327142 0.113801 -2.875 0.004044 **
RPL_THEME3 0.177982 0.084570 2.105 0.035331 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12390 on 13016 degrees of freedom
Residual deviance: 12080 on 12999 degrees of freedom
(2228 observations deleted due to missingness)
AIC: 12116
Number of Fisher Scoring iterations: 4
broom::glance(depress3)
broom::tidy(depress3, exponentiate = TRUE)
tbl_regression(depress3, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", mstat_5 ~ "Marital Status", act_tob ~ "Active Tobacco Use"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.08 |
0.95, 1.23 |
0.2 |
| Â Â Â Â Unmarried |
1.38 |
1.22, 1.55 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.87 |
1.50, 2.32 |
<0.001 |
| Â Â Â Â Widow |
1.30 |
0.97, 1.73 |
0.074 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.52 |
0.27, 0.93 |
0.038 |
| Age |
1.01 |
1.00, 1.01 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.88 |
0.72, 1.06 |
0.2 |
| Â Â Â Â Other |
0.82 |
0.60, 1.10 |
0.2 |
| Â Â Â Â Asian |
0.62 |
0.42, 0.89 |
0.012 |
| Â Â Â Â Native |
1.29 |
0.64, 2.43 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.01 |
0.92, 1.11 |
0.8 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.76 |
1.60, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.03 |
0.72, 1.44 |
0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.44 |
1.26, 1.63 |
<0.001 |
| Soceioeconomic Status |
1.52 |
1.20, 1.93 |
<0.001 |
| Household Composition |
0.72 |
0.58, 0.90 |
0.004 |
| Minority Status and Language |
1.19 |
1.01, 1.41 |
0.035 |
## Model performance
model_performance(depress3)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12116.189 | 12250.721 | 0.024 | 0.382 | 0.964 | 0.464 | -Inf | 1.015e-04 | 0.708
performance::check_model(depress3, panel = TRUE)

## Margins
cplot(depress3, "RPL_THEME1", what = "prediction", main = "Percent Likelihood of Depression Given Theme 1")

cplot(depress3, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Depression Given Theme 2")

cplot(depress3, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Depression Given Theme 3")

Age and themes as quadratics
depress4 <- glm(depression_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 + relig_affil
+ gender + ethnic_3 + I(RPL_THEME1^2) + I(RPL_THEME2^2) + I(RPL_THEME3^2) +
I(RPL_THEME4^2),
family = "binomial",
data = mh_clean1)
summary(depress4)
Call:
glm(formula = depression_2 ~ mstat_5 + lang_3 + I(age_yrs^2) +
race_5 + relig_affil + gender + ethnic_3 + I(RPL_THEME1^2) +
I(RPL_THEME2^2) + I(RPL_THEME3^2) + I(RPL_THEME4^2), family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0229 -0.6733 -0.5620 -0.4909 2.4894
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.211e+00 8.028e-02 -27.537 < 2e-16 ***
mstat_5Unknown 5.231e-02 6.482e-02 0.807 0.41962
mstat_5Unmarried 2.673e-01 5.912e-02 4.521 6.16e-06 ***
mstat_5DivorcedSeparated 6.806e-01 1.102e-01 6.177 6.55e-10 ***
mstat_5Widow 3.334e-01 1.452e-01 2.296 0.02170 *
lang_3Other -6.446e-01 3.139e-01 -2.054 0.04002 *
I(age_yrs^2) 4.229e-05 1.321e-05 3.201 0.00137 **
race_5Black -1.550e-01 9.711e-02 -1.596 0.11044
race_5Other -2.096e-01 1.520e-01 -1.378 0.16806
race_5Asian -5.681e-01 1.873e-01 -3.032 0.00243 **
race_5Native 2.449e-01 3.357e-01 0.730 0.46569
relig_affilNo 9.568e-03 4.739e-02 0.202 0.83998
genderFemale 5.690e-01 4.757e-02 11.962 < 2e-16 ***
ethnic_3Hispanic -5.767e-03 1.742e-01 -0.033 0.97359
I(RPL_THEME1^2) 4.152e-01 1.474e-01 2.817 0.00484 **
I(RPL_THEME2^2) -2.143e-01 1.237e-01 -1.732 0.08327 .
I(RPL_THEME3^2) 2.379e-01 8.268e-02 2.878 0.00400 **
I(RPL_THEME4^2) 2.575e-02 9.267e-02 0.278 0.78108
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12713 on 13555 degrees of freedom
Residual deviance: 12449 on 13538 degrees of freedom
(1689 observations deleted due to missingness)
AIC: 12485
Number of Fisher Scoring iterations: 4
broom::glance(depress4)
broom::tidy(depress4, exponentiate = TRUE)
tbl_regression(depress4, label = list(gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.05 |
0.93, 1.20 |
0.4 |
| Â Â Â Â Unmarried |
1.31 |
1.16, 1.47 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.98 |
1.59, 2.45 |
<0.001 |
| Â Â Â Â Widow |
1.40 |
1.04, 1.85 |
0.022 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.52 |
0.27, 0.93 |
0.040 |
| I(age_yrs^2) |
1.00 |
1.00, 1.00 |
0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.86 |
0.71, 1.03 |
0.11 |
| Â Â Â Â Other |
0.81 |
0.60, 1.08 |
0.2 |
| Â Â Â Â Asian |
0.57 |
0.39, 0.81 |
0.002 |
| Â Â Â Â Native |
1.28 |
0.63, 2.39 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.01 |
0.92, 1.11 |
0.8 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.77 |
1.61, 1.94 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.99 |
0.70, 1.39 |
>0.9 |
| I(RPL_THEME1^2) |
1.51 |
1.13, 2.02 |
0.005 |
| I(RPL_THEME2^2) |
0.81 |
0.63, 1.03 |
0.083 |
| I(RPL_THEME3^2) |
1.27 |
1.08, 1.49 |
0.004 |
| I(RPL_THEME4^2) |
1.03 |
0.86, 1.23 |
0.8 |
## Model performance
model_performance(depress4)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
6.936e+05 | 6.937e+05 | 0.020 | 0.379 | 0.959 | 0.459 | -Inf | 7.411e-05 | 0.713
performance::check_model(depress4, panel = TRUE)

## Margins
cplot(depress4, "RPL_THEME1", what = "prediction", main = "Percent Likelihood of Depression Given Theme 1")

cplot(depress4, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Depression Given Theme 2")

cplot(depress4, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Depression Given Theme 3")

cplot(depress4, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Depression Given Theme 4")

Anxiety + SVI: Multivariable Model
All variables
anxiety1 <- glm(anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + act_tob + RPL_THEMES,
family = "binomial",
data = mh_clean1)
summary(anxiety1)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + act_tob + RPL_THEMES, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0687 -0.7157 -0.5935 -0.4770 2.5073
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.4707531 0.0995010 -14.781 < 2e-16 ***
mstat_5Unknown 0.0009191 0.0640542 0.014 0.98855
mstat_5Unmarried 0.1519563 0.0596456 2.548 0.01085 *
mstat_5DivorcedSeparated 0.4909465 0.1139003 4.310 1.63e-05 ***
mstat_5Widow 0.1661906 0.1581620 1.051 0.29337
lang_3Other -0.9068036 0.3541088 -2.561 0.01044 *
age_yrs -0.0073388 0.0013870 -5.291 1.21e-07 ***
race_5Black -0.2172524 0.0977355 -2.223 0.02623 *
race_5Other 0.0441503 0.1386191 0.319 0.75010
race_5Asian -0.6653691 0.1886466 -3.527 0.00042 ***
race_5Native 0.2432445 0.3294085 0.738 0.46025
relig_affilNo -0.0321729 0.0463237 -0.695 0.48735
genderFemale 0.7011633 0.0471707 14.864 < 2e-16 ***
ethnic_3Hispanic -0.0400784 0.1668082 -0.240 0.81012
act_tobYes 0.3388456 0.0629747 5.381 7.42e-08 ***
RPL_THEMES -0.2089403 0.0910197 -2.296 0.02170 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12977 on 13063 degrees of freedom
Residual deviance: 12610 on 13048 degrees of freedom
(2181 observations deleted due to missingness)
AIC: 12642
Number of Fisher Scoring iterations: 4
broom::glance(anxiety1)
broom::tidy(anxiety1, exponentiate = TRUE)
model_performance(anxiety1)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12642.013 | 12761.655 | 0.028 | 0.392 | 0.983 | 0.483 | -Inf | 7.655e-05 | 0.692
tbl_regression(anxiety1, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.00 |
0.88, 1.13 |
>0.9 |
| Â Â Â Â Unmarried |
1.16 |
1.04, 1.31 |
0.011 |
| Â Â Â Â DivorcedSeparated |
1.63 |
1.30, 2.04 |
<0.001 |
| Â Â Â Â Widow |
1.18 |
0.86, 1.60 |
0.3 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.40 |
0.19, 0.77 |
0.010 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.80 |
0.66, 0.97 |
0.026 |
| Â Â Â Â Other |
1.05 |
0.79, 1.36 |
0.8 |
| Â Â Â Â Asian |
0.51 |
0.35, 0.73 |
<0.001 |
| Â Â Â Â Native |
1.28 |
0.64, 2.37 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.97 |
0.88, 1.06 |
0.5 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.02 |
1.84, 2.21 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.96 |
0.69, 1.32 |
0.8 |
| act_tob |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.40 |
1.24, 1.59 |
<0.001 |
| Total SVI |
0.81 |
0.68, 0.97 |
0.022 |
## Performance
model_performance(anxiety1)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12642.013 | 12761.655 | 0.028 | 0.392 | 0.983 | 0.483 | -Inf | 7.655e-05 | 0.692
performance::check_model(anxiety1, panel = TRUE)

## Margins
cplot(anxiety1, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Anxiety Given SVI")

Drop tobacco use
anxiety2 <- glm(anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEMES,
family = "binomial",
data = mh_clean1)
summary(anxiety2)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEMES, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.9778 -0.7087 -0.5871 -0.4800 2.4989
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.473937 0.098197 -15.010 < 2e-16 ***
mstat_5Unknown 0.018765 0.063426 0.296 0.767338
mstat_5Unmarried 0.160361 0.058872 2.724 0.006452 **
mstat_5DivorcedSeparated 0.556200 0.111738 4.978 6.43e-07 ***
mstat_5Widow 0.189154 0.154870 1.221 0.221943
lang_3Other -0.900161 0.354028 -2.543 0.011002 *
age_yrs -0.007397 0.001364 -5.423 5.86e-08 ***
race_5Black -0.227018 0.096735 -2.347 0.018935 *
race_5Other 0.041124 0.137846 0.298 0.765451
race_5Asian -0.722968 0.187880 -3.848 0.000119 ***
race_5Native 0.224752 0.326475 0.688 0.491188
relig_affilNo -0.020856 0.045722 -0.456 0.648290
genderFemale 0.697611 0.046609 14.967 < 2e-16 ***
ethnic_3Hispanic -0.053067 0.165810 -0.320 0.748935
RPL_THEMES -0.181437 0.088872 -2.042 0.041196 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13329 on 13625 degrees of freedom
Residual deviance: 12980 on 13611 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 13010
Number of Fisher Scoring iterations: 5
broom::glance(anxiety2)
broom::tidy(anxiety2, exponentiate = TRUE)
model_performance(anxiety2)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
13010.198 | 13122.994 | 0.025 | 0.389 | 0.977 | 0.476 | -Inf | 7.339e-05 | 0.698
tbl_regression(anxiety2, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.02 |
0.90, 1.15 |
0.8 |
| Â Â Â Â Unmarried |
1.17 |
1.05, 1.32 |
0.006 |
| Â Â Â Â DivorcedSeparated |
1.74 |
1.40, 2.17 |
<0.001 |
| Â Â Â Â Widow |
1.21 |
0.88, 1.63 |
0.2 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.41 |
0.19, 0.77 |
0.011 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.80 |
0.66, 0.96 |
0.019 |
| Â Â Â Â Other |
1.04 |
0.79, 1.36 |
0.8 |
| Â Â Â Â Asian |
0.49 |
0.33, 0.69 |
<0.001 |
| Â Â Â Â Native |
1.25 |
0.64, 2.31 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.98 |
0.90, 1.07 |
0.6 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.01 |
1.83, 2.20 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.95 |
0.68, 1.30 |
0.7 |
| Total SVI |
0.83 |
0.70, 0.99 |
0.041 |
## Performance
model_performance(anxiety2)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
13010.198 | 13122.994 | 0.025 | 0.389 | 0.977 | 0.476 | -Inf | 7.339e-05 | 0.698
performance::check_model(anxiety2, panel = TRUE)

## Margins
cplot(anxiety2, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Anxiety Given SVI")

Age and RPL_THEMES as quadratics
anxiety3 <- glm(anxiety_2 ~ I(age_yrs^2) + gender + mstat_5 + lang_3 + ethnic_3 + race_5
+ relig_affil + I(RPL_THEMES^2),
family = "binomial",
data = mh_clean1)
summary(anxiety3)
Call:
glm(formula = anxiety_2 ~ I(age_yrs^2) + gender + mstat_5 + lang_3 +
ethnic_3 + race_5 + relig_affil + I(RPL_THEMES^2), family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.9959 -0.7108 -0.5885 -0.4661 2.5246
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.586e+00 7.279e-02 -21.786 < 2e-16 ***
I(age_yrs^2) -9.381e-05 1.364e-05 -6.876 6.16e-12 ***
genderFemale 6.927e-01 4.663e-02 14.854 < 2e-16 ***
mstat_5Unknown 7.862e-03 6.283e-02 0.125 0.9004
mstat_5Unmarried 1.402e-01 5.752e-02 2.437 0.0148 *
mstat_5DivorcedSeparated 5.515e-01 1.118e-01 4.934 8.05e-07 ***
mstat_5Widow 2.895e-01 1.569e-01 1.845 0.0650 .
lang_3Other -8.903e-01 3.543e-01 -2.513 0.0120 *
ethnic_3Hispanic -5.723e-02 1.659e-01 -0.345 0.7301
race_5Black -2.284e-01 9.730e-02 -2.347 0.0189 *
race_5Other 3.904e-02 1.379e-01 0.283 0.7772
race_5Asian -7.358e-01 1.879e-01 -3.916 9.00e-05 ***
race_5Native 2.175e-01 3.267e-01 0.666 0.5056
relig_affilNo -3.623e-02 4.582e-02 -0.791 0.4291
I(RPL_THEMES^2) -2.107e-01 9.973e-02 -2.113 0.0346 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13329 on 13625 degrees of freedom
Residual deviance: 12961 on 13611 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 12991
Number of Fisher Scoring iterations: 5
broom::glance(anxiety3)
broom::tidy(anxiety3, exponentiate = TRUE)
model_performance(anxiety3)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
1.793e+05 | 1.794e+05 | 0.027 | 0.389 | 0.976 | 0.476 | -Inf | 7.339e-05 | 0.698
tbl_regression(anxiety3, label = list(gender~ "Gender", race_5 ~ "Race", lang_3 ~ "Preferred Language", ethnic_3 ~ "Ethnicity", relig_affil ~ "Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| I(age_yrs^2) |
1.00 |
1.00, 1.00 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.00 |
1.83, 2.19 |
<0.001 |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.01 |
0.89, 1.14 |
>0.9 |
| Â Â Â Â Unmarried |
1.15 |
1.03, 1.29 |
0.015 |
| Â Â Â Â DivorcedSeparated |
1.74 |
1.39, 2.16 |
<0.001 |
| Â Â Â Â Widow |
1.34 |
0.97, 1.80 |
0.065 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.41 |
0.19, 0.78 |
0.012 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.94 |
0.68, 1.30 |
0.7 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.80 |
0.66, 0.96 |
0.019 |
| Â Â Â Â Other |
1.04 |
0.79, 1.36 |
0.8 |
| Â Â Â Â Asian |
0.48 |
0.33, 0.68 |
<0.001 |
| Â Â Â Â Native |
1.24 |
0.63, 2.30 |
0.5 |
| Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.96 |
0.88, 1.05 |
0.4 |
| I(RPL_THEMES^2) |
0.81 |
0.67, 0.98 |
0.035 |
## Performance
model_performance(anxiety3)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
1.793e+05 | 1.794e+05 | 0.027 | 0.389 | 0.976 | 0.476 | -Inf | 7.339e-05 | 0.698
performance::check_model(anxiety3, panel = TRUE)

## Margins
cplot(anxiety3, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Anxiety Given SVI")

SVI Quartiles
anxiety4 <- glm(anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_4,
family = "binomial",
data = mh_clean1)
summary(anxiety4)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_4, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.9819 -0.7093 -0.5871 -0.4795 2.4929
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.499095 0.097624 -15.356 < 2e-16 ***
mstat_5Unknown 0.019406 0.063410 0.306 0.75958
mstat_5Unmarried 0.160693 0.058853 2.730 0.00633 **
mstat_5DivorcedSeparated 0.553765 0.111706 4.957 7.15e-07 ***
mstat_5Widow 0.189883 0.154886 1.226 0.22021
lang_3Other -0.900556 0.354050 -2.544 0.01097 *
age_yrs -0.007381 0.001364 -5.411 6.28e-08 ***
race_5Black -0.232496 0.097041 -2.396 0.01658 *
race_5Other 0.039204 0.137875 0.284 0.77614
race_5Asian -0.722818 0.187919 -3.846 0.00012 ***
race_5Native 0.215036 0.326470 0.659 0.51011
relig_affilNo -0.021452 0.045734 -0.469 0.63904
genderFemale 0.698747 0.046620 14.988 < 2e-16 ***
ethnic_3Hispanic -0.055072 0.165842 -0.332 0.73983
RPL_4Second -0.015544 0.053040 -0.293 0.76948
RPL_4Third -0.134186 0.061284 -2.190 0.02855 *
RPL_4Fourth -0.110228 0.081014 -1.361 0.17364
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13329 on 13625 degrees of freedom
Residual deviance: 12978 on 13609 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 13012
Number of Fisher Scoring iterations: 5
broom::glance(anxiety4)
broom::tidy(anxiety4, exponentiate = TRUE)
model_performance(anxiety4)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
13012.294 | 13140.129 | 0.025 | 0.389 | 0.977 | 0.476 | -Inf | 7.339e-05 | 0.698
tbl_regression(anxiety4, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_4 ~ "SVI Quartile", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.02 |
0.90, 1.15 |
0.8 |
| Â Â Â Â Unmarried |
1.17 |
1.05, 1.32 |
0.006 |
| Â Â Â Â DivorcedSeparated |
1.74 |
1.39, 2.16 |
<0.001 |
| Â Â Â Â Widow |
1.21 |
0.89, 1.63 |
0.2 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.41 |
0.19, 0.77 |
0.011 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.79 |
0.65, 0.96 |
0.017 |
| Â Â Â Â Other |
1.04 |
0.79, 1.36 |
0.8 |
| Â Â Â Â Asian |
0.49 |
0.33, 0.69 |
<0.001 |
| Â Â Â Â Native |
1.24 |
0.63, 2.29 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.98 |
0.89, 1.07 |
0.6 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.01 |
1.84, 2.20 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.95 |
0.68, 1.30 |
0.7 |
| SVI Quartile |
|
|
|
| Â Â Â Â First |
— |
— |
|
| Â Â Â Â Second |
0.98 |
0.89, 1.09 |
0.8 |
| Â Â Â Â Third |
0.87 |
0.78, 0.99 |
0.029 |
| Â Â Â Â Fourth |
0.90 |
0.76, 1.05 |
0.2 |
## Performance
model_performance(anxiety4)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
13012.294 | 13140.129 | 0.025 | 0.389 | 0.977 | 0.476 | -Inf | 7.339e-05 | 0.698
performance::check_model(anxiety4, panel = TRUE)

## Margins
cplot(anxiety4, "RPL_4", what = "prediction", main = "Percent Likelihood of Anxiety Given SVI")

Anxiety + All Themes: Multivariable Model
All Variables
anx1 <- glm(anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + act_tob + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = mh_clean1)
summary(anx1)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + act_tob + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0973 -0.7164 -0.5906 -0.4641 2.5252
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.567056 0.109826 -14.268 < 2e-16 ***
mstat_5Unknown -0.003306 0.064357 -0.051 0.959030
mstat_5Unmarried 0.143499 0.059848 2.398 0.016498 *
mstat_5DivorcedSeparated 0.494210 0.114140 4.330 1.49e-05 ***
mstat_5Widow 0.165057 0.158445 1.042 0.297534
lang_3Other -0.986555 0.354987 -2.779 0.005450 **
age_yrs -0.007035 0.001391 -5.056 4.29e-07 ***
race_5Black -0.272264 0.099320 -2.741 0.006120 **
race_5Other 0.018301 0.138870 0.132 0.895154
race_5Asian -0.781346 0.190338 -4.105 4.04e-05 ***
race_5Native 0.266880 0.331607 0.805 0.420930
relig_affilNo -0.025640 0.046541 -0.551 0.581692
genderFemale 0.706886 0.047379 14.920 < 2e-16 ***
ethnic_3Hispanic -0.047351 0.166801 -0.284 0.776503
act_tobYes 0.353192 0.063406 5.570 2.54e-08 ***
RPL_THEME1 -0.135312 0.129897 -1.042 0.297559
RPL_THEME2 -0.246013 0.112549 -2.186 0.028828 *
RPL_THEME3 0.280499 0.082495 3.400 0.000673 ***
RPL_THEME4 0.026648 0.094050 0.283 0.776920
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12908 on 12995 degrees of freedom
Residual deviance: 12519 on 12977 degrees of freedom
(2249 observations deleted due to missingness)
AIC: 12557
Number of Fisher Scoring iterations: 4
broom::glance(anx1)
broom::tidy(anx1, exponentiate = TRUE)
tbl_regression(anx1, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", mstat_5 ~ "Marital Status", act_tob ~ "Active Tobacco Use"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.00 |
0.88, 1.13 |
>0.9 |
| Â Â Â Â Unmarried |
1.15 |
1.03, 1.30 |
0.016 |
| Â Â Â Â DivorcedSeparated |
1.64 |
1.31, 2.05 |
<0.001 |
| Â Â Â Â Widow |
1.18 |
0.86, 1.60 |
0.3 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.37 |
0.17, 0.71 |
0.005 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.76 |
0.63, 0.92 |
0.006 |
| Â Â Â Â Other |
1.02 |
0.77, 1.33 |
0.9 |
| Â Â Â Â Asian |
0.46 |
0.31, 0.66 |
<0.001 |
| Â Â Â Â Native |
1.31 |
0.66, 2.44 |
0.4 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.97 |
0.89, 1.07 |
0.6 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.03 |
1.85, 2.23 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.95 |
0.68, 1.31 |
0.8 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.42 |
1.26, 1.61 |
<0.001 |
| Soceioeconomic Status |
0.87 |
0.68, 1.13 |
0.3 |
| Household Composition |
0.78 |
0.63, 0.97 |
0.029 |
| Minority Status and Language |
1.32 |
1.13, 1.56 |
<0.001 |
| Housing and Transportation |
1.03 |
0.85, 1.23 |
0.8 |
## Model performance
model_performance(anx1)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12556.821 | 12698.797 | 0.030 | 0.392 | 0.982 | 0.482 | -Inf | 7.735e-05 | 0.693
performance::check_model(anx1, panel = TRUE)

## Margins
cplot(anx1, "RPL_THEME1", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 1")

cplot(anx1, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 2")

cplot(anx1, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 3")

cplot(anx1, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 4")

Drop tobacoc
anx2 <- glm(anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = mh_clean1)
summary(anx2)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEME1 + RPL_THEME2 +
RPL_THEME3 + RPL_THEME4, family = "binomial", data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.9953 -0.7080 -0.5841 -0.4684 2.5124
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.562936 0.108301 -14.431 < 2e-16 ***
mstat_5Unknown 0.014565 0.063713 0.229 0.819182
mstat_5Unmarried 0.152529 0.059076 2.582 0.009826 **
mstat_5DivorcedSeparated 0.563533 0.111958 5.033 4.82e-07 ***
mstat_5Widow 0.186941 0.155151 1.205 0.228243
lang_3Other -0.980860 0.354259 -2.769 0.005627 **
age_yrs -0.007109 0.001368 -5.195 2.05e-07 ***
race_5Black -0.279687 0.098290 -2.846 0.004434 **
race_5Other 0.017954 0.138012 0.130 0.896497
race_5Asian -0.830135 0.189567 -4.379 1.19e-05 ***
race_5Native 0.245188 0.328209 0.747 0.455033
relig_affilNo -0.015135 0.045932 -0.330 0.741771
genderFemale 0.701715 0.046800 14.994 < 2e-16 ***
ethnic_3Hispanic -0.059407 0.165726 -0.358 0.719996
RPL_THEME1 -0.087447 0.127757 -0.684 0.493675
RPL_THEME2 -0.233475 0.111142 -2.101 0.035668 *
RPL_THEME3 0.268869 0.081467 3.300 0.000966 ***
RPL_THEME4 0.006252 0.092866 0.067 0.946326
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13259 on 13555 degrees of freedom
Residual deviance: 12890 on 13538 degrees of freedom
(1689 observations deleted due to missingness)
AIC: 12926
Number of Fisher Scoring iterations: 4
broom::glance(anx2)
broom::tidy(anx2, exponentiate = TRUE)
tbl_regression(anx2, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.01 |
0.90, 1.15 |
0.8 |
| Â Â Â Â Unmarried |
1.16 |
1.04, 1.31 |
0.010 |
| Â Â Â Â DivorcedSeparated |
1.76 |
1.41, 2.18 |
<0.001 |
| Â Â Â Â Widow |
1.21 |
0.88, 1.62 |
0.2 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.37 |
0.17, 0.71 |
0.006 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.76 |
0.62, 0.91 |
0.004 |
| Â Â Â Â Other |
1.02 |
0.77, 1.33 |
0.9 |
| Â Â Â Â Asian |
0.44 |
0.30, 0.62 |
<0.001 |
| Â Â Â Â Native |
1.28 |
0.65, 2.37 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.98 |
0.90, 1.08 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.02 |
1.84, 2.21 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.94 |
0.68, 1.29 |
0.7 |
| Soceioeconomic Status |
0.92 |
0.71, 1.18 |
0.5 |
| Household Composition |
0.79 |
0.64, 0.98 |
0.036 |
| Minority Status and Language |
1.31 |
1.12, 1.54 |
<0.001 |
| Housing and Transportation |
1.01 |
0.84, 1.21 |
>0.9 |
## Model performance
model_performance(anx2)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12926.001 | 13061.263 | 0.027 | 0.388 | 0.976 | 0.475 | -Inf | 7.395e-05 | 0.698
performance::check_model(anx2, panel = TRUE)

## Margins
cplot(anx2, "RPL_THEME1", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 1")

cplot(anx2, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 2")

cplot(anx2, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 3")

cplot(anx2, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 4")

Minority status and language
anx3 <- glm(anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEME3,
family = "binomial",
data = mh_clean1)
summary(anx3)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEME3, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0168 -0.7082 -0.5851 -0.4736 2.4686
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.661115 0.102851 -16.151 < 2e-16 ***
mstat_5Unknown 0.004711 0.063291 0.074 0.940666
mstat_5Unmarried 0.143210 0.058628 2.443 0.014579 *
mstat_5DivorcedSeparated 0.534227 0.111415 4.795 1.63e-06 ***
mstat_5Widow 0.177124 0.154948 1.143 0.252989
lang_3Other -0.994691 0.354211 -2.808 0.004982 **
age_yrs -0.007413 0.001363 -5.440 5.34e-08 ***
race_5Black -0.336489 0.096223 -3.497 0.000471 ***
race_5Other 0.005173 0.138085 0.037 0.970118
race_5Asian -0.791084 0.189036 -4.185 2.85e-05 ***
race_5Native 0.216547 0.326794 0.663 0.507560
relig_affilNo -0.019619 0.045740 -0.429 0.667978
genderFemale 0.696533 0.046606 14.945 < 2e-16 ***
ethnic_3Hispanic -0.067658 0.165701 -0.408 0.683043
RPL_THEME3 0.290093 0.079738 3.638 0.000275 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13330 on 13629 degrees of freedom
Residual deviance: 12972 on 13615 degrees of freedom
(1615 observations deleted due to missingness)
AIC: 13002
Number of Fisher Scoring iterations: 5
broom::glance(anx3)
broom::tidy(anx3, exponentiate = TRUE)
tbl_regression(anx3, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME3 ~ "Minority Status and Language", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.00 |
0.89, 1.14 |
>0.9 |
| Â Â Â Â Unmarried |
1.15 |
1.03, 1.29 |
0.015 |
| Â Â Â Â DivorcedSeparated |
1.71 |
1.37, 2.12 |
<0.001 |
| Â Â Â Â Widow |
1.19 |
0.87, 1.61 |
0.3 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.37 |
0.17, 0.70 |
0.005 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.71 |
0.59, 0.86 |
<0.001 |
| Â Â Â Â Other |
1.01 |
0.76, 1.31 |
>0.9 |
| Â Â Â Â Asian |
0.45 |
0.31, 0.65 |
<0.001 |
| Â Â Â Â Native |
1.24 |
0.63, 2.30 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.98 |
0.90, 1.07 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.01 |
1.83, 2.20 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.93 |
0.67, 1.28 |
0.7 |
| Minority Status and Language |
1.34 |
1.14, 1.56 |
<0.001 |
## Model performance
model_performance(anx3)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
13002.121 | 13114.922 | 0.026 | 0.389 | 0.976 | 0.476 | -Inf | 1.035e-04 | 0.698
performance::check_model(anx3, panel = TRUE)

## Margins
cplot(anx3, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 3")

Age + Minority and language status as quadratics
anx4 <- glm(anxiety_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 + relig_affil
+ gender + ethnic_3 + I(RPL_THEME3^2),
family = "binomial",
data = mh_clean1)
summary(anx4)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 +
relig_affil + gender + ethnic_3 + I(RPL_THEME3^2), family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0649 -0.7078 -0.5867 -0.4609 2.4940
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.717e+00 7.544e-02 -22.752 < 2e-16 ***
mstat_5Unknown -6.851e-03 6.275e-02 -0.109 0.913069
mstat_5Unmarried 1.218e-01 5.736e-02 2.123 0.033762 *
mstat_5DivorcedSeparated 5.287e-01 1.115e-01 4.740 2.13e-06 ***
mstat_5Widow 2.766e-01 1.570e-01 1.762 0.078075 .
lang_3Other -1.008e+00 3.546e-01 -2.842 0.004477 **
I(age_yrs^2) -9.327e-05 1.363e-05 -6.843 7.74e-12 ***
race_5Black -3.591e-01 9.640e-02 -3.725 0.000196 ***
race_5Other -6.620e-03 1.382e-01 -0.048 0.961801
race_5Asian -8.248e-01 1.893e-01 -4.357 1.32e-05 ***
race_5Native 2.186e-01 3.270e-01 0.668 0.503882
relig_affilNo -3.385e-02 4.585e-02 -0.738 0.460283
genderFemale 6.922e-01 4.664e-02 14.841 < 2e-16 ***
ethnic_3Hispanic -7.322e-02 1.658e-01 -0.442 0.658684
I(RPL_THEME3^2) 3.403e-01 7.835e-02 4.343 1.41e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13330 on 13629 degrees of freedom
Residual deviance: 12948 on 13615 degrees of freedom
(1615 observations deleted due to missingness)
AIC: 12978
Number of Fisher Scoring iterations: 5
broom::glance(anx4)
broom::tidy(anx4, exponentiate = TRUE)
tbl_regression(anx4, label = list(gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
0.99 |
0.88, 1.12 |
>0.9 |
| Â Â Â Â Unmarried |
1.13 |
1.01, 1.26 |
0.034 |
| Â Â Â Â DivorcedSeparated |
1.70 |
1.36, 2.11 |
<0.001 |
| Â Â Â Â Widow |
1.32 |
0.96, 1.78 |
0.078 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.36 |
0.17, 0.69 |
0.004 |
| I(age_yrs^2) |
1.00 |
1.00, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.70 |
0.58, 0.84 |
<0.001 |
| Â Â Â Â Other |
0.99 |
0.75, 1.30 |
>0.9 |
| Â Â Â Â Asian |
0.44 |
0.30, 0.63 |
<0.001 |
| Â Â Â Â Native |
1.24 |
0.63, 2.30 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.97 |
0.88, 1.06 |
0.5 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.00 |
1.82, 2.19 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.93 |
0.67, 1.28 |
0.7 |
| I(RPL_THEME3^2) |
1.41 |
1.20, 1.64 |
<0.001 |
## Model performance
model_performance(anx4)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
1.793e+05 | 1.794e+05 | 0.028 | 0.388 | 0.975 | 0.475 | -Inf | 1.010e-04 | 0.698
performance::check_model(anx4, panel = TRUE)

## Margins
cplot(anx4, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 3")

Age + Household composition as quadratics
anx5 <- glm(anxiety_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 + relig_affil
+ gender + ethnic_3 + I(RPL_THEME2^2),
family = "binomial",
data = mh_clean1)
summary(anx5)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 +
relig_affil + gender + ethnic_3 + I(RPL_THEME2^2), family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0075 -0.7096 -0.5874 -0.4632 2.5268
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.566e+00 7.306e-02 -21.429 < 2e-16 ***
mstat_5Unknown 8.724e-03 6.278e-02 0.139 0.88948
mstat_5Unmarried 1.384e-01 5.742e-02 2.410 0.01596 *
mstat_5DivorcedSeparated 5.574e-01 1.117e-01 4.988 6.10e-07 ***
mstat_5Widow 2.852e-01 1.569e-01 1.818 0.06906 .
lang_3Other -9.264e-01 3.539e-01 -2.617 0.00886 **
I(age_yrs^2) -9.258e-05 1.365e-05 -6.784 1.17e-11 ***
race_5Black -2.343e-01 9.555e-02 -2.452 0.01421 *
race_5Other 2.876e-02 1.378e-01 0.209 0.83474
race_5Asian -7.624e-01 1.882e-01 -4.051 5.09e-05 ***
race_5Native 2.168e-01 3.268e-01 0.663 0.50707
relig_affilNo -3.456e-02 4.584e-02 -0.754 0.45087
genderFemale 6.931e-01 4.664e-02 14.861 < 2e-16 ***
ethnic_3Hispanic -6.133e-02 1.658e-01 -0.370 0.71138
I(RPL_THEME2^2) -2.960e-01 9.171e-02 -3.227 0.00125 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13329 on 13625 degrees of freedom
Residual deviance: 12955 on 13611 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 12985
Number of Fisher Scoring iterations: 5
broom::glance(anx5)
broom::tidy(anx5, exponentiate = TRUE)
tbl_regression(anx5, label = list(gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.01 |
0.89, 1.14 |
0.9 |
| Â Â Â Â Unmarried |
1.15 |
1.03, 1.29 |
0.016 |
| Â Â Â Â DivorcedSeparated |
1.75 |
1.40, 2.17 |
<0.001 |
| Â Â Â Â Widow |
1.33 |
0.97, 1.80 |
0.069 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.40 |
0.18, 0.75 |
0.009 |
| I(age_yrs^2) |
1.00 |
1.00, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.79 |
0.65, 0.95 |
0.014 |
| Â Â Â Â Other |
1.03 |
0.78, 1.34 |
0.8 |
| Â Â Â Â Asian |
0.47 |
0.32, 0.66 |
<0.001 |
| Â Â Â Â Native |
1.24 |
0.63, 2.30 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.97 |
0.88, 1.06 |
0.5 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.00 |
1.83, 2.19 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.94 |
0.67, 1.29 |
0.7 |
| I(RPL_THEME2^2) |
0.74 |
0.62, 0.89 |
0.001 |
## Model performance
model_performance(anx5)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
1.792e+05 | 1.793e+05 | 0.027 | 0.388 | 0.976 | 0.475 | -Inf | 7.339e-05 | 0.698
performance::check_model(anx5, panel = TRUE)

## Margins
cplot(anx5, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 2")

Age + SES as quadratics
anx6 <- glm(anxiety_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 + relig_affil
+ gender + ethnic_3 + I(RPL_THEME1^2),
family = "binomial",
data = mh_clean1)
summary(anx6)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 +
relig_affil + gender + ethnic_3 + I(RPL_THEME1^2), family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.9898 -0.7105 -0.5886 -0.4658 2.5285
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.591e+00 7.290e-02 -21.829 < 2e-16 ***
mstat_5Unknown 2.104e-03 6.295e-02 0.033 0.9733
mstat_5Unmarried 1.366e-01 5.762e-02 2.371 0.0177 *
mstat_5DivorcedSeparated 5.494e-01 1.118e-01 4.915 8.89e-07 ***
mstat_5Widow 2.970e-01 1.570e-01 1.892 0.0585 .
lang_3Other -8.908e-01 3.540e-01 -2.516 0.0119 *
I(age_yrs^2) -9.397e-05 1.367e-05 -6.876 6.15e-12 ***
race_5Black -2.320e-01 9.743e-02 -2.381 0.0173 *
race_5Other 5.084e-02 1.380e-01 0.368 0.7125
race_5Asian -7.331e-01 1.880e-01 -3.900 9.62e-05 ***
race_5Native 2.180e-01 3.269e-01 0.667 0.5048
relig_affilNo -3.547e-02 4.592e-02 -0.772 0.4398
genderFemale 6.937e-01 4.673e-02 14.846 < 2e-16 ***
ethnic_3Hispanic -5.101e-02 1.659e-01 -0.308 0.7584
I(RPL_THEME1^2) -1.963e-01 1.062e-01 -1.849 0.0645 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13279 on 13576 degrees of freedom
Residual deviance: 12913 on 13562 degrees of freedom
(1668 observations deleted due to missingness)
AIC: 12943
Number of Fisher Scoring iterations: 4
broom::glance(anx6)
broom::tidy(anx6, exponentiate = TRUE)
tbl_regression(anx6, label = list(gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.00 |
0.89, 1.13 |
>0.9 |
| Â Â Â Â Unmarried |
1.15 |
1.02, 1.28 |
0.018 |
| Â Â Â Â DivorcedSeparated |
1.73 |
1.39, 2.15 |
<0.001 |
| Â Â Â Â Widow |
1.35 |
0.98, 1.82 |
0.059 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.41 |
0.19, 0.78 |
0.012 |
| I(age_yrs^2) |
1.00 |
1.00, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.79 |
0.65, 0.96 |
0.017 |
| Â Â Â Â Other |
1.05 |
0.80, 1.37 |
0.7 |
| Â Â Â Â Asian |
0.48 |
0.33, 0.68 |
<0.001 |
| Â Â Â Â Native |
1.24 |
0.63, 2.30 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.97 |
0.88, 1.06 |
0.4 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.00 |
1.83, 2.19 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.95 |
0.68, 1.31 |
0.8 |
| I(RPL_THEME1^2) |
0.82 |
0.67, 1.01 |
0.065 |
## Model performance
model_performance(anx6)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
1.787e+05 | 1.788e+05 | 0.027 | 0.389 | 0.976 | 0.476 | -Inf | 7.365e-05 | 0.698
performance::check_model(anx6, panel = TRUE)

## Margins
cplot(anx6, "RPL_THEME1", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 1")

Age + THEMES 1-3 as quadratics
anx7 <- glm(anxiety_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 + relig_affil
+ gender + ethnic_3 + I(RPL_THEME1^2) + I(RPL_THEME2^2) + I(RPL_THEME3^2),
family = "binomial",
data = mh_clean1)
summary(anx7)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 +
relig_affil + gender + ethnic_3 + I(RPL_THEME1^2) + I(RPL_THEME2^2) +
I(RPL_THEME3^2), family = "binomial", data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0197 -0.7080 -0.5865 -0.4582 2.5302
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.668e+00 7.750e-02 -21.525 < 2e-16 ***
mstat_5Unknown -1.888e-04 6.305e-02 -0.003 0.99761
mstat_5Unmarried 1.277e-01 5.766e-02 2.215 0.02677 *
mstat_5DivorcedSeparated 5.546e-01 1.120e-01 4.953 7.30e-07 ***
mstat_5Widow 2.855e-01 1.572e-01 1.817 0.06924 .
lang_3Other -9.977e-01 3.553e-01 -2.808 0.00499 **
I(age_yrs^2) -9.148e-05 1.367e-05 -6.692 2.20e-11 ***
race_5Black -3.056e-01 9.882e-02 -3.092 0.00199 **
race_5Other 6.237e-03 1.382e-01 0.045 0.96400
race_5Asian -8.519e-01 1.897e-01 -4.491 7.09e-06 ***
race_5Native 2.268e-01 3.271e-01 0.693 0.48820
relig_affilNo -2.909e-02 4.598e-02 -0.633 0.52697
genderFemale 6.959e-01 4.678e-02 14.878 < 2e-16 ***
ethnic_3Hispanic -6.194e-02 1.657e-01 -0.374 0.70858
I(RPL_THEME1^2) -6.561e-02 1.417e-01 -0.463 0.64332
I(RPL_THEME2^2) -2.254e-01 1.226e-01 -1.839 0.06595 .
I(RPL_THEME3^2) 3.277e-01 8.031e-02 4.081 4.48e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13279 on 13576 degrees of freedom
Residual deviance: 12889 on 13560 degrees of freedom
(1668 observations deleted due to missingness)
AIC: 12923
Number of Fisher Scoring iterations: 5
broom::glance(anx7)
broom::tidy(anx7, exponentiate = TRUE)
tbl_regression(anx7, label = list(gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.00 |
0.88, 1.13 |
>0.9 |
| Â Â Â Â Unmarried |
1.14 |
1.01, 1.27 |
0.027 |
| Â Â Â Â DivorcedSeparated |
1.74 |
1.39, 2.16 |
<0.001 |
| Â Â Â Â Widow |
1.33 |
0.97, 1.80 |
0.069 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.37 |
0.17, 0.70 |
0.005 |
| I(age_yrs^2) |
1.00 |
1.00, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.74 |
0.61, 0.89 |
0.002 |
| Â Â Â Â Other |
1.01 |
0.76, 1.31 |
>0.9 |
| Â Â Â Â Asian |
0.43 |
0.29, 0.61 |
<0.001 |
| Â Â Â Â Native |
1.25 |
0.64, 2.32 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.97 |
0.89, 1.06 |
0.5 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.01 |
1.83, 2.20 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.94 |
0.67, 1.29 |
0.7 |
| I(RPL_THEME1^2) |
0.94 |
0.71, 1.23 |
0.6 |
| I(RPL_THEME2^2) |
0.80 |
0.63, 1.01 |
0.066 |
| I(RPL_THEME3^2) |
1.39 |
1.19, 1.62 |
<0.001 |
## Model performance
model_performance(anx7)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
1.785e+05 | 1.786e+05 | 0.028 | 0.388 | 0.975 | 0.475 | -Inf | 7.365e-05 | 0.699
performance::check_model(anx7, panel = TRUE)

## Margins
cplot(anx7, "RPL_THEME1", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 1")

cplot(anx7, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 2")

cplot(anx7, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 3")

NA
NA
Any psych diagnosis + SVI: Multivariable Models
All variables
any_psysch1 <- glm(any_psych_dx_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + act_tob + RPL_THEMES,
family = "binomial",
data = mh_clean1)
summary(any_psysch1)
Call:
glm(formula = any_psych_dx_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + act_tob + RPL_THEMES, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.3074 -0.8904 -0.7075 1.3858 2.1339
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.3649992 0.0863822 -15.802 < 2e-16 ***
mstat_5Unknown 0.0222968 0.0549541 0.406 0.68494
mstat_5Unmarried 0.2363501 0.0516491 4.576 4.74e-06 ***
mstat_5DivorcedSeparated 0.5031975 0.1029791 4.886 1.03e-06 ***
mstat_5Widow 0.2125515 0.1329001 1.599 0.10975
lang_3Other -0.6478036 0.2529880 -2.561 0.01045 *
age_yrs 0.0011674 0.0011863 0.984 0.32506
race_5Black -0.0792196 0.0821456 -0.964 0.33486
race_5Other -0.0005795 0.1218343 -0.005 0.99621
race_5Asian -0.3882644 0.1455563 -2.667 0.00764 **
race_5Native 0.1813210 0.3012532 0.602 0.54725
relig_affilNo -0.0169427 0.0402766 -0.421 0.67400
genderFemale 0.5883005 0.0399306 14.733 < 2e-16 ***
ethnic_3Hispanic 0.0563055 0.1445278 0.390 0.69685
act_tobYes 0.3359978 0.0560331 5.996 2.02e-09 ***
RPL_THEMES -0.0181998 0.0784753 -0.232 0.81660
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 15974 on 13063 degrees of freedom
Residual deviance: 15631 on 13048 degrees of freedom
(2181 observations deleted due to missingness)
AIC: 15663
Number of Fisher Scoring iterations: 4
broom::glance(any_psysch1)
broom::tidy(any_psysch1, exponentiate = TRUE)
tbl_regression(any_psysch1, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.02 |
0.92, 1.14 |
0.7 |
| Â Â Â Â Unmarried |
1.27 |
1.14, 1.40 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.65 |
1.35, 2.02 |
<0.001 |
| Â Â Â Â Widow |
1.24 |
0.95, 1.60 |
0.11 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.52 |
0.31, 0.84 |
0.010 |
| Age |
1.00 |
1.00, 1.00 |
0.3 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.92 |
0.79, 1.08 |
0.3 |
| Â Â Â Â Other |
1.00 |
0.78, 1.27 |
>0.9 |
| Â Â Â Â Asian |
0.68 |
0.51, 0.90 |
0.008 |
| Â Â Â Â Native |
1.20 |
0.65, 2.14 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.98 |
0.91, 1.06 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.80 |
1.67, 1.95 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.06 |
0.79, 1.40 |
0.7 |
| act_tob |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.40 |
1.25, 1.56 |
<0.001 |
| Total SVI |
0.98 |
0.84, 1.15 |
0.8 |
## Performance
model_performance(any_psysch1)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
15663.320 | 15782.961 | 0.026 | 0.452 | 1.095 | 0.598 | -Inf | 9.416e-05 | 0.591
performance::check_model(any_psysch1, panel = TRUE)

## Margins
cplot(any_psysch1, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Anxiety Given SVI")

Drop tobacco use
any_psysch2 <- glm(any_psych_dx_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEMES,
family = "binomial",
data = mh_clean1)
summary(any_psysch2)
Call:
glm(formula = any_psych_dx_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEMES, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.2086 -0.8920 -0.7034 1.3917 2.1441
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.3577087 0.0848982 -15.992 < 2e-16 ***
mstat_5Unknown 0.0323999 0.0543072 0.597 0.55077
mstat_5Unmarried 0.2431264 0.0507381 4.792 1.65e-06 ***
mstat_5DivorcedSeparated 0.5471036 0.1008226 5.426 5.75e-08 ***
mstat_5Widow 0.2367913 0.1296047 1.827 0.06770 .
lang_3Other -0.6328962 0.2522135 -2.509 0.01209 *
age_yrs 0.0008319 0.0011632 0.715 0.47450
race_5Black -0.0987891 0.0808823 -1.221 0.22194
race_5Other -0.0061494 0.1208294 -0.051 0.95941
race_5Asian -0.4522210 0.1444426 -3.131 0.00174 **
race_5Native 0.2364849 0.2938798 0.805 0.42099
relig_affilNo -0.0058044 0.0396095 -0.147 0.88349
genderFemale 0.5892108 0.0393270 14.982 < 2e-16 ***
ethnic_3Hispanic 0.0323302 0.1432419 0.226 0.82143
RPL_THEMES 0.0110171 0.0763731 0.144 0.88530
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 16491 on 13625 degrees of freedom
Residual deviance: 16174 on 13611 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 16204
Number of Fisher Scoring iterations: 4
broom::glance(any_psysch2)
broom::tidy(any_psysch2, exponentiate = TRUE)
tbl_regression(any_psysch2, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.03 |
0.93, 1.15 |
0.6 |
| Â Â Â Â Unmarried |
1.28 |
1.15, 1.41 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.73 |
1.42, 2.10 |
<0.001 |
| Â Â Â Â Widow |
1.27 |
0.98, 1.63 |
0.068 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.53 |
0.32, 0.85 |
0.012 |
| Age |
1.00 |
1.00, 1.00 |
0.5 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.91 |
0.77, 1.06 |
0.2 |
| Â Â Â Â Other |
0.99 |
0.78, 1.26 |
>0.9 |
| Â Â Â Â Asian |
0.64 |
0.48, 0.84 |
0.002 |
| Â Â Â Â Native |
1.27 |
0.70, 2.23 |
0.4 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.99 |
0.92, 1.07 |
0.9 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.80 |
1.67, 1.95 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.03 |
0.78, 1.36 |
0.8 |
| Total SVI |
1.01 |
0.87, 1.17 |
0.9 |
## Performance
model_performance(any_psysch2)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
16204.305 | 16317.101 | 0.023 | 0.450 | 1.090 | 0.594 | -Inf | 1.056e-04 | 0.595
performance::check_model(any_psysch2, panel = TRUE)

## Margins
cplot(any_psysch2, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Anxiety Given SVI")

Quadratics
any_psysch3 <- glm(any_psych_dx_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 + relig_affil
+ gender + ethnic_3 + I(RPL_THEMES^2),
family = "binomial",
data = mh_clean1)
summary(any_psysch3)
Call:
glm(formula = any_psych_dx_2 ~ mstat_5 + lang_3 + I(age_yrs^2) +
race_5 + relig_affil + gender + ethnic_3 + I(RPL_THEMES^2),
family = "binomial", data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.2103 -0.8919 -0.7053 1.3913 2.1329
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.251e+00 6.212e-02 -20.133 < 2e-16 ***
mstat_5Unknown 6.280e-03 5.386e-02 0.117 0.9072
mstat_5Unmarried 2.013e-01 4.963e-02 4.056 4.99e-05 ***
mstat_5DivorcedSeparated 5.452e-01 1.008e-01 5.409 6.33e-08 ***
mstat_5Widow 2.900e-01 1.311e-01 2.212 0.0270 *
lang_3Other -6.269e-01 2.523e-01 -2.485 0.0130 *
I(age_yrs^2) -1.426e-05 1.131e-05 -1.261 0.2074
race_5Black -1.041e-01 8.140e-02 -1.279 0.2010
race_5Other -1.252e-02 1.208e-01 -0.104 0.9175
race_5Asian -4.679e-01 1.444e-01 -3.239 0.0012 **
race_5Native 2.356e-01 2.939e-01 0.802 0.4227
relig_affilNo -1.970e-02 3.968e-02 -0.496 0.6195
genderFemale 5.883e-01 3.933e-02 14.958 < 2e-16 ***
ethnic_3Hispanic 2.065e-02 1.432e-01 0.144 0.8853
I(RPL_THEMES^2) 1.856e-02 8.455e-02 0.220 0.8262
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 16491 on 13625 degrees of freedom
Residual deviance: 16173 on 13611 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 16203
Number of Fisher Scoring iterations: 4
broom::glance(any_psysch3)
broom::tidy(any_psysch3, exponentiate = TRUE)
tbl_regression(any_psysch3, label = list(gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.01 |
0.91, 1.12 |
>0.9 |
| Â Â Â Â Unmarried |
1.22 |
1.11, 1.35 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.72 |
1.41, 2.10 |
<0.001 |
| Â Â Â Â Widow |
1.34 |
1.03, 1.72 |
0.027 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.53 |
0.32, 0.86 |
0.013 |
| I(age_yrs^2) |
1.00 |
1.00, 1.00 |
0.2 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.90 |
0.77, 1.06 |
0.2 |
| Â Â Â Â Other |
0.99 |
0.78, 1.25 |
>0.9 |
| Â Â Â Â Asian |
0.63 |
0.47, 0.83 |
0.001 |
| Â Â Â Â Native |
1.27 |
0.70, 2.23 |
0.4 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.98 |
0.91, 1.06 |
0.6 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.80 |
1.67, 1.95 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.02 |
0.77, 1.35 |
0.9 |
| I(RPL_THEMES^2) |
1.02 |
0.86, 1.20 |
0.8 |
## Performance
model_performance(any_psysch3)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
2.298e+05 | 2.299e+05 | 0.023 | 0.450 | 1.090 | 0.593 | -Inf | 7.342e-05 | 0.595
performance::check_model(any_psysch3, panel = TRUE)

## Margins
cplot(any_psysch3, "RPL_THEMES", what = "prediction", main = "Percent Likelihood of Anxiety Given SVI")

SVI Quartiles
any_psysch4 <- glm(any_psych_dx_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_4,
family = "binomial",
data = mh_clean1)
summary(any_psysch4)
Call:
glm(formula = any_psych_dx_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_4, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.1884 -0.8897 -0.7080 1.3897 2.1490
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.3664033 0.0844261 -16.185 < 2e-16 ***
mstat_5Unknown 0.0332704 0.0542936 0.613 0.54002
mstat_5Unmarried 0.2438510 0.0507224 4.808 1.53e-06 ***
mstat_5DivorcedSeparated 0.5459511 0.1008007 5.416 6.09e-08 ***
mstat_5Widow 0.2373802 0.1296268 1.831 0.06706 .
lang_3Other -0.6329190 0.2522357 -2.509 0.01210 *
age_yrs 0.0008517 0.0011633 0.732 0.46409
race_5Black -0.1014334 0.0811602 -1.250 0.21138
race_5Other -0.0064084 0.1208587 -0.053 0.95771
race_5Asian -0.4538624 0.1444701 -3.142 0.00168 **
race_5Native 0.2301465 0.2938475 0.783 0.43350
relig_affilNo -0.0065512 0.0396196 -0.165 0.86867
genderFemale 0.5901262 0.0393383 15.001 < 2e-16 ***
ethnic_3Hispanic 0.0307404 0.1432661 0.215 0.83010
RPL_4Second 0.0430160 0.0461690 0.932 0.35149
RPL_4Third -0.0265842 0.0525645 -0.506 0.61304
RPL_4Fourth 0.0373017 0.0689595 0.541 0.58856
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 16491 on 13625 degrees of freedom
Residual deviance: 16172 on 13609 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 16206
Number of Fisher Scoring iterations: 4
broom::glance(any_psysch4)
broom::tidy(any_psysch4, exponentiate = TRUE)
tbl_regression(any_psysch4, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_4 ~ "SVI Quartiles", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.03 |
0.93, 1.15 |
0.5 |
| Â Â Â Â Unmarried |
1.28 |
1.16, 1.41 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
1.73 |
1.42, 2.10 |
<0.001 |
| Â Â Â Â Widow |
1.27 |
0.98, 1.63 |
0.067 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.53 |
0.32, 0.85 |
0.012 |
| Age |
1.00 |
1.00, 1.00 |
0.5 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.90 |
0.77, 1.06 |
0.2 |
| Â Â Â Â Other |
0.99 |
0.78, 1.26 |
>0.9 |
| Â Â Â Â Asian |
0.64 |
0.47, 0.84 |
0.002 |
| Â Â Â Â Native |
1.26 |
0.70, 2.22 |
0.4 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.99 |
0.92, 1.07 |
0.9 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.80 |
1.67, 1.95 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.03 |
0.78, 1.36 |
0.8 |
| SVI Quartiles |
|
|
|
| Â Â Â Â First |
— |
— |
|
| Â Â Â Â Second |
1.04 |
0.95, 1.14 |
0.4 |
| Â Â Â Â Third |
0.97 |
0.88, 1.08 |
0.6 |
| Â Â Â Â Fourth |
1.04 |
0.91, 1.19 |
0.6 |
## Performance
model_performance(any_psysch4)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
16206.351 | 16334.186 | 0.023 | 0.450 | 1.090 | 0.593 | -Inf | 7.344e-05 | 0.595
performance::check_model(any_psysch4, panel = TRUE)

## Margins
cplot(any_psysch4, "RPL_4", what = "prediction", main = "Percent Likelihood of Anxiety Given SVI")

Any Psych + All Themes: Multivariable Models
All variables
any1 <- glm(anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + act_tob + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = mh_clean1)
summary(any1)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + act_tob + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0973 -0.7164 -0.5906 -0.4641 2.5252
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.567056 0.109826 -14.268 < 2e-16 ***
mstat_5Unknown -0.003306 0.064357 -0.051 0.959030
mstat_5Unmarried 0.143499 0.059848 2.398 0.016498 *
mstat_5DivorcedSeparated 0.494210 0.114140 4.330 1.49e-05 ***
mstat_5Widow 0.165057 0.158445 1.042 0.297534
lang_3Other -0.986555 0.354987 -2.779 0.005450 **
age_yrs -0.007035 0.001391 -5.056 4.29e-07 ***
race_5Black -0.272264 0.099320 -2.741 0.006120 **
race_5Other 0.018301 0.138870 0.132 0.895154
race_5Asian -0.781346 0.190338 -4.105 4.04e-05 ***
race_5Native 0.266880 0.331607 0.805 0.420930
relig_affilNo -0.025640 0.046541 -0.551 0.581692
genderFemale 0.706886 0.047379 14.920 < 2e-16 ***
ethnic_3Hispanic -0.047351 0.166801 -0.284 0.776503
act_tobYes 0.353192 0.063406 5.570 2.54e-08 ***
RPL_THEME1 -0.135312 0.129897 -1.042 0.297559
RPL_THEME2 -0.246013 0.112549 -2.186 0.028828 *
RPL_THEME3 0.280499 0.082495 3.400 0.000673 ***
RPL_THEME4 0.026648 0.094050 0.283 0.776920
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12908 on 12995 degrees of freedom
Residual deviance: 12519 on 12977 degrees of freedom
(2249 observations deleted due to missingness)
AIC: 12557
Number of Fisher Scoring iterations: 4
broom::glance(any1)
broom::tidy(any1, exponentiate = TRUE)
tbl_regression(any1, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", mstat_5 ~ "Marital Status", act_tob ~ "Active Tobacco Use"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.00 |
0.88, 1.13 |
>0.9 |
| Â Â Â Â Unmarried |
1.15 |
1.03, 1.30 |
0.016 |
| Â Â Â Â DivorcedSeparated |
1.64 |
1.31, 2.05 |
<0.001 |
| Â Â Â Â Widow |
1.18 |
0.86, 1.60 |
0.3 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.37 |
0.17, 0.71 |
0.005 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.76 |
0.63, 0.92 |
0.006 |
| Â Â Â Â Other |
1.02 |
0.77, 1.33 |
0.9 |
| Â Â Â Â Asian |
0.46 |
0.31, 0.66 |
<0.001 |
| Â Â Â Â Native |
1.31 |
0.66, 2.44 |
0.4 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.97 |
0.89, 1.07 |
0.6 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.03 |
1.85, 2.23 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.95 |
0.68, 1.31 |
0.8 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.42 |
1.26, 1.61 |
<0.001 |
| Soceioeconomic Status |
0.87 |
0.68, 1.13 |
0.3 |
| Household Composition |
0.78 |
0.63, 0.97 |
0.029 |
| Minority Status and Language |
1.32 |
1.13, 1.56 |
<0.001 |
| Housing and Transportation |
1.03 |
0.85, 1.23 |
0.8 |
## Model performance
model_performance(any1)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12556.821 | 12698.797 | 0.030 | 0.392 | 0.982 | 0.482 | -Inf | 7.735e-05 | 0.693
performance::check_model(any1, panel = TRUE)

## Margins
cplot(any1, "RPL_THEME1", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 1")

cplot(any1, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 2")

cplot(any1, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 3")

cplot(any1, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 4")

Drop tobaccoo
any2 <- glm(anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = mh_clean1)
summary(any2)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEME1 + RPL_THEME2 +
RPL_THEME3 + RPL_THEME4, family = "binomial", data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.9953 -0.7080 -0.5841 -0.4684 2.5124
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.562936 0.108301 -14.431 < 2e-16 ***
mstat_5Unknown 0.014565 0.063713 0.229 0.819182
mstat_5Unmarried 0.152529 0.059076 2.582 0.009826 **
mstat_5DivorcedSeparated 0.563533 0.111958 5.033 4.82e-07 ***
mstat_5Widow 0.186941 0.155151 1.205 0.228243
lang_3Other -0.980860 0.354259 -2.769 0.005627 **
age_yrs -0.007109 0.001368 -5.195 2.05e-07 ***
race_5Black -0.279687 0.098290 -2.846 0.004434 **
race_5Other 0.017954 0.138012 0.130 0.896497
race_5Asian -0.830135 0.189567 -4.379 1.19e-05 ***
race_5Native 0.245188 0.328209 0.747 0.455033
relig_affilNo -0.015135 0.045932 -0.330 0.741771
genderFemale 0.701715 0.046800 14.994 < 2e-16 ***
ethnic_3Hispanic -0.059407 0.165726 -0.358 0.719996
RPL_THEME1 -0.087447 0.127757 -0.684 0.493675
RPL_THEME2 -0.233475 0.111142 -2.101 0.035668 *
RPL_THEME3 0.268869 0.081467 3.300 0.000966 ***
RPL_THEME4 0.006252 0.092866 0.067 0.946326
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13259 on 13555 degrees of freedom
Residual deviance: 12890 on 13538 degrees of freedom
(1689 observations deleted due to missingness)
AIC: 12926
Number of Fisher Scoring iterations: 4
broom::glance(any2)
broom::tidy(any2, exponentiate = TRUE)
tbl_regression(any2, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.01 |
0.90, 1.15 |
0.8 |
| Â Â Â Â Unmarried |
1.16 |
1.04, 1.31 |
0.010 |
| Â Â Â Â DivorcedSeparated |
1.76 |
1.41, 2.18 |
<0.001 |
| Â Â Â Â Widow |
1.21 |
0.88, 1.62 |
0.2 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.37 |
0.17, 0.71 |
0.006 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.76 |
0.62, 0.91 |
0.004 |
| Â Â Â Â Other |
1.02 |
0.77, 1.33 |
0.9 |
| Â Â Â Â Asian |
0.44 |
0.30, 0.62 |
<0.001 |
| Â Â Â Â Native |
1.28 |
0.65, 2.37 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.98 |
0.90, 1.08 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.02 |
1.84, 2.21 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.94 |
0.68, 1.29 |
0.7 |
| Soceioeconomic Status |
0.92 |
0.71, 1.18 |
0.5 |
| Household Composition |
0.79 |
0.64, 0.98 |
0.036 |
| Minority Status and Language |
1.31 |
1.12, 1.54 |
<0.001 |
| Housing and Transportation |
1.01 |
0.84, 1.21 |
>0.9 |
## Model performance
model_performance(any2)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12926.001 | 13061.263 | 0.027 | 0.388 | 0.976 | 0.475 | -Inf | 7.395e-05 | 0.698
performance::check_model(any2, panel = TRUE)

## Margins
cplot(any2, "RPL_THEME1", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 1")

cplot(any2, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 2")

cplot(any2, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 3")

cplot(any2, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Anxiety Given Theme 4")

Minority status and household composition
any4 <- glm(anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEME2 + RPL_THEME3,
family = "binomial",
data = mh_clean1)
summary(any4)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEME2 + RPL_THEME3,
family = "binomial", data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0077 -0.7081 -0.5850 -0.4694 2.5046
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.560296 0.107214 -14.553 < 2e-16 ***
mstat_5Unknown 0.017029 0.063417 0.269 0.788297
mstat_5Unmarried 0.150799 0.058721 2.568 0.010226 *
mstat_5DivorcedSeparated 0.557321 0.111669 4.991 6.01e-07 ***
mstat_5Widow 0.176990 0.154985 1.142 0.253461
lang_3Other -0.992342 0.354120 -2.802 0.005074 **
age_yrs -0.007150 0.001365 -5.238 1.62e-07 ***
race_5Black -0.293106 0.097091 -3.019 0.002537 **
race_5Other 0.003458 0.137962 0.025 0.980002
race_5Asian -0.832852 0.189501 -4.395 1.11e-05 ***
race_5Native 0.225065 0.327020 0.688 0.491307
relig_affilNo -0.016651 0.045765 -0.364 0.715985
genderFemale 0.698725 0.046640 14.981 < 2e-16 ***
ethnic_3Hispanic -0.069135 0.165659 -0.417 0.676433
RPL_THEME2 -0.282472 0.085435 -3.306 0.000945 ***
RPL_THEME3 0.260586 0.080209 3.249 0.001159 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13329 on 13625 degrees of freedom
Residual deviance: 12960 on 13610 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 12992
Number of Fisher Scoring iterations: 5
broom::glance(any4)
broom::tidy(any4, exponentiate = TRUE)
tbl_regression(any4, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.02 |
0.90, 1.15 |
0.8 |
| Â Â Â Â Unmarried |
1.16 |
1.04, 1.30 |
0.010 |
| Â Â Â Â DivorcedSeparated |
1.75 |
1.40, 2.17 |
<0.001 |
| Â Â Â Â Widow |
1.19 |
0.87, 1.61 |
0.3 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.37 |
0.17, 0.70 |
0.005 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.75 |
0.61, 0.90 |
0.003 |
| Â Â Â Â Other |
1.00 |
0.76, 1.31 |
>0.9 |
| Â Â Â Â Asian |
0.43 |
0.29, 0.62 |
<0.001 |
| Â Â Â Â Native |
1.25 |
0.64, 2.32 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.98 |
0.90, 1.08 |
0.7 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.01 |
1.84, 2.20 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.93 |
0.67, 1.28 |
0.7 |
| Household Composition |
0.75 |
0.64, 0.89 |
<0.001 |
| Minority Status and Language |
1.30 |
1.11, 1.52 |
0.001 |
## Model performance
model_performance(any4)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
12992.096 | 13112.412 | 0.027 | 0.389 | 0.976 | 0.476 | -Inf | 8.685e-05 | 0.698
performance::check_model(any4, panel = TRUE)

## Margins
cplot(any4, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Any Given Theme 2")

cplot(any4, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Any Given Theme 3")

Quadratics
any5 <- glm(anxiety_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 + relig_affil
+ gender + ethnic_3 + I(RPL_THEME2^2) + I(RPL_THEME3^2),
family = "binomial",
data = mh_clean1)
summary(any5)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + I(age_yrs^2) + race_5 +
relig_affil + gender + ethnic_3 + I(RPL_THEME2^2) + I(RPL_THEME3^2),
family = "binomial", data = mh_clean1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0251 -0.7080 -0.5868 -0.4584 2.5221
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.667e+00 7.733e-02 -21.556 < 2e-16 ***
mstat_5Unknown 3.239e-03 6.286e-02 0.052 0.95890
mstat_5Unmarried 1.286e-01 5.745e-02 2.239 0.02517 *
mstat_5DivorcedSeparated 5.509e-01 1.118e-01 4.927 8.37e-07 ***
mstat_5Widow 2.766e-01 1.570e-01 1.762 0.07811 .
lang_3Other -1.005e+00 3.545e-01 -2.835 0.00459 **
I(age_yrs^2) -9.149e-05 1.364e-05 -6.707 1.99e-11 ***
race_5Black -3.141e-01 9.758e-02 -3.219 0.00129 **
race_5Other -7.536e-03 1.381e-01 -0.055 0.95649
race_5Asian -8.547e-01 1.896e-01 -4.508 6.54e-06 ***
race_5Native 2.245e-01 3.270e-01 0.686 0.49245
relig_affilNo -3.007e-02 4.588e-02 -0.655 0.51218
genderFemale 6.938e-01 4.667e-02 14.867 < 2e-16 ***
ethnic_3Hispanic -7.088e-02 1.657e-01 -0.428 0.66878
I(RPL_THEME2^2) -2.640e-01 9.181e-02 -2.876 0.00403 **
I(RPL_THEME3^2) 3.213e-01 7.869e-02 4.083 4.45e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13329 on 13625 degrees of freedom
Residual deviance: 12938 on 13610 degrees of freedom
(1619 observations deleted due to missingness)
AIC: 12970
Number of Fisher Scoring iterations: 5
broom::glance(any5)
broom::tidy(any5, exponentiate = TRUE)
tbl_regression(any5, label = list(gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.00 |
0.89, 1.13 |
>0.9 |
| Â Â Â Â Unmarried |
1.14 |
1.02, 1.27 |
0.025 |
| Â Â Â Â DivorcedSeparated |
1.73 |
1.39, 2.15 |
<0.001 |
| Â Â Â Â Widow |
1.32 |
0.96, 1.78 |
0.078 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.37 |
0.17, 0.69 |
0.005 |
| I(age_yrs^2) |
1.00 |
1.00, 1.00 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.73 |
0.60, 0.88 |
0.001 |
| Â Â Â Â Other |
0.99 |
0.75, 1.29 |
>0.9 |
| Â Â Â Â Asian |
0.43 |
0.29, 0.61 |
<0.001 |
| Â Â Â Â Native |
1.25 |
0.64, 2.32 |
0.5 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.97 |
0.89, 1.06 |
0.5 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
2.00 |
1.83, 2.19 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.93 |
0.67, 1.28 |
0.7 |
| I(RPL_THEME2^2) |
0.77 |
0.64, 0.92 |
0.004 |
| I(RPL_THEME3^2) |
1.38 |
1.18, 1.61 |
<0.001 |
## Model performance
model_performance(any5)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------
1.791e+05 | 1.793e+05 | 0.028 | 0.388 | 0.975 | 0.475 | -Inf | 9.976e-05 | 0.699
performance::check_model(any5, panel = TRUE)

## Margins
cplot(any5, "RPL_THEME2", what = "prediction", main = "Percent Likelihood of Any Given Theme 2")

cplot(any5, "RPL_THEME3", what = "prediction", main = "Percent Likelihood of Any Given Theme 3")

GAD Models
Bivariate analysis of GAD7
tbl_uv_gad7 <-
tbl_uvregression(
mh_vax2[c("gad_score", "age_yrs", "gender", "race_5", "ethnic_3", "lang_3", "relig_affil", "mstat_5", "RPL_THEMES", "RPL_THEME1", "RPL_THEME2", "RPL_THEME3", "RPL_THEME4", "act_tob")],
method = lm,
y = gad_score,
label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status", RPL_THEMES ~ "Total SVI", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", act_tob ~ "Active Tobacco Use"))
print(tbl_uv_gad7, method = render)
`...` must be empty.
✖ Problematic argument:
• method = render
| Characteristic |
N |
Beta |
95% CI |
p-value |
| Age |
1,231 |
-0.08 |
-0.10, -0.06 |
<0.001 |
| Gender |
1,231 |
|
|
|
| Â Â Â Â Male |
|
— |
— |
|
| Â Â Â Â Female |
|
1.9 |
1.1, 2.6 |
<0.001 |
| Race |
1,231 |
|
|
|
| Â Â Â Â White |
|
— |
— |
|
| Â Â Â Â Black |
|
0.40 |
-1.0, 1.8 |
0.6 |
| Â Â Â Â Other |
|
-0.08 |
-2.0, 1.9 |
>0.9 |
| Â Â Â Â Asian |
|
-1.2 |
-3.3, 0.83 |
0.2 |
| Â Â Â Â Native |
|
-0.70 |
-6.0, 4.6 |
0.8 |
| Ethnicity |
1,204 |
|
|
|
| Â Â Â Â NonHispanic |
|
— |
— |
|
| Â Â Â Â Hispanic |
|
-1.1 |
-3.6, 1.5 |
0.4 |
| English Speaking |
1,231 |
|
|
|
| Â Â Â Â English |
|
— |
— |
|
| Â Â Â Â Other |
|
2.2 |
-2.8, 7.1 |
0.4 |
| Any Religious Affiliation |
1,204 |
|
|
|
| Â Â Â Â Yes |
|
— |
— |
|
| Â Â Â Â No |
|
0.64 |
-0.12, 1.4 |
0.10 |
| Marital Status |
1,231 |
|
|
|
| Â Â Â Â Married |
|
— |
— |
|
| Â Â Â Â Unknown |
|
2.0 |
0.93, 3.1 |
<0.001 |
| Â Â Â Â Unmarried |
|
2.2 |
1.4, 3.1 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
|
3.2 |
1.6, 4.9 |
<0.001 |
| Â Â Â Â Widow |
|
0.24 |
-2.4, 2.9 |
0.9 |
| Total SVI |
1,216 |
2.4 |
0.88, 4.0 |
0.002 |
| Soceioeconomic Status |
1,205 |
3.2 |
1.7, 4.8 |
<0.001 |
| Household Composition |
1,216 |
1.8 |
0.31, 3.3 |
0.018 |
| Minority Status and Language |
1,216 |
-0.09 |
-1.4, 1.2 |
0.9 |
| Housing and Transportation |
1,215 |
1.1 |
-0.23, 2.4 |
0.10 |
| Active Tobacco Use |
1,226 |
|
|
|
| Â Â Â Â No |
|
— |
— |
|
| Â Â Â Â Yes |
|
3.1 |
1.9, 4.3 |
<0.001 |
NULL
Gad7 + RPL THEMES
gad1 <- lm(gad_score ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEMES,
data = mh_vax2)
summary(gad1)
Call:
lm(formula = gad_score ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEMES, data = mh_vax2)
Residuals:
Min 1Q Median 3Q Max
-12.5572 -5.3993 -0.6006 4.8596 16.3463
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.88088 0.83970 11.767 < 2e-16 ***
mstat_5Unknown 1.21185 0.59039 2.053 0.040336 *
mstat_5Unmarried 0.89356 0.47854 1.867 0.062119 .
mstat_5DivorcedSeparated 3.08246 0.83592 3.687 0.000237 ***
mstat_5Widow 1.66330 1.39045 1.196 0.231855
lang_3Other 2.70090 2.69667 1.002 0.316764
age_yrs -0.07342 0.01228 -5.980 2.99e-09 ***
race_5Black -0.80401 0.73681 -1.091 0.275412
race_5Other 0.45745 1.13864 0.402 0.687942
race_5Asian -1.12551 1.05779 -1.064 0.287545
race_5Native -0.72333 2.66273 -0.272 0.785942
relig_affilNo 0.23645 0.39565 0.598 0.550221
genderFemale 1.90196 0.40444 4.703 2.88e-06 ***
ethnic_3Hispanic -1.61611 1.36551 -1.184 0.236848
RPL_THEMES 1.62611 0.81907 1.985 0.047347 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 6.397 on 1147 degrees of freedom
(14083 observations deleted due to missingness)
Multiple R-squared: 0.08365, Adjusted R-squared: 0.07247
F-statistic: 7.479 on 14 and 1147 DF, p-value: 3.453e-15
broom::glance(gad1)
broom::tidy(gad1)
tbl_regression(gad1, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status"))
| Characteristic |
Beta |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.2 |
0.05, 2.4 |
0.040 |
| Â Â Â Â Unmarried |
0.89 |
-0.05, 1.8 |
0.062 |
| Â Â Â Â DivorcedSeparated |
3.1 |
1.4, 4.7 |
<0.001 |
| Â Â Â Â Widow |
1.7 |
-1.1, 4.4 |
0.2 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
2.7 |
-2.6, 8.0 |
0.3 |
| Age |
-0.07 |
-0.10, -0.05 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
-0.80 |
-2.2, 0.64 |
0.3 |
| Â Â Â Â Other |
0.46 |
-1.8, 2.7 |
0.7 |
| Â Â Â Â Asian |
-1.1 |
-3.2, 0.95 |
0.3 |
| Â Â Â Â Native |
-0.72 |
-5.9, 4.5 |
0.8 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.24 |
-0.54, 1.0 |
0.6 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.9 |
1.1, 2.7 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
-1.6 |
-4.3, 1.1 |
0.2 |
| Total SVI |
1.6 |
0.02, 3.2 |
0.047 |
## Model performance
model_performance(gad1)
# Indices of model performance
AIC | BIC | R2 | R2 (adj.) | RMSE | Sigma
-------------------------------------------------------
7627.585 | 7708.511 | 0.084 | 0.072 | 6.356 | 6.397
performance::check_model(gad1, panel = TRUE)

## Margins
cplot(gad1, "RPL_THEMES", what = "prediction", main = "Predicted GAD7 Given SVI")

Gad7 + All themes
gad2 <- lm(gad_score ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 +
RPL_THEME4,
data = mh_vax2)
summary(gad2)
Call:
lm(formula = gad_score ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_THEME1 + RPL_THEME2 +
RPL_THEME3 + RPL_THEME4, data = mh_vax2)
Residuals:
Min 1Q Median 3Q Max
-12.9429 -5.2413 -0.5629 4.9071 16.3451
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.81394 0.92823 10.573 < 2e-16 ***
mstat_5Unknown 1.11006 0.59578 1.863 0.062694 .
mstat_5Unmarried 0.83905 0.48069 1.745 0.081170 .
mstat_5DivorcedSeparated 3.04227 0.83672 3.636 0.000289 ***
mstat_5Widow 1.52601 1.39298 1.095 0.273533
lang_3Other 2.65717 2.69707 0.985 0.324733
age_yrs -0.07220 0.01237 -5.838 6.91e-09 ***
race_5Black -0.80258 0.74041 -1.084 0.278611
race_5Other 0.55366 1.13884 0.486 0.626947
race_5Asian -0.92318 1.07756 -0.857 0.391771
race_5Native -0.63005 2.67234 -0.236 0.813657
relig_affilNo 0.22480 0.39832 0.564 0.572608
genderFemale 1.91966 0.40697 4.717 2.69e-06 ***
ethnic_3Hispanic -1.61644 1.36736 -1.182 0.237389
RPL_THEME1 2.05418 1.09309 1.879 0.060469 .
RPL_THEME2 0.49171 0.94394 0.521 0.602529
RPL_THEME3 -0.16806 0.69507 -0.242 0.808983
RPL_THEME4 -0.29956 0.78949 -0.379 0.704438
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 6.392 on 1132 degrees of freedom
(14095 observations deleted due to missingness)
Multiple R-squared: 0.0861, Adjusted R-squared: 0.07238
F-statistic: 6.274 on 17 and 1132 DF, p-value: 2.939e-14
broom::glance(gad2)
broom::tidy(gad2)
tbl_regression(gad2, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", mstat_5 ~ "Marital Status"))
| Characteristic |
Beta |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.1 |
-0.06, 2.3 |
0.063 |
| Â Â Â Â Unmarried |
0.84 |
-0.10, 1.8 |
0.081 |
| Â Â Â Â DivorcedSeparated |
3.0 |
1.4, 4.7 |
<0.001 |
| Â Â Â Â Widow |
1.5 |
-1.2, 4.3 |
0.3 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
2.7 |
-2.6, 7.9 |
0.3 |
| Age |
-0.07 |
-0.10, -0.05 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
-0.80 |
-2.3, 0.65 |
0.3 |
| Â Â Â Â Other |
0.55 |
-1.7, 2.8 |
0.6 |
| Â Â Â Â Asian |
-0.92 |
-3.0, 1.2 |
0.4 |
| Â Â Â Â Native |
-0.63 |
-5.9, 4.6 |
0.8 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.22 |
-0.56, 1.0 |
0.6 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.9 |
1.1, 2.7 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
-1.6 |
-4.3, 1.1 |
0.2 |
| Soceioeconomic Status |
2.1 |
-0.09, 4.2 |
0.060 |
| Household Composition |
0.49 |
-1.4, 2.3 |
0.6 |
| Minority Status and Language |
-0.17 |
-1.5, 1.2 |
0.8 |
| Housing and Transportation |
-0.30 |
-1.8, 1.2 |
0.7 |
## Model performance
model_performance(gad2)
# Indices of model performance
AIC | BIC | R2 | R2 (adj.) | RMSE | Sigma
-------------------------------------------------------
7550.021 | 7645.924 | 0.086 | 0.072 | 6.342 | 6.392
performance::check_model(gad2, panel = TRUE)

## Margins
cplot(gad2, "RPL_THEME1", what = "prediction", main = "Predicted GAD7 Given THEME1")

cplot(gad2, "RPL_THEME2", what = "prediction", main = "Predicted GAD7 Given THEME2")

cplot(gad2, "RPL_THEME3", what = "prediction", main = "Predicted GAD7 Given THEME3")

cplot(gad2, "RPL_THEME4", what = "prediction", main = "Predicted GAD7 Given THEME4")

GAD7 + SVI Quartile
gad3 <- lm(gad_score ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + RPL_4,
data = mh_vax2)
summary(gad3)
Call:
lm(formula = gad_score ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + RPL_4, data = mh_vax2)
Residuals:
Min 1Q Median 3Q Max
-12.8531 -5.3561 -0.5154 4.9130 17.3263
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.93974 0.82911 11.988 < 2e-16 ***
mstat_5Unknown 1.25593 0.59044 2.127 0.03362 *
mstat_5Unmarried 0.93633 0.47659 1.965 0.04970 *
mstat_5DivorcedSeparated 3.13388 0.83395 3.758 0.00018 ***
mstat_5Widow 1.60291 1.38836 1.155 0.24852
lang_3Other 2.67037 2.69674 0.990 0.32228
age_yrs -0.07362 0.01226 -6.003 2.60e-09 ***
race_5Black -0.52523 0.73347 -0.716 0.47409
race_5Other 0.44274 1.13711 0.389 0.69709
race_5Asian -1.15262 1.05686 -1.091 0.27567
race_5Native -1.17534 2.66830 -0.440 0.65967
relig_affilNo 0.26460 0.39515 0.670 0.50324
genderFemale 1.91338 0.40368 4.740 2.41e-06 ***
ethnic_3Hispanic -1.64583 1.36630 -1.205 0.22861
RPL_4Second 1.07747 0.43971 2.450 0.01442 *
RPL_4Third -0.14802 0.55913 -0.265 0.79126
RPL_4Fourth 1.57890 0.82084 1.924 0.05466 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 6.387 on 1145 degrees of freedom
(14083 observations deleted due to missingness)
Multiple R-squared: 0.08832, Adjusted R-squared: 0.07558
F-statistic: 6.932 on 16 and 1145 DF, p-value: 2.058e-15
broom::glance(gad3)
broom::tidy(gad3)
tbl_regression(gad3, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_4 ~ "SVI Quartile", mstat_5 ~ "Marital Status"))
| Characteristic |
Beta |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.3 |
0.10, 2.4 |
0.034 |
| Â Â Â Â Unmarried |
0.94 |
0.00, 1.9 |
0.050 |
| Â Â Â Â DivorcedSeparated |
3.1 |
1.5, 4.8 |
<0.001 |
| Â Â Â Â Widow |
1.6 |
-1.1, 4.3 |
0.2 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
2.7 |
-2.6, 8.0 |
0.3 |
| Age |
-0.07 |
-0.10, -0.05 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
-0.53 |
-2.0, 0.91 |
0.5 |
| Â Â Â Â Other |
0.44 |
-1.8, 2.7 |
0.7 |
| Â Â Â Â Asian |
-1.2 |
-3.2, 0.92 |
0.3 |
| Â Â Â Â Native |
-1.2 |
-6.4, 4.1 |
0.7 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.26 |
-0.51, 1.0 |
0.5 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.9 |
1.1, 2.7 |
<0.001 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
-1.6 |
-4.3, 1.0 |
0.2 |
| SVI Quartile |
|
|
|
| Â Â Â Â First |
— |
— |
|
| Â Â Â Â Second |
1.1 |
0.21, 1.9 |
0.014 |
| Â Â Â Â Third |
-0.15 |
-1.2, 0.95 |
0.8 |
| Â Â Â Â Fourth |
1.6 |
-0.03, 3.2 |
0.055 |
## Model performance
model_performance(gad3)
# Indices of model performance
AIC | BIC | R2 | R2 (adj.) | RMSE | Sigma
-------------------------------------------------------
7625.652 | 7716.694 | 0.088 | 0.076 | 6.340 | 6.387
performance::check_model(gad3, panel = TRUE)

## Margins
cplot(gad3, "RPL_4", what = "prediction", main = "Predicted GAD7 Given SVI Quartile")

Anxiety model with GAD7
gad4 <- glm(anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 + relig_affil
+ gender + ethnic_3 + gad_score + RPL_THEMES,
family = "binomial",
data = mh_vax2)
summary(gad4)
Call:
glm(formula = anxiety_2 ~ mstat_5 + lang_3 + age_yrs + race_5 +
relig_affil + gender + ethnic_3 + gad_score + RPL_THEMES,
family = "binomial", data = mh_vax2)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.5106 -0.9291 0.4654 0.8484 2.1514
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.383006 0.315600 -1.214 0.22491
mstat_5Unknown -0.278835 0.214524 -1.300 0.19368
mstat_5Unmarried -0.010574 0.174913 -0.060 0.95179
mstat_5DivorcedSeparated 0.081903 0.318691 0.257 0.79718
mstat_5Widow -0.123698 0.491385 -0.252 0.80125
lang_3Other -0.346967 0.959062 -0.362 0.71752
age_yrs -0.009976 0.004451 -2.241 0.02502 *
race_5Black -0.386235 0.268270 -1.440 0.14995
race_5Other 0.617484 0.451347 1.368 0.17128
race_5Asian -1.543481 0.410505 -3.760 0.00017 ***
race_5Native 1.733021 1.248931 1.388 0.16526
relig_affilNo -0.103260 0.145255 -0.711 0.47715
genderFemale 0.429909 0.146729 2.930 0.00339 **
ethnic_3Hispanic -0.959273 0.505417 -1.898 0.05770 .
gad_score 0.161012 0.012346 13.041 < 2e-16 ***
RPL_THEMES -0.190079 0.301865 -0.630 0.52890
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1545.7 on 1161 degrees of freedom
Residual deviance: 1256.0 on 1146 degrees of freedom
(14083 observations deleted due to missingness)
AIC: 1288
Number of Fisher Scoring iterations: 4
broom::glance(gad4)
broom::tidy(gad4, exponentiate = TRUE)
model_performance(gad4)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
------------------------------------------------------------------------------------------------
1288.046 | 1368.972 | 0.234 | 0.424 | 1.047 | 0.540 | -Inf | 8.899e-04 | 0.638
tbl_regression(gad4, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status", gad_score ~ "GAD7 Score"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
0.76 |
0.50, 1.15 |
0.2 |
| Â Â Â Â Unmarried |
0.99 |
0.70, 1.39 |
>0.9 |
| Â Â Â Â DivorcedSeparated |
1.09 |
0.59, 2.06 |
0.8 |
| Â Â Â Â Widow |
0.88 |
0.34, 2.35 |
0.8 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.71 |
0.10, 4.84 |
0.7 |
| Age |
0.99 |
0.98, 1.00 |
0.025 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.68 |
0.40, 1.15 |
0.15 |
| Â Â Â Â Other |
1.85 |
0.78, 4.65 |
0.2 |
| Â Â Â Â Asian |
0.21 |
0.09, 0.47 |
<0.001 |
| Â Â Â Â Native |
5.66 |
0.65, 130 |
0.2 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.90 |
0.68, 1.20 |
0.5 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.54 |
1.15, 2.05 |
0.003 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.38 |
0.14, 1.02 |
0.058 |
| GAD7 Score |
1.17 |
1.15, 1.20 |
<0.001 |
| Total SVI |
0.83 |
0.46, 1.50 |
0.5 |
## Performance
model_performance(gad4)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
------------------------------------------------------------------------------------------------
1288.046 | 1368.972 | 0.234 | 0.424 | 1.047 | 0.540 | -Inf | 8.899e-04 | 0.638
performance::check_model(gad4, panel = TRUE)

## Margins
cplot(gad4, "gad_score", what = "prediction", main = "Percent Likelihood of Anxiety Given Gad")

GAD7 Logistic
mh_vax2$gad_2 <- cut(mh_vax2$gad_score,
breaks=c(0, 9, 21),
labels=c('None_mild', 'mod_severe'))
gad5 <- glm(gad_2 ~age_yrs + gender + race_5 + ethnic_3 + lang_3 + mstat_5 + relig_affil + RPL_THEMES,
family = "binomial",
data = mh_vax2)
summary(gad5)
Call:
glm(formula = gad_2 ~ age_yrs + gender + race_5 + ethnic_3 +
lang_3 + mstat_5 + relig_affil + RPL_THEMES, family = "binomial",
data = mh_vax2)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.8550 -1.1533 0.8583 1.0930 1.5940
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.40904 0.28692 1.426 0.15397
age_yrs -0.01735 0.00427 -4.064 4.82e-05 ***
genderFemale 0.26218 0.14151 1.853 0.06393 .
race_5Black -0.28909 0.25407 -1.138 0.25518
race_5Other 0.28790 0.41040 0.702 0.48299
race_5Asian -0.30770 0.36784 -0.837 0.40287
race_5Native 0.93759 1.17671 0.797 0.42557
ethnic_3Hispanic -0.45699 0.52454 -0.871 0.38364
lang_3Other 0.19375 0.85860 0.226 0.82147
mstat_5Unknown 0.33903 0.20214 1.677 0.09351 .
mstat_5Unmarried 0.26315 0.16171 1.627 0.10368
mstat_5DivorcedSeparated 0.73731 0.28258 2.609 0.00908 **
mstat_5Widow 0.23108 0.48666 0.475 0.63490
relig_affilNo -0.07348 0.13581 -0.541 0.58847
RPL_THEMES 0.48843 0.28211 1.731 0.08340 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1398.4 on 1009 degrees of freedom
Residual deviance: 1353.5 on 995 degrees of freedom
(14235 observations deleted due to missingness)
AIC: 1383.5
Number of Fisher Scoring iterations: 4
broom::glance(gad5)
broom::tidy(gad5, exponentiate = TRUE)
model_performance(gad5)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
------------------------------------------------------------------------------------------------
1383.492 | 1457.258 | 0.044 | 0.488 | 1.166 | 0.670 | -Inf | 0.001 | 0.523
tbl_regression(gad5, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "Preferred Language", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
0.98 |
0.97, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.30 |
0.99, 1.72 |
0.064 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.75 |
0.45, 1.23 |
0.3 |
| Â Â Â Â Other |
1.33 |
0.60, 3.07 |
0.5 |
| Â Â Â Â Asian |
0.74 |
0.35, 1.51 |
0.4 |
| Â Â Â Â Native |
2.55 |
0.31, 52.8 |
0.4 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
0.63 |
0.22, 1.79 |
0.4 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.21 |
0.21, 7.02 |
0.8 |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.40 |
0.95, 2.09 |
0.094 |
| Â Â Â Â Unmarried |
1.30 |
0.95, 1.79 |
0.10 |
| Â Â Â Â DivorcedSeparated |
2.09 |
1.21, 3.68 |
0.009 |
| Â Â Â Â Widow |
1.26 |
0.47, 3.25 |
0.6 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.93 |
0.71, 1.21 |
0.6 |
| Total SVI |
1.63 |
0.94, 2.84 |
0.083 |
## Performance
model_performance(gad5)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
------------------------------------------------------------------------------------------------
1383.492 | 1457.258 | 0.044 | 0.488 | 1.166 | 0.670 | -Inf | 0.001 | 0.523
performance::check_model(gad5, panel = TRUE)

PHQ9 Models
Bivariate Analysis
tbl_uv_phq9 <-
tbl_uvregression(
mh_vax2[c("phq_score", "age_yrs", "gender", "race_5", "ethnic_3", "lang_3", "relig_affil", "mstat_5", "RPL_THEMES", "RPL_THEME1", "RPL_THEME2", "RPL_THEME3", "RPL_THEME4", "act_tob")],
method = lm,
y = phq_score,
label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status", RPL_THEMES ~ "Total SVI", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", act_tob ~ "Active Tobacco Use"))
print(tbl_uv_phq9, method = render)
`...` must be empty.
✖ Problematic argument:
• method = render
| Characteristic |
N |
Beta |
95% CI |
p-value |
| Age |
2,211 |
-0.04 |
-0.05, -0.03 |
<0.001 |
| Gender |
2,211 |
|
|
|
| Â Â Â Â Male |
|
— |
— |
|
| Â Â Â Â Female |
|
2.0 |
1.4, 2.6 |
<0.001 |
| Race |
2,211 |
|
|
|
| Â Â Â Â White |
|
— |
— |
|
| Â Â Â Â Black |
|
1.5 |
0.31, 2.6 |
0.013 |
| Â Â Â Â Other |
|
0.11 |
-1.4, 1.6 |
0.9 |
| Â Â Â Â Asian |
|
-1.3 |
-2.8, 0.13 |
0.075 |
| Â Â Â Â Native |
|
2.0 |
-1.9, 6.0 |
0.3 |
| Ethnicity |
2,157 |
|
|
|
| Â Â Â Â NonHispanic |
|
— |
— |
|
| Â Â Â Â Hispanic |
|
0.13 |
-1.9, 2.1 |
0.9 |
| English Speaking |
2,211 |
|
|
|
| Â Â Â Â English |
|
— |
— |
|
| Â Â Â Â Other |
|
-0.41 |
-3.1, 2.3 |
0.8 |
| Any Religious Affiliation |
2,157 |
|
|
|
| Â Â Â Â Yes |
|
— |
— |
|
| Â Â Â Â No |
|
0.52 |
-0.07, 1.1 |
0.086 |
| Marital Status |
2,211 |
|
|
|
| Â Â Â Â Married |
|
— |
— |
|
| Â Â Â Â Unknown |
|
1.5 |
0.69, 2.4 |
<0.001 |
| Â Â Â Â Unmarried |
|
2.2 |
1.5, 2.8 |
<0.001 |
| Â Â Â Â DivorcedSeparated |
|
4.3 |
2.9, 5.7 |
<0.001 |
| Â Â Â Â Widow |
|
1.6 |
0.12, 3.1 |
0.034 |
| Total SVI |
2,169 |
4.0 |
2.7, 5.2 |
<0.001 |
| Soceioeconomic Status |
2,149 |
4.2 |
3.0, 5.4 |
<0.001 |
| Household Composition |
2,169 |
2.3 |
1.1, 3.5 |
<0.001 |
| Minority Status and Language |
2,169 |
0.40 |
-0.61, 1.4 |
0.4 |
| Housing and Transportation |
2,164 |
2.3 |
1.2, 3.3 |
<0.001 |
| Active Tobacco Use |
2,204 |
|
|
|
| Â Â Â Â No |
|
— |
— |
|
| Â Â Â Â Yes |
|
3.3 |
2.3, 4.2 |
<0.001 |
NULL
PHQ + RPL_THEMES
phq1 <- lm(phq_score ~ age_yrs + gender + race_5 + ethnic_3 + lang_3 + mstat_5 + relig_affil + RPL_THEMES,
data = mh_vax2)
summary(phq1)
Call:
lm(formula = phq_score ~ age_yrs + gender + race_5 + ethnic_3 +
lang_3 + mstat_5 + relig_affil + RPL_THEMES, data = mh_vax2)
Residuals:
Min 1Q Median 3Q Max
-11.692 -5.173 -1.775 4.298 21.081
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.587585 0.663043 9.935 < 2e-16 ***
age_yrs -0.034998 0.008503 -4.116 4.01e-05 ***
genderFemale 1.837944 0.306930 5.988 2.50e-09 ***
race_5Black -0.217550 0.619792 -0.351 0.72562
race_5Other 0.440962 0.902349 0.489 0.62512
race_5Asian -1.521130 0.782777 -1.943 0.05212 .
race_5Native 1.397075 1.980147 0.706 0.48055
ethnic_3Hispanic -0.102306 1.082187 -0.095 0.92469
lang_3Other 0.141535 1.484128 0.095 0.92403
mstat_5Unknown 0.980734 0.457396 2.144 0.03214 *
mstat_5Unmarried 1.126779 0.396348 2.843 0.00451 **
mstat_5DivorcedSeparated 3.434914 0.715425 4.801 1.69e-06 ***
mstat_5Widow 1.518583 0.768367 1.976 0.04825 *
relig_affilNo 0.369396 0.314290 1.175 0.24000
RPL_THEMES 3.282792 0.664164 4.943 8.33e-07 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 6.711 on 2048 degrees of freedom
(13182 observations deleted due to missingness)
Multiple R-squared: 0.07066, Adjusted R-squared: 0.06431
F-statistic: 11.12 on 14 and 2048 DF, p-value: < 2.2e-16
broom::glance(phq1)
broom::tidy(phq1)
tbl_regression(phq1, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status"))
| Characteristic |
Beta |
95% CI |
p-value |
| Age |
-0.03 |
-0.05, -0.02 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.8 |
1.2, 2.4 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
-0.22 |
-1.4, 1.0 |
0.7 |
| Â Â Â Â Other |
0.44 |
-1.3, 2.2 |
0.6 |
| Â Â Â Â Asian |
-1.5 |
-3.1, 0.01 |
0.052 |
| Â Â Â Â Native |
1.4 |
-2.5, 5.3 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
-0.10 |
-2.2, 2.0 |
>0.9 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.14 |
-2.8, 3.1 |
>0.9 |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
0.98 |
0.08, 1.9 |
0.032 |
| Â Â Â Â Unmarried |
1.1 |
0.35, 1.9 |
0.005 |
| Â Â Â Â DivorcedSeparated |
3.4 |
2.0, 4.8 |
<0.001 |
| Â Â Â Â Widow |
1.5 |
0.01, 3.0 |
0.048 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.37 |
-0.25, 0.99 |
0.2 |
| Total SVI |
3.3 |
2.0, 4.6 |
<0.001 |
## Model performance
model_performance(phq1)
# Indices of model performance
AIC | BIC | R2 | R2 (adj.) | RMSE | Sigma
---------------------------------------------------------
13726.566 | 13816.677 | 0.071 | 0.064 | 6.687 | 6.711
performance::check_model(phq1, panel = TRUE)

## Margins
cplot(phq1, "RPL_THEMES", what = "prediction", main = "Predicted PHQ9 Given SVI")

PHQ + ALL Themes
phq2 <- lm(phq_score ~ age_yrs + gender + race_5 + ethnic_3 + lang_3 + mstat_5 + relig_affil + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
data = mh_vax2)
summary(phq2)
Call:
lm(formula = phq_score ~ age_yrs + gender + race_5 + ethnic_3 +
lang_3 + mstat_5 + relig_affil + RPL_THEME1 + RPL_THEME2 +
RPL_THEME3 + RPL_THEME4, data = mh_vax2)
Residuals:
Min 1Q Median 3Q Max
-11.642 -5.195 -1.805 4.165 20.699
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.494111 0.734366 8.843 < 2e-16 ***
age_yrs -0.033798 0.008581 -3.939 8.47e-05 ***
genderFemale 1.821218 0.309572 5.883 4.70e-09 ***
race_5Black -0.223916 0.627559 -0.357 0.72127
race_5Other 0.543222 0.907312 0.599 0.54943
race_5Asian -1.396462 0.802851 -1.739 0.08212 .
race_5Native 1.229568 1.987222 0.619 0.53616
ethnic_3Hispanic -0.105112 1.085778 -0.097 0.92289
lang_3Other 0.164392 1.523951 0.108 0.91411
mstat_5Unknown 0.915238 0.461578 1.983 0.04752 *
mstat_5Unmarried 1.118979 0.399986 2.798 0.00520 **
mstat_5DivorcedSeparated 3.491429 0.721256 4.841 1.39e-06 ***
mstat_5Widow 1.423893 0.771157 1.846 0.06497 .
relig_affilNo 0.381214 0.317961 1.199 0.23070
RPL_THEME1 2.865793 0.870462 3.292 0.00101 **
RPL_THEME2 0.414318 0.745671 0.556 0.57852
RPL_THEME3 -0.053591 0.549805 -0.097 0.92236
RPL_THEME4 0.465586 0.622461 0.748 0.45456
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 6.726 on 2020 degrees of freedom
(13207 observations deleted due to missingness)
Multiple R-squared: 0.07054, Adjusted R-squared: 0.06272
F-statistic: 9.018 on 17 and 2020 DF, p-value: < 2.2e-16
broom::glance(phq2)
broom::tidy(phq2)
tbl_regression(phq2, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation", mstat_5 ~ "Marital Status"))
| Characteristic |
Beta |
95% CI |
p-value |
| Age |
-0.03 |
-0.05, -0.02 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.8 |
1.2, 2.4 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
-0.22 |
-1.5, 1.0 |
0.7 |
| Â Â Â Â Other |
0.54 |
-1.2, 2.3 |
0.5 |
| Â Â Â Â Asian |
-1.4 |
-3.0, 0.18 |
0.082 |
| Â Â Â Â Native |
1.2 |
-2.7, 5.1 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
-0.11 |
-2.2, 2.0 |
>0.9 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.16 |
-2.8, 3.2 |
>0.9 |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
0.92 |
0.01, 1.8 |
0.048 |
| Â Â Â Â Unmarried |
1.1 |
0.33, 1.9 |
0.005 |
| Â Â Â Â DivorcedSeparated |
3.5 |
2.1, 4.9 |
<0.001 |
| Â Â Â Â Widow |
1.4 |
-0.09, 2.9 |
0.065 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.38 |
-0.24, 1.0 |
0.2 |
| Soceioeconomic Status |
2.9 |
1.2, 4.6 |
0.001 |
| Household Composition |
0.41 |
-1.0, 1.9 |
0.6 |
| Minority Status and Language |
-0.05 |
-1.1, 1.0 |
>0.9 |
| Housing and Transportation |
0.47 |
-0.76, 1.7 |
0.5 |
## Model performance
model_performance(phq2)
# Indices of model performance
AIC | BIC | R2 | R2 (adj.) | RMSE | Sigma
---------------------------------------------------------
13572.105 | 13678.879 | 0.071 | 0.063 | 6.696 | 6.726
performance::check_model(phq2, panel = TRUE)

## Margins
## Margins
cplot(phq2, "RPL_THEME1", what = "prediction", main = "Predicted PHQ9 Given THEME1")

cplot(phq2, "RPL_THEME2", what = "prediction", main = "Predicted PHQ9 Given THEME2")

cplot(phq2, "RPL_THEME3", what = "prediction", main = "Predicted PHQ9 Given THEME3")

cplot(phq2, "RPL_THEME4", what = "prediction", main = "Predicted PHQ9 Given THEME4")

PHQ9 + SVI Quartiles
phq3 <- lm(phq_score ~ age_yrs + gender + race_5 + ethnic_3 + lang_3 + mstat_5 + relig_affil + RPL_4,
data = mh_vax2)
summary(phq3)
Call:
lm(formula = phq_score ~ age_yrs + gender + race_5 + ethnic_3 +
lang_3 + mstat_5 + relig_affil + RPL_4, data = mh_vax2)
Residuals:
Min 1Q Median 3Q Max
-11.082 -5.250 -1.688 4.272 21.169
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.907302 0.653902 10.563 < 2e-16 ***
age_yrs -0.034802 0.008514 -4.087 4.53e-05 ***
genderFemale 1.849991 0.307216 6.022 2.04e-09 ***
race_5Black -0.071490 0.623069 -0.115 0.90866
race_5Other 0.477230 0.903319 0.528 0.59734
race_5Asian -1.534159 0.785238 -1.954 0.05087 .
race_5Native 1.468317 1.984207 0.740 0.45938
ethnic_3Hispanic -0.118805 1.083448 -0.110 0.91269
lang_3Other 0.218542 1.488978 0.147 0.88333
mstat_5Unknown 1.050605 0.458546 2.291 0.02205 *
mstat_5Unmarried 1.185382 0.396712 2.988 0.00284 **
mstat_5DivorcedSeparated 3.544918 0.716160 4.950 8.03e-07 ***
mstat_5Widow 1.551006 0.769511 2.016 0.04397 *
relig_affilNo 0.381969 0.314725 1.214 0.22502
RPL_4Second 1.077249 0.345000 3.122 0.00182 **
RPL_4Third 0.858016 0.436616 1.965 0.04953 *
RPL_4Fourth 2.943804 0.730112 4.032 5.73e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 6.718 on 2046 degrees of freedom
(13182 observations deleted due to missingness)
Multiple R-squared: 0.06966, Adjusted R-squared: 0.06238
F-statistic: 9.575 on 16 and 2046 DF, p-value: < 2.2e-16
broom::glance(phq3)
broom::tidy(phq3)
tbl_regression(phq3, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "English Speaking", relig_affil ~ "Any Religious Affiliation", RPL_4 ~ "SVI Quartile", mstat_5 ~ "Marital Status"))
| Characteristic |
Beta |
95% CI |
p-value |
| Age |
-0.03 |
-0.05, -0.02 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.8 |
1.2, 2.5 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
-0.07 |
-1.3, 1.2 |
>0.9 |
| Â Â Â Â Other |
0.48 |
-1.3, 2.2 |
0.6 |
| Â Â Â Â Asian |
-1.5 |
-3.1, 0.01 |
0.051 |
| Â Â Â Â Native |
1.5 |
-2.4, 5.4 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
-0.12 |
-2.2, 2.0 |
>0.9 |
| English Speaking |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.22 |
-2.7, 3.1 |
0.9 |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.1 |
0.15, 1.9 |
0.022 |
| Â Â Â Â Unmarried |
1.2 |
0.41, 2.0 |
0.003 |
| Â Â Â Â DivorcedSeparated |
3.5 |
2.1, 4.9 |
<0.001 |
| Â Â Â Â Widow |
1.6 |
0.04, 3.1 |
0.044 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
0.38 |
-0.24, 1.0 |
0.2 |
| SVI Quartile |
|
|
|
| Â Â Â Â First |
— |
— |
|
| Â Â Â Â Second |
1.1 |
0.40, 1.8 |
0.002 |
| Â Â Â Â Third |
0.86 |
0.00, 1.7 |
0.050 |
| Â Â Â Â Fourth |
2.9 |
1.5, 4.4 |
<0.001 |
## Model performance
model_performance(phq3)
# Indices of model performance
AIC | BIC | R2 | R2 (adj.) | RMSE | Sigma
---------------------------------------------------------
13732.782 | 13834.156 | 0.070 | 0.062 | 6.691 | 6.718
performance::check_model(phq3, panel = TRUE)

## Margins
cplot(phq3, "RPL_4", what = "prediction", main = "Predicted PHQ9 Given SVI Quartile")

PHQ9 Logistic
mh_vax2$phq_2 <- cut(mh_vax2$phq_score,
breaks=c(0, 9, 27),
labels=c('None_mild', 'mod_severe'))
phq4 <- glm(phq_2 ~age_yrs + gender + race_5 + ethnic_3 + lang_3 + mstat_5 + relig_affil + RPL_THEMES,
family = "binomial",
data = mh_vax2)
summary(phq4)
Call:
glm(formula = phq_2 ~ age_yrs + gender + race_5 + ethnic_3 +
lang_3 + mstat_5 + relig_affil + RPL_THEMES, family = "binomial",
data = mh_vax2)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.541 -1.018 -0.799 1.224 1.883
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.422145 0.222970 -1.893 0.058320 .
age_yrs -0.013124 0.002867 -4.578 4.70e-06 ***
genderFemale 0.415199 0.106353 3.904 9.46e-05 ***
race_5Black -0.251815 0.200853 -1.254 0.209941
race_5Other -0.210767 0.303228 -0.695 0.487007
race_5Asian -0.362407 0.276099 -1.313 0.189319
race_5Native -0.420675 0.650849 -0.646 0.518055
ethnic_3Hispanic 0.211619 0.360903 0.586 0.557634
lang_3Other 0.115414 0.511516 0.226 0.821488
mstat_5Unknown 0.309686 0.153474 2.018 0.043608 *
mstat_5Unmarried 0.258414 0.131437 1.966 0.049290 *
mstat_5DivorcedSeparated 0.638163 0.226764 2.814 0.004890 **
mstat_5Widow 0.385063 0.254886 1.511 0.130858
relig_affilNo 0.096778 0.106012 0.913 0.361295
RPL_THEMES 0.825167 0.219760 3.755 0.000173 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2379.7 on 1764 degrees of freedom
Residual deviance: 2288.8 on 1750 degrees of freedom
(13480 observations deleted due to missingness)
AIC: 2318.8
Number of Fisher Scoring iterations: 4
broom::glance(phq4)
broom::tidy(phq4, exponentiate = TRUE)
tbl_regression(phq4, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "Preferred Language", relig_affil ~ "Any Religious Affiliation", RPL_THEMES ~ "Total SVI", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
0.99 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.51 |
1.23, 1.87 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.78 |
0.52, 1.15 |
0.2 |
| Â Â Â Â Other |
0.81 |
0.44, 1.46 |
0.5 |
| Â Â Â Â Asian |
0.70 |
0.40, 1.19 |
0.2 |
| Â Â Â Â Native |
0.66 |
0.16, 2.27 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.24 |
0.60, 2.51 |
0.6 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.12 |
0.39, 3.00 |
0.8 |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.36 |
1.01, 1.84 |
0.044 |
| Â Â Â Â Unmarried |
1.29 |
1.00, 1.68 |
0.049 |
| Â Â Â Â DivorcedSeparated |
1.89 |
1.21, 2.96 |
0.005 |
| Â Â Â Â Widow |
1.47 |
0.88, 2.41 |
0.13 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.10 |
0.89, 1.36 |
0.4 |
| Total SVI |
2.28 |
1.48, 3.52 |
<0.001 |
## Performance
model_performance(phq4)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
------------------------------------------------------------------------------------------------
2318.772 | 2400.910 | 0.051 | 0.478 | 1.144 | 0.648 | -Inf | 5.671e-04 | 0.543
performance::check_model(phq4, panel = TRUE)

Logistic + SVI quartile
phq5 <- glm(phq_2 ~age_yrs + gender + race_5 + ethnic_3 + lang_3 + mstat_5 + relig_affil + RPL_4,
family = "binomial",
data = mh_vax2)
summary(phq5)
Call:
glm(formula = phq_2 ~ age_yrs + gender + race_5 + ethnic_3 +
lang_3 + mstat_5 + relig_affil + RPL_4, family = "binomial",
data = mh_vax2)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5638 -1.0108 -0.7997 1.2199 1.8732
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.37105 0.22004 -1.686 0.091740 .
age_yrs -0.01312 0.00287 -4.570 4.88e-06 ***
genderFemale 0.42043 0.10643 3.950 7.81e-05 ***
race_5Black -0.18321 0.20166 -0.909 0.363613
race_5Other -0.20685 0.30363 -0.681 0.495707
race_5Asian -0.38599 0.27680 -1.394 0.163173
race_5Native -0.46896 0.65184 -0.719 0.471873
ethnic_3Hispanic 0.19478 0.36188 0.538 0.590400
lang_3Other 0.19963 0.51150 0.390 0.696330
mstat_5Unknown 0.32507 0.15366 2.116 0.034387 *
mstat_5Unmarried 0.27379 0.13142 2.083 0.037215 *
mstat_5DivorcedSeparated 0.65719 0.22668 2.899 0.003742 **
mstat_5Widow 0.39060 0.25507 1.531 0.125688
relig_affilNo 0.09936 0.10608 0.937 0.348962
RPL_4Second 0.38448 0.11615 3.310 0.000933 ***
RPL_4Third 0.22096 0.14486 1.525 0.127171
RPL_4Fourth 0.63148 0.23149 2.728 0.006373 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2379.7 on 1764 degrees of freedom
Residual deviance: 2287.7 on 1748 degrees of freedom
(13480 observations deleted due to missingness)
AIC: 2321.7
Number of Fisher Scoring iterations: 4
broom::glance(phq5)
broom::tidy(phq5, exponentiate = TRUE)
tbl_regression(phq5, label = list(age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "Preferred Language", relig_affil ~ "Any Religious Affiliation", RPL_4 ~ "SVI Quartile", mstat_5 ~ "Marital Status"), exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
0.99 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.52 |
1.24, 1.88 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.83 |
0.56, 1.23 |
0.4 |
| Â Â Â Â Other |
0.81 |
0.44, 1.46 |
0.5 |
| Â Â Â Â Asian |
0.68 |
0.39, 1.16 |
0.2 |
| Â Â Â Â Native |
0.63 |
0.16, 2.17 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â NonHispanic |
— |
— |
|
| Â Â Â Â Hispanic |
1.22 |
0.59, 2.47 |
0.6 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.22 |
0.43, 3.27 |
0.7 |
| Marital Status |
|
|
|
| Â Â Â Â Married |
— |
— |
|
| Â Â Â Â Unknown |
1.38 |
1.02, 1.87 |
0.034 |
| Â Â Â Â Unmarried |
1.31 |
1.02, 1.70 |
0.037 |
| Â Â Â Â DivorcedSeparated |
1.93 |
1.24, 3.01 |
0.004 |
| Â Â Â Â Widow |
1.48 |
0.89, 2.42 |
0.13 |
| Any Religious Affiliation |
|
|
|
| Â Â Â Â Yes |
— |
— |
|
| Â Â Â Â No |
1.10 |
0.90, 1.36 |
0.3 |
| SVI Quartile |
|
|
|
| Â Â Â Â First |
— |
— |
|
| Â Â Â Â Second |
1.47 |
1.17, 1.84 |
<0.001 |
| Â Â Â Â Third |
1.25 |
0.94, 1.66 |
0.13 |
| Â Â Â Â Fourth |
1.88 |
1.20, 2.97 |
0.006 |
## Performance
model_performance(phq5)
# Indices of model performance
AIC | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
------------------------------------------------------------------------------------------------
2321.689 | 2414.779 | 0.051 | 0.478 | 1.144 | 0.648 | -Inf | 8.447e-04 | 0.544
performance::check_model(phq5, panel = TRUE)

LS0tCnRpdGxlOiAiMjAyMi4xMC4yOF9NSF9WYXJpYWJsZXMiCm91dHB1dDogCiAgaHRtbF9ub3RlYm9vazoKICAgdGhlbWVzOiBwYXBlcgogICB0b2M6IHllcwogICB0b2NfZmxvYXQ6IHllcwplZGl0b3Jfb3B0aW9uczogCiAgY2h1bmtfb3V0cHV0X3R5cGU6IGlubGluZQotLS0KCgojIExvYWQgUGFja2FnZXMKCmBgYHtyfQpsaWJyYXJ5KHRpZHl2ZXJzZSkKbGlicmFyeShjb2RlYm9va3IpCmxpYnJhcnkoc3VtbWFyeXRvb2xzKQpsaWJyYXJ5KGJyb29tKQpsaWJyYXJ5KHBlcmZvcm1hbmNlKQpsaWJyYXJ5KGd0KQpsaWJyYXJ5KGd0c3VtbWFyeSkKbGlicmFyeShqYW5pdG9yKQpsaWJyYXJ5K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ICAgICAgICAgIE1hcnJpZWQgPSAiTUFSUklFRCIsIFVubWFycmllZCA9ICJTSU5HTEUiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVbmtub3duID0gIlVOS05PV04iLCBVbmtub3duID0gIk9USEVSIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVW5tYXJyaWVkID0gIlNJR05JRklDQU5UIE9USEVSIiksCiAgICAgICAgIG1zdGF0XzUgPSBmY3RfcmVsZXZlbChtc3RhdF81LCByZWYgPSAnTWFycmllZCcpKS0+IGV4YW1wbGVkZjFOQURpMk1BCmBgYAoKIyMgUmVsaWdpb24KCmBgYHtyfQpleGFtcGxlZGYxTkFEaTJNQSAlPiUgCiAgbXV0YXRlKHJlbGlnX2FmZmlsID0gYXNfZmFjdG9yKFBBVElFTlRfUkVMSUdJT05fREVTQyksCiAgICAgICAgICByZWxpZ19hZmZpbCA9IGZjdF9yZWNvZGUocmVsaWdfYWZmaWwsIFllcyA9ICJDQVRIT0xJQyIsCiAgICAgICAgICAgICAgICAgICAgICBObyA9ICJOT05FIiwgCiAgICAgICAgICAgICAgICAgICAgICBZZXMgPSAiQ0hSSVNUSUFOIiwgWWVzID0gIkxVVEhFUkFOIiwKICAgICAgICAgICAgICAgICAgICAgIFllcyA9ICJSVVNTSUFOIE9SVEhPRE9YIiwKICAgICAgICAgICAgICAgICAgICAgIFllcyA9ICJQUk9URVNUQU5UIiwgWWVzID0gIkJBUFRJU1QiLAogICAgICAgICAgICAgICAgICAgICAgWWVzID0gIk1FVEhPRElTVCIsIFllcyA9ICJQUkVTQllURVJJQU4iLAogICAgICAgICAgICAgICAgICAgICAgWWVzID0gIk5PTi1ERU5PTUlOQVRJT05BTCIsIFllcyA9ICJKRVdJU0giLAogICAgICAgICAgICAgICAgICAgICAgWWVzID0gIk1VU0xJTSIsIFllcyA9ICJPVEhFUiIsCiAgICAgICAgICAgICAgICAgICAgICBZZXMgPSAiRVBJU0NPUEFMSUFOIiwgWWVzID0gIlBF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