Load Packages

library(tidyverse)
library(codebookr)
library(summarytools)
library(broom) 
library(performance)
library(gt)
library(gtsummary)
library(janitor)
library(forcats)
library(here)
library(margins)
library(ggplot2)
library(mediation)

Import Data

load("~/Desktop/R-Code/SDOH_Vax/flu_2019_later.rda")
View(flu_2019_later)

Include only patients from Michigan

flu_2019_MI <- flu_2019_later[ which(flu_2019_later$PATIENT_STATE_CD=='MI'), ]

Exclude workmans compensation and NULL as insurance

flu_2019_MI_only1 <- flu_2019_MI[ which(flu_2019_MI$insur_type !='Workers Compensation'), ]
flu_2019_MI_only <- flu_2019_MI_only1[ which(flu_2019_MI_only1$insur_type !='NULL'), ]

codebook


flu_2019_MI_only$IC <- as.numeric(flu_2019_MI_only$IC)
flu_2019_MI_only$insur_type <- as.character(flu_2019_MI_only$insur_type)
flu_2019_MI_only %>% 
dplyr::select(ibd_3, age_yrs, gender, race_5, ethnic_3, lang_3, relig_affil, mstat_5, max_ch, PATIENT_STATE_CD, r_pct, IC, insur_type, pop_dens, RPL_THEMES, RPL_4, RPL_THEME1, RPL_THEME2, RPL_THEME3, RPL_THEME4, act_tob, flu_2019, , prevnar, pvax, any_pneum, any_pneum, total_cov_vax, total_shingrix) -> flu_clean1
print(dfSummary(flu_clean1), method = 'render')

Data Frame Summary

flu_clean1

Dimensions: 11009 x 27
Duplicates: 0
No Variable Stats / Values Freqs (% of Valid) Graph Valid Missing
1 ibd_3 [factor]
1. CD
2. UC
3. Unspecified
5490(49.9%)
5446(49.5%)
73(0.7%)
11009 (100.0%) 0 (0.0%)
2 age_yrs [numeric]
Mean (sd) : 48.8 (19.4)
min ≤ med ≤ max:
1 ≤ 49.2 ≤ 99.9
IQR (CV) : 31.6 (0.4)
8969 distinct values 11009 (100.0%) 0 (0.0%)
3 gender [factor]
1. Male
2. Female
5010(45.5%)
5999(54.5%)
11009 (100.0%) 0 (0.0%)
4 race_5 [factor]
1. White
2. Black
3. Asian
4. Native
5. Other
9526(86.5%)
721(6.5%)
275(2.5%)
42(0.4%)
445(4.0%)
11009 (100.0%) 0 (0.0%)
5 ethnic_3 [factor]
1. NonHispanic
2. UNKNOWN
3. Hispanic
4. CHOOSE NOT TO DISCLOSE
10454(97.9%)
0(0.0%)
228(2.1%)
0(0.0%)
10682 (97.0%) 327 (3.0%)
6 lang_3 [factor]
1. English
2. Other
10894(99.0%)
115(1.0%)
11009 (100.0%) 0 (0.0%)
7 relig_affil [factor]
1. Yes
2. No
3. UNKNOWN
4. PATIENT REFUSED
6051(57.7%)
4437(42.3%)
0(0.0%)
0(0.0%)
10488 (95.3%) 521 (4.7%)
8 mstat_5 [factor]
1. Married
2. Unknown
3. Unmarried
4. DivorcedSeparated
5. Widow
4333(39.4%)
2778(25.2%)
3370(30.6%)
335(3.0%)
193(1.8%)
11009 (100.0%) 0 (0.0%)
9 max_ch [numeric]
Mean (sd) : 3.5 (5)
min ≤ med ≤ max:
0 ≤ 1 ≤ 27
IQR (CV) : 5 (1.4)
28 distinct values 11009 (100.0%) 0 (0.0%)
10 PATIENT_STATE_CD [character] 1. MI
11009(100.0%)
11009 (100.0%) 0 (0.0%)
11 r_pct [numeric]
Mean (sd) : 44.6 (17.9)
min ≤ med ≤ max:
1.8 ≤ 47.6 ≤ 81.2
IQR (CV) : 24.7 (0.4)
1922 distinct values 9434 (85.7%) 1575 (14.3%)
12 IC [numeric]
Min : 0
Mean : 0.6
Max : 1
0:3586(38.0%)
1:5862(62.0%)
9448 (85.8%) 1561 (14.2%)
13 insur_type [character]
1. Medicaid
2. Medicare
3. Other
4. Other Governmental Insura
5. Private Insurance
1747(15.9%)
2142(19.5%)
24(0.2%)
95(0.9%)
7001(63.6%)
11009 (100.0%) 0 (0.0%)
14 pop_dens [numeric]
Mean (sd) : 2132.8 (2270.6)
min ≤ med ≤ max:
2.5 ≤ 1519.6 ≤ 19280.6
IQR (CV) : 2957.1 (1.1)
2104 distinct values 10758 (97.7%) 251 (2.3%)
15 RPL_THEMES [numeric]
Mean (sd) : 0.4 (0.3)
min ≤ med ≤ max:
0 ≤ 0.3 ≤ 1
IQR (CV) : 0.4 (0.7)
2098 distinct values 10974 (99.7%) 35 (0.3%)
16 RPL_4 [factor]
1. First
2. Second
3. Third
4. Fourth
4459(40.6%)
3296(30.0%)
2165(19.7%)
1054(9.6%)
10974 (99.7%) 35 (0.3%)
17 RPL_THEME1 [numeric]
Mean (sd) : 0.3 (0.3)
min ≤ med ≤ max:
0 ≤ 0.3 ≤ 1
IQR (CV) : 0.4 (0.7)
2061 distinct values 10930 (99.3%) 79 (0.7%)
18 RPL_THEME2 [numeric]
Mean (sd) : 0.4 (0.3)
min ≤ med ≤ max:
0 ≤ 0.3 ≤ 1
IQR (CV) : 0.4 (0.7)
2017 distinct values 10974 (99.7%) 35 (0.3%)
19 RPL_THEME3 [numeric]
Mean (sd) : 0.5 (0.3)
min ≤ med ≤ max:
0 ≤ 0.5 ≤ 1
IQR (CV) : 0.5 (0.6)
1434 distinct values 10979 (99.7%) 30 (0.3%)
20 RPL_THEME4 [numeric]
Mean (sd) : 0.4 (0.3)
min ≤ med ≤ max:
0 ≤ 0.4 ≤ 1
IQR (CV) : 0.5 (0.7)
2033 distinct values 10957 (99.5%) 52 (0.5%)
21 act_tob [factor]
1. No
2. Yes
3. NOT ASKED
9541(88.0%)
1299(12.0%)
0(0.0%)
10840 (98.5%) 169 (1.5%)
22 flu_2019 [numeric]
Min : 0
Mean : 0.4
Max : 1
0:6683(60.7%)
1:4326(39.3%)
11009 (100.0%) 0 (0.0%)
23 prevnar [numeric]
Mean (sd) : 0.4 (0.6)
min ≤ med ≤ max:
0 ≤ 0 ≤ 8
IQR (CV) : 1 (1.4)
0:6907(62.7%)
1:3846(34.9%)
2:198(1.8%)
3:27(0.2%)
4:24(0.2%)
5:4(0.0%)
6:1(0.0%)
7:1(0.0%)
8:1(0.0%)
11009 (100.0%) 0 (0.0%)
24 pvax [numeric]
Mean (sd) : 0.4 (0.5)
min ≤ med ≤ max:
0 ≤ 0 ≤ 6
IQR (CV) : 1 (1.5)
0:7407(67.3%)
1:3328(30.2%)
2:260(2.4%)
3:11(0.1%)
5:1(0.0%)
6:2(0.0%)
11009 (100.0%) 0 (0.0%)
25 any_pneum [numeric]
Mean (sd) : 0.8 (0.9)
min ≤ med ≤ max:
0 ≤ 0 ≤ 9
IQR (CV) : 1 (1.2)
0:5889(53.5%)
1:2389(21.7%)
2:2355(21.4%)
3:289(2.6%)
4:61(0.6%)
5:15(0.1%)
6:7(0.1%)
7:2(0.0%)
8:1(0.0%)
9:1(0.0%)
11009 (100.0%) 0 (0.0%)
26 total_cov_vax [numeric]
Mean (sd) : 1.9 (1.6)
min ≤ med ≤ max:
0 ≤ 2 ≤ 7
IQR (CV) : 3 (0.8)
0:3876(35.2%)
1:395(3.6%)
2:2052(18.6%)
3:3033(27.6%)
4:1451(13.2%)
5:156(1.4%)
6:37(0.3%)
7:9(0.1%)
11009 (100.0%) 0 (0.0%)
27 total_shingrix [numeric]
Mean (sd) : 0.3 (0.7)
min ≤ med ≤ max:
0 ≤ 0 ≤ 5
IQR (CV) : 0 (2.6)
0:9493(86.2%)
1:343(3.1%)
2:1076(9.8%)
3:86(0.8%)
4:9(0.1%)
5:2(0.0%)
11009 (100.0%) 0 (0.0%)

Generated by summarytools 1.0.1 (R version 4.2.1)
2023-01-05

Patient Characteristics

Baseline Characteristics

flu_clean2 <- flu_clean1[ which(flu_clean1$mstat_5 !='Unknown'), ]
flu_clean2 %>% 
  dplyr::select(ibd_3, age_yrs, gender, race_5, ethnic_3, lang_3, relig_affil, mstat_5, act_tob, max_ch, insur_type, IC, pop_dens,r_pct, RPL_THEMES, RPL_4, RPL_THEME1, RPL_THEME2, RPL_THEME3, RPL_THEME4, flu_2019) -> baseline
baseline %>% tbl_summary(label = list(ibd_3 ~ "IBD Diagnosis", age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "Primary Language", 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", pop_dens ~ "Population Density", RPL_4 ~ "SVI Quartiles", r_pct ~ "Percent Republican", max_ch ~ "Charlson Comorbidity Index", act_tob ~ "Active Tobacco Use", IC = "Immunocompromised", flu_2019 ~ "Flu Vaccination", insur_type ~ "Insurance Type"),
        statistic = list(all_continuous() ~ "{mean} ({sd})"),
        missing_text = "(Missing)")
Characteristic N = 8,2311
IBD Diagnosis
    CD 4,002 (49%)
    UC 4,185 (51%)
    Unspecified 44 (0.5%)
Age 50 (19)
Gender
    Male 3,690 (45%)
    Female 4,541 (55%)
Race
    White 7,179 (87%)
    Black 526 (6.4%)
    Asian 199 (2.4%)
    Native 29 (0.4%)
    Other 298 (3.6%)
Ethnicity
    NonHispanic 7,816 (98%)
    UNKNOWN 0 (0%)
    Hispanic 162 (2.0%)
    CHOOSE NOT TO DISCLOSE 0 (0%)
    (Missing) 253
Primary Language
    English 8,150 (99%)
    Other 81 (1.0%)
Any Religious Affiliation
    Yes 4,699 (60%)
    No 3,189 (40%)
    UNKNOWN 0 (0%)
    PATIENT REFUSED 0 (0%)
    (Missing) 343
Marital Status
    Married 4,333 (53%)
    Unknown 0 (0%)
    Unmarried 3,370 (41%)
    DivorcedSeparated 335 (4.1%)
    Widow 193 (2.3%)
Active Tobacco Use
    No 7,208 (88%)
    Yes 951 (12%)
    NOT ASKED 0 (0%)
    (Missing) 72
Charlson Comorbidity Index 3.7 (5.1)
Insurance Type
    Medicaid 1,204 (15%)
    Medicare 1,684 (20%)
    Other 15 (0.2%)
    Other Governmental Insurance 58 (0.7%)
    Private Insurance 5,270 (64%)
Immunocompromised 4,348 (62%)
    (Missing) 1,176
Population Density 2,113 (2,207)
    (Missing) 160
Percent Republican 44 (18)
    (Missing) 1,141
Total SVI 0.35 (0.25)
    (Missing) 21
SVI Quartiles
    First 3,478 (42%)
    Second 2,450 (30%)
    Third 1,559 (19%)
    Fourth 723 (8.8%)
    (Missing) 21
Soceioeconomic Status 0.33 (0.25)
    (Missing) 61
Household Composition 0.38 (0.26)
    (Missing) 21
Minority Status and Language 0.48 (0.29)
    (Missing) 20
Housing and Transportation 0.42 (0.28)
    (Missing) 36
Flu Vaccination 3,470 (42%)
1 n (%); Mean (SD)

Baseline characteristics by SVI Quartile

flu_clean2 %>% tbl_summary(by = RPL_4,
         label = list(ibd_3 ~ "IBD Diagnosis", age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "Primary Language", 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", pop_dens ~ "Population Density", RPL_4 ~ "SVI Quartiles", r_pct ~ "Percent Republican", max_ch ~ "Charlson Comorbidity Index", act_tob ~ "Active Tobacco Use", IC ~ "Immunocompromised", insur_type ~ "Insurance Type"),
        statistic = list(all_continuous() ~ "{mean} ({sd})"),
        missing_text = "(Missing)") %>% add_p()
21 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 'ibd_3', p-value omitted:
Error in stats::fisher.test(structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, : FEXACT[f3xact()] error: hash key 2e+10 > INT_MAX, kyy=3479, it[i (= nco = 4)]= 0.
Rather set 'simulate.p.value=TRUE'

There was an error in 'add_p()/add_difference()' for variable 'race_5', p-value omitted:
Error in stats::fisher.test(structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, : FEXACT error 5.
The hash table key cannot be computed because the largest key
is larger than the largest representable int.
The algorithm cannot proceed.
Reduce the workspace, consider using 'simulate.p.value=TRUE' or another algorithm.
There was an error in 'add_p()/add_difference()' for variable 'relig_affil', p-value omitted:
Error in stats::fisher.test(structure(c(2L, 1L, 1L, 2L, NA, 1L, 1L, 2L, : FEXACT error 6.  LDKEY=573 is too small for this problem,
  (ii := key2[itp=497] = 12405944, ldstp=17190)
Try increasing the size of the workspace and possibly 'mult'
There was an error in 'add_p()/add_difference()' for variable 'mstat_5', p-value omitted:
Error in stats::fisher.test(structure(c(1L, 1L, 3L, 3L, 3L, 3L, 1L, 1L, : FEXACT error 5.
The hash table key cannot be computed because the largest key
is larger than the largest representable int.
The algorithm cannot proceed.
Reduce the workspace, consider using 'simulate.p.value=TRUE' or another algorithm.
There was an error in 'add_p()/add_difference()' for variable 'PATIENT_STATE_CD', p-value omitted:
Error in stats::chisq.test(x = c("MI", "MI", "MI", "MI", "MI", "MI", "MI", : 'x' and 'y' must have at least 2 levels
There was an error in 'add_p()/add_difference()' for variable 'insur_type', p-value omitted:
Error in stats::fisher.test(c("Medicaid", "Private Insurance", "Medicaid", : FEXACT error 5.
The hash table key cannot be computed because the largest key
is larger than the largest representable int.
The algorithm cannot proceed.
Reduce the workspace, consider using 'simulate.p.value=TRUE' or another algorithm.
There was an error in 'add_p()/add_difference()' for variable 'act_tob', p-value omitted:
Error in stats::fisher.test(structure(c(2L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, : FEXACT error 7(location). LDSTP=17130 is too small for this problem,
  (pastp=719.296, ipn_0:=ipoin[itp=247]=18, stp[ipn_0]=691.047).
Increase workspace or consider using 'simulate.p.value=TRUE'
There was an error in 'add_p()/add_difference()' for variable 'prevnar', p-value omitted:
Error in stats::fisher.test(c(1, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, : FEXACT error 5.
The hash table key cannot be computed because the largest key
is larger than the largest representable int.
The algorithm cannot proceed.
Reduce the workspace, consider using 'simulate.p.value=TRUE' or another algorithm.
There was an error in 'add_p()/add_difference()' for variable 'pvax', p-value omitted:
Error in stats::fisher.test(c(0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, : FEXACT error 5.
The hash table key cannot be computed because the largest key
is larger than the largest representable int.
The algorithm cannot proceed.
Reduce the workspace, consider using 'simulate.p.value=TRUE' or another algorithm.
There was an error in 'add_p()/add_difference()' for variable 'any_pneum', p-value omitted:
Error in stats::fisher.test(c(1, 4, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, : FEXACT error 5.
The hash table key cannot be computed because the largest key
is larger than the largest representable int.
The algorithm cannot proceed.
Reduce the workspace, consider using 'simulate.p.value=TRUE' or another algorithm.
There was an error in 'add_p()/add_difference()' for variable 'total_cov_vax', p-value omitted:
Error in stats::fisher.test(c(1, 3, 1, 3, 2, 0, 4, 3, 2, 3, 0, 4, 2, 0, : FEXACT error 5.
The hash table key cannot be computed because the largest key
is larger than the largest representable int.
The algorithm cannot proceed.
Reduce the workspace, consider using 'simulate.p.value=TRUE' or another algorithm.
There was an error in 'add_p()/add_difference()' for variable 'total_shingrix', p-value omitted:
Error in stats::fisher.test(c(0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, : FEXACT error 5.
The hash table key cannot be computed because the largest key
is larger than the largest representable int.
The algorithm cannot proceed.
Reduce the workspace, consider using 'simulate.p.value=TRUE' or another algorithm.
Characteristic First, N = 3,4781 Second, N = 2,4501 Third, N = 1,5591 Fourth, N = 7231 p-value2
IBD Diagnosis
    CD 1,588 (46%) 1,167 (48%) 811 (52%) 423 (59%)
    UC 1,871 (54%) 1,270 (52%) 739 (47%) 297 (41%)
    Unspecified 19 (0.5%) 13 (0.5%) 9 (0.6%) 3 (0.4%)
Age 50 (19) 50 (19) 50 (19) 47 (19) 0.002
Gender 0.059
    Male 1,606 (46%) 1,101 (45%) 667 (43%) 304 (42%)
    Female 1,872 (54%) 1,349 (55%) 892 (57%) 419 (58%)
Race
    White 3,161 (91%) 2,158 (88%) 1,334 (86%) 507 (70%)
    Black 92 (2.6%) 127 (5.2%) 137 (8.8%) 169 (23%)
    Asian 89 (2.6%) 68 (2.8%) 37 (2.4%) 5 (0.7%)
    Native 8 (0.2%) 14 (0.6%) 4 (0.3%) 3 (0.4%)
    Other 128 (3.7%) 83 (3.4%) 47 (3.0%) 39 (5.4%)
Ethnicity 0.020
    NonHispanic 3,302 (98%) 2,335 (98%) 1,482 (98%) 676 (96%)
    UNKNOWN 0 (0%) 0 (0%) 0 (0%) 0 (0%)
    Hispanic 59 (1.8%) 48 (2.0%) 29 (1.9%) 26 (3.7%)
    CHOOSE NOT TO DISCLOSE 0 (0%) 0 (0%) 0 (0%) 0 (0%)
    (Missing) 117 67 48 21
Primary Language <0.001
    English 3,454 (99%) 2,431 (99%) 1,538 (99%) 706 (98%)
    Other 24 (0.7%) 19 (0.8%) 21 (1.3%) 17 (2.4%)
Any Religious Affiliation
    Yes 2,011 (60%) 1,391 (59%) 896 (60%) 387 (56%)
    No 1,333 (40%) 955 (41%) 595 (40%) 299 (44%)
    UNKNOWN 0 (0%) 0 (0%) 0 (0%) 0 (0%)
    PATIENT REFUSED 0 (0%) 0 (0%) 0 (0%) 0 (0%)
    (Missing) 134 104 68 37
Marital Status
    Married 2,014 (58%) 1,281 (52%) 750 (48%) 279 (39%)
    Unknown 0 (0%) 0 (0%) 0 (0%) 0 (0%)
    Unmarried 1,291 (37%) 994 (41%) 681 (44%) 392 (54%)
    DivorcedSeparated 91 (2.6%) 116 (4.7%) 88 (5.6%) 40 (5.5%)
    Widow 82 (2.4%) 59 (2.4%) 40 (2.6%) 12 (1.7%)
Charlson Comorbidity Index 3.5 (5.0) 3.8 (5.2) 3.8 (5.1) 4.0 (5.3) 0.002
PATIENT_STATE_CD
    MI 3,478 (100%) 2,450 (100%) 1,559 (100%) 723 (100%)
Percent Republican 45 (16) 45 (18) 45 (18) 35 (21) <0.001
    (Missing) 348 437 256 99
Immunocompromised 1,806 (60%) 1,289 (61%) 821 (62%) 417 (67%) 0.033
    (Missing) 488 349 240 97
Insurance Type
    Medicaid 287 (8.3%) 344 (14%) 335 (21%) 234 (32%)
    Medicare 622 (18%) 494 (20%) 387 (25%) 179 (25%)
    Other 9 (0.3%) 4 (0.2%) 1 (<0.1%) 1 (0.1%)
    Other Governmental Insurance 15 (0.4%) 14 (0.6%) 18 (1.2%) 11 (1.5%)
    Private Insurance 2,545 (73%) 1,594 (65%) 818 (52%) 298 (41%)
Population Density 1,861 (1,865) 2,038 (2,229) 2,350 (2,458) 3,123 (2,737) <0.001
    (Missing) 19 38 50 33
Total SVI 0.11 (0.07) 0.37 (0.07) 0.61 (0.07) 0.86 (0.07) <0.001
Soceioeconomic Status 0.13 (0.10) 0.33 (0.16) 0.56 (0.15) 0.78 (0.11) <0.001
    (Missing) 40 0 0 0
Household Composition 0.21 (0.14) 0.37 (0.21) 0.58 (0.24) 0.75 (0.20) <0.001
Minority Status and Language 0.41 (0.27) 0.49 (0.29) 0.52 (0.29) 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) 15 0 0 0
Active Tobacco Use
    No 3,184 (92%) 2,128 (88%) 1,311 (85%) 568 (80%)
    Yes 280 (8.1%) 296 (12%) 232 (15%) 139 (20%)
    NOT ASKED 0 (0%) 0 (0%) 0 (0%) 0 (0%)
    (Missing) 14 26 16 16
flu_2019 1,651 (47%) 1,024 (42%) 559 (36%) 228 (32%) <0.001
prevnar
    0 1,944 (56%) 1,502 (61%) 972 (62%) 464 (64%)
    1 1,452 (42%) 879 (36%) 546 (35%) 248 (34%)
    2 68 (2.0%) 55 (2.2%) 28 (1.8%) 8 (1.1%)
    3 6 (0.2%) 7 (0.3%) 7 (0.4%) 3 (0.4%)
    4 6 (0.2%) 5 (0.2%) 4 (0.3%) 0 (0%)
    5 1 (<0.1%) 2 (<0.1%) 1 (<0.1%) 0 (0%)
    6 0 (0%) 0 (0%) 1 (<0.1%) 0 (0%)
    7 1 (<0.1%) 0 (0%) 0 (0%) 0 (0%)
pvax
    0 2,169 (62%) 1,610 (66%) 1,033 (66%) 485 (67%)
    1 1,223 (35%) 754 (31%) 488 (31%) 217 (30%)
    2 80 (2.3%) 83 (3.4%) 37 (2.4%) 19 (2.6%)
    3 5 (0.1%) 2 (<0.1%) 1 (<0.1%) 2 (0.3%)
    5 0 (0%) 1 (<0.1%) 0 (0%) 0 (0%)
    6 1 (<0.1%) 0 (0%) 0 (0%) 0 (0%)
any_pneum
    0 1,617 (46%) 1,260 (51%) 810 (52%) 395 (55%)
    1 838 (24%) 553 (23%) 362 (23%) 155 (21%)
    2 898 (26%) 530 (22%) 330 (21%) 145 (20%)
    3 102 (2.9%) 81 (3.3%) 41 (2.6%) 23 (3.2%)
    4 15 (0.4%) 17 (0.7%) 12 (0.8%) 5 (0.7%)
    5 4 (0.1%) 7 (0.3%) 2 (0.1%) 0 (0%)
    6 2 (<0.1%) 2 (<0.1%) 2 (0.1%) 0 (0%)
    7 2 (<0.1%) 0 (0%) 0 (0%) 0 (0%)
total_cov_vax
    0 941 (27%) 823 (34%) 632 (41%) 346 (48%)
    1 127 (3.7%) 77 (3.1%) 61 (3.9%) 26 (3.6%)
    2 623 (18%) 448 (18%) 285 (18%) 153 (21%)
    3 1,093 (31%) 673 (27%) 404 (26%) 141 (20%)
    4 604 (17%) 384 (16%) 158 (10%) 50 (6.9%)
    5 73 (2.1%) 34 (1.4%) 12 (0.8%) 6 (0.8%)
    6 13 (0.4%) 9 (0.4%) 5 (0.3%) 1 (0.1%)
    7 4 (0.1%) 2 (<0.1%) 2 (0.1%) 0 (0%)
total_shingrix
    0 2,820 (81%) 2,091 (85%) 1,370 (88%) 670 (93%)
    1 138 (4.0%) 66 (2.7%) 58 (3.7%) 15 (2.1%)
    2 478 (14%) 270 (11%) 121 (7.8%) 32 (4.4%)
    3 39 (1.1%) 20 (0.8%) 8 (0.5%) 4 (0.6%)
    4 3 (<0.1%) 3 (0.1%) 1 (<0.1%) 1 (0.1%)
    5 0 (0%) 0 (0%) 1 (<0.1%) 1 (0.1%)
1 n (%); Mean (SD)
2 Kruskal-Wallis rank sum test; Pearson's Chi-squared test; Fisher's exact test

Bivariate Analysis

tbl_uv_ex1 <-
  tbl_uvregression(
    flu_clean2[c("flu_2019", "ibd_3", "age_yrs", "gender", "race_5", "ethnic_3", "lang_3", "mstat_5", "relig_affil", "act_tob", "max_ch", "IC", "insur_type", "pop_dens", "r_pct", "RPL_THEMES", "RPL_THEME1", "RPL_THEME2", "RPL_THEME3", "RPL_THEME4")],
    method = glm,
    method.args = list(family = binomial),
    y = flu_2019,
    label = list(ibd_3 ~ "IBD Diagnosis", age_yrs ~ "Age", gender~ "Gender", race_5 ~ "Race", ethnic_3 ~ "Ethnicity", lang_3 ~ "Primary Language", 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", pop_dens ~ "Population Density", r_pct ~ "Percent Republican", max_ch ~ "Charlson Comorbidity Index", act_tob ~ "Active Tobacco Use", IC ~ "Immunocompromised", insur_type ~ "Insurance Type"),
  exponentiate = TRUE)
print(tbl_uv_ex1, method = render)
`...` must be empty.
✖ Problematic argument:
• method = render
Characteristic N OR1 95% CI1 p-value
IBD Diagnosis 8,231
    CD — —
    UC 0.96 0.88, 1.05 0.4
    Unspecified 0.39 0.18, 0.77 0.010
Age 8,231 0.99 0.99, 0.99 <0.001
Gender 8,231
    Male — —
    Female 1.07 0.98, 1.17 0.13
Race 8,231
    White — —
    Black 0.70 0.58, 0.84 <0.001
    Asian 1.94 1.46, 2.59 <0.001
    Native 0.96 0.45, 2.00 >0.9
    Other 0.96 0.75, 1.21 0.7
Ethnicity 7,978
    NonHispanic — —
    Hispanic 1.27 0.93, 1.74 0.13
Primary Language 8,231
    English — —
    Other 0.76 0.48, 1.20 0.2
Marital Status 8,231
    Married — —
    Unmarried 0.95 0.87, 1.04 0.3
    DivorcedSeparated 0.88 0.70, 1.10 0.3
    Widow 0.58 0.42, 0.79 <0.001
Any Religious Affiliation 7,888
    Yes — —
    No 0.98 0.89, 1.07 0.6
Active Tobacco Use 8,159
    No — —
    Yes 0.67 0.58, 0.77 <0.001
Charlson Comorbidity Index 8,231 1.00 0.99, 1.00 0.3
Immunocompromised 7,055 1.58 1.43, 1.74 <0.001
Insurance Type 8,231
    Medicaid — —
    Medicare 0.84 0.72, 0.99 0.035
    Other 1.01 0.31, 2.86 >0.9
    Other Governmental Insurance 0.47 0.23, 0.89 0.028
    Private Insurance 1.90 1.67, 2.17 <0.001
Population Density 8,071 1.00 1.00, 1.00 <0.001
Percent Republican 7,090 0.99 0.99, 0.99 <0.001
Total SVI 8,210 0.40 0.33, 0.47 <0.001
Soceioeconomic Status 8,170 0.37 0.31, 0.45 <0.001
Household Composition 8,210 0.36 0.30, 0.42 <0.001
Minority Status and Language 8,211 1.29 1.10, 1.50 0.001
Housing and Transportation 8,195 0.63 0.54, 0.73 <0.001
1 OR = Odds Ratio, CI = Confidence Interval
NULL

Flu 2019 with SVI as Continuous Variable


flu_clean2 <- flu_clean1[ which(flu_clean1$mstat_5 !='Unknown'), ]
Flu2019_SVI <- glm(flu_2019 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + mstat_5 + relig_affil
                      + lang_3 + act_tob + max_ch + IC + insur_type
                      + pop_dens + r_pct + RPL_THEMES,
              family = "binomial", 
              data = flu_clean2)
summary(Flu2019_SVI )

Call:
glm(formula = flu_2019 ~ ibd_3 + age_yrs + gender + race_5 + 
    ethnic_3 + mstat_5 + relig_affil + lang_3 + act_tob + max_ch + 
    IC + insur_type + pop_dens + r_pct + RPL_THEMES, family = "binomial", 
    data = flu_clean2)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.8369  -1.0743  -0.7264   1.1336   2.0387  

Coefficients:
                                         Estimate Std. Error z value Pr(>|z|)    
(Intercept)                             5.886e-01  2.085e-01   2.823 0.004762 ** 
ibd_3UC                                 2.133e-02  5.945e-02   0.359 0.719767    
ibd_3Unspecified                       -3.826e-02  5.064e-01  -0.076 0.939772    
age_yrs                                -8.499e-03  2.246e-03  -3.784 0.000154 ***
genderFemale                            1.769e-01  5.651e-02   3.131 0.001741 ** 
race_5Black                            -5.568e-01  1.249e-01  -4.456 8.33e-06 ***
race_5Asian                             5.063e-01  1.935e-01   2.616 0.008901 ** 
race_5Native                           -4.015e-03  4.929e-01  -0.008 0.993501    
race_5Other                            -1.695e-01  1.718e-01  -0.986 0.324024    
ethnic_3Hispanic                        3.610e-01  2.109e-01   1.712 0.086972 .  
mstat_5Unmarried                       -1.864e-01  7.226e-02  -2.580 0.009884 ** 
mstat_5DivorcedSeparated                1.012e-01  1.488e-01   0.680 0.496526    
mstat_5Widow                           -3.476e-01  2.046e-01  -1.699 0.089411 .  
relig_affilNo                          -1.596e-01  5.794e-02  -2.755 0.005871 ** 
lang_3Other                            -5.676e-02  3.265e-01  -0.174 0.862007    
act_tobYes                             -1.554e-01  9.272e-02  -1.676 0.093724 .  
max_ch                                  2.863e-02  6.153e-03   4.653 3.27e-06 ***
IC                                      5.185e-01  6.403e-02   8.097 5.62e-16 ***
insur_typeMedicare                     -1.171e-01  1.157e-01  -1.013 0.311297    
insur_typeOther                        -2.800e-01  6.255e-01  -0.448 0.654343    
insur_typeOther Governmental Insurance -6.791e-01  3.944e-01  -1.722 0.085087 .  
insur_typePrivate Insurance             4.745e-01  8.740e-02   5.429 5.68e-08 ***
pop_dens                               -1.114e-05  1.507e-05  -0.739 0.459928    
r_pct                                  -1.580e-02  2.031e-03  -7.777 7.44e-15 ***
RPL_THEMES                             -7.649e-01  1.184e-01  -6.461 1.04e-10 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 7779.0  on 5637  degrees of freedom
Residual deviance: 7345.9  on 5613  degrees of freedom
  (2593 observations deleted due to missingness)
AIC: 7395.9

Number of Fisher Scoring iterations: 4
broom::glance(Flu2019_SVI )
broom::tidy(Flu2019_SVI , exponentiate = TRUE)
tbl_regression(Flu2019_SVI, label = list(ibd_3 ~ "IBD Type", pop_dens ~ "Population density", gender~ "Gender", ethnic_3 ~ "Ethnicity", lang_3 ~ "Preferred Language", r_pct ~ "Percent Rebuplican", race_5 ~ "Race", max_ch ~ "Charlson Comorbidity Index", act_tob ~ "Active Tobacco Use", IC ~ "Immunocompromised", insur_type ~ "Insurance Type"), exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
IBD Type
    CD — —
    UC 1.02 0.91, 1.15 0.7
    Unspecified 0.96 0.34, 2.56 >0.9
age_yrs 0.99 0.99, 1.00 <0.001
Gender
    Male — —
    Female 1.19 1.07, 1.33 0.002
Race
    White — —
    Black 0.57 0.45, 0.73 <0.001
    Asian 1.66 1.14, 2.44 0.009
    Native 1.00 0.37, 2.65 >0.9
    Other 0.84 0.60, 1.18 0.3
Ethnicity
    NonHispanic — —
    Hispanic 1.43 0.95, 2.17 0.087
mstat_5
    Married — —
    Unmarried 0.83 0.72, 0.96 0.010
    DivorcedSeparated 1.11 0.83, 1.48 0.5
    Widow 0.71 0.47, 1.05 0.089
relig_affil
    Yes — —
    No 0.85 0.76, 0.95 0.006
Preferred Language
    English — —
    Other 0.94 0.49, 1.78 0.9
Active Tobacco Use
    No — —
    Yes 0.86 0.71, 1.03 0.094
Charlson Comorbidity Index 1.03 1.02, 1.04 <0.001
Immunocompromised 1.68 1.48, 1.90 <0.001
Insurance Type
    Medicaid — —
    Medicare 0.89 0.71, 1.12 0.3
    Other 0.76 0.20, 2.46 0.7
    Other Governmental Insurance 0.51 0.22, 1.06 0.085
    Private Insurance 1.61 1.35, 1.91 <0.001
Population density 1.00 1.00, 1.00 0.5
Percent Rebuplican 0.98 0.98, 0.99 <0.001
RPL_THEMES 0.47 0.37, 0.59 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

# Model performance 
model_performance(Flu2019_SVI)
# Indices of model performance

AIC      |      BIC | Tjur's R2 |  RMSE | Sigma | Log_loss | Score_log | Score_spherical |   PCP
------------------------------------------------------------------------------------------------
7395.933 | 7561.865 |     0.075 | 0.479 | 1.144 |    0.651 |      -Inf |       1.774e-04 | 0.540
performance::check_model(Flu2019_SVI, panel = TRUE)


# Margins 
cplot(Flu2019_SVI, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Flu Vaccine Given SVI")

Flu 2019 with log(SVI)

Flu2019_SVI_log <- glm(flu_2019 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + 
                         mstat_5 + relig_affil + lang_3 + act_tob + max_ch + IC + insur_type
                      + pop_dens + r_pct + log(RPL_THEMES),
              family = "binomial", 
              data = flu_clean2)
summary(Flu2019_SVI_log )

Call:
glm(formula = flu_2019 ~ ibd_3 + age_yrs + gender + race_5 + 
    ethnic_3 + mstat_5 + relig_affil + lang_3 + act_tob + max_ch + 
    IC + insur_type + pop_dens + r_pct + log(RPL_THEMES), family = "binomial", 
    data = flu_clean2)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.8239  -1.0770  -0.7306   1.1366   2.0591  

Coefficients:
                                         Estimate Std. Error z value Pr(>|z|)    
(Intercept)                             1.075e-01  2.077e-01   0.518  0.60467    
ibd_3UC                                 2.979e-02  5.936e-02   0.502  0.61576    
ibd_3Unspecified                        7.322e-03  5.069e-01   0.014  0.98847    
age_yrs                                -8.399e-03  2.242e-03  -3.746  0.00018 ***
genderFemale                            1.742e-01  5.645e-02   3.086  0.00203 ** 
race_5Black                            -6.297e-01  1.234e-01  -5.102 3.36e-07 ***
race_5Asian                             5.213e-01  1.934e-01   2.695  0.00703 ** 
race_5Native                            2.930e-02  4.916e-01   0.060  0.95247    
race_5Other                            -1.675e-01  1.717e-01  -0.976  0.32915    
ethnic_3Hispanic                        3.347e-01  2.102e-01   1.592  0.11145    
mstat_5Unmarried                       -1.841e-01  7.216e-02  -2.552  0.01072 *  
mstat_5DivorcedSeparated                8.994e-02  1.486e-01   0.605  0.54500    
mstat_5Widow                           -3.475e-01  2.045e-01  -1.700  0.08922 .  
relig_affilNo                          -1.617e-01  5.790e-02  -2.793  0.00522 ** 
lang_3Other                            -9.581e-02  3.250e-01  -0.295  0.76818    
act_tobYes                             -1.619e-01  9.257e-02  -1.749  0.08030 .  
max_ch                                  2.828e-02  6.147e-03   4.600 4.23e-06 ***
IC                                      5.204e-01  6.402e-02   8.130 4.30e-16 ***
insur_typeMedicare                     -1.016e-01  1.154e-01  -0.881  0.37850    
insur_typeOther                        -2.601e-01  6.256e-01  -0.416  0.67762    
insur_typeOther Governmental Insurance -6.665e-01  3.932e-01  -1.695  0.09004 .  
insur_typePrivate Insurance             5.014e-01  8.694e-02   5.767 8.06e-09 ***
pop_dens                               -1.493e-05  1.500e-05  -0.995  0.31971    
r_pct                                  -1.604e-02  2.030e-03  -7.902 2.75e-15 ***
log(RPL_THEMES)                        -1.437e-01  2.529e-02  -5.683 1.32e-08 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 7779.0  on 5637  degrees of freedom
Residual deviance: 7355.6  on 5613  degrees of freedom
  (2593 observations deleted due to missingness)
AIC: 7405.6

Number of Fisher Scoring iterations: 4
broom::glance(Flu2019_SVI_log )
broom::tidy(Flu2019_SVI_log , exponentiate = TRUE)
tbl_regression(Flu2019_SVI_log, label = list(ibd_3 ~ "IBD Type", pop_dens ~ "Population density", gender~ "Gender", ethnic_3 ~ "Ethnicity", lang_3 ~ "Preferred Language", r_pct ~ "Percent Rebuplican", race_5 ~ "Race", max_ch ~ "Charlson Comorbidity Index", act_tob ~ "Active Tobacco Use", IC ~ "Immunocompromised", insur_type ~ "Insurance Type"), exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
IBD Type
    CD — —
    UC 1.03 0.92, 1.16 0.6
    Unspecified 1.01 0.36, 2.68 >0.9
age_yrs 0.99 0.99, 1.00 <0.001
Gender
    Male — —
    Female 1.19 1.07, 1.33 0.002
Race
    White — —
    Black 0.53 0.42, 0.68 <0.001
    Asian 1.68 1.16, 2.48 0.007
    Native 1.03 0.39, 2.74 >0.9
    Other 0.85 0.60, 1.18 0.3
Ethnicity
    NonHispanic — —
    Hispanic 1.40 0.93, 2.12 0.11
mstat_5
    Married — —
    Unmarried 0.83 0.72, 0.96 0.011
    DivorcedSeparated 1.09 0.82, 1.46 0.5
    Widow 0.71 0.47, 1.05 0.089
relig_affil
    Yes — —
    No 0.85 0.76, 0.95 0.005
Preferred Language
    English — —
    Other 0.91 0.48, 1.71 0.8
Active Tobacco Use
    No — —
    Yes 0.85 0.71, 1.02 0.080
Charlson Comorbidity Index 1.03 1.02, 1.04 <0.001
Immunocompromised 1.68 1.48, 1.91 <0.001
Insurance Type
    Medicaid — —
    Medicare 0.90 0.72, 1.13 0.4
    Other 0.77 0.20, 2.52 0.7
    Other Governmental Insurance 0.51 0.22, 1.07 0.090
    Private Insurance 1.65 1.39, 1.96 <0.001
Population density 1.00 1.00, 1.00 0.3
Percent Rebuplican 0.98 0.98, 0.99 <0.001
log(RPL_THEMES) 0.87 0.82, 0.91 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

# Model performance 
model_performance(Flu2019_SVI_log)
# Indices of model performance

AIC      |      BIC | Tjur's R2 |  RMSE | Sigma | Log_loss | Score_log | Score_spherical |   PCP
------------------------------------------------------------------------------------------------
7405.577 | 7571.510 |     0.073 | 0.480 | 1.145 |    0.652 |      -Inf |       1.774e-04 | 0.540
performance::check_model(Flu2019_SVI_log, panel = TRUE)


# Margins 
cplot(Flu2019_SVI_log, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Flu Vaccine Given SVI")

Flu 2019 with SVI as Quadratic

Flu2019_SVI_quad <- glm(flu_2019 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + 
                      relig_affil + mstat_5 + lang_3 + act_tob + max_ch + IC + insur_type
                      + pop_dens + r_pct + I(RPL_THEMES^2),
              family = "binomial", 
              data = flu_clean2)
summary(Flu2019_SVI_quad )

Call:
glm(formula = flu_2019 ~ ibd_3 + age_yrs + gender + race_5 + 
    ethnic_3 + relig_affil + mstat_5 + lang_3 + act_tob + max_ch + 
    IC + insur_type + pop_dens + r_pct + I(RPL_THEMES^2), family = "binomial", 
    data = flu_clean2)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.8696  -1.0748  -0.7298   1.1308   2.0163  

Coefficients:
                                         Estimate Std. Error z value Pr(>|z|)    
(Intercept)                             4.993e-01  2.064e-01   2.419 0.015582 *  
ibd_3UC                                 2.003e-02  5.944e-02   0.337 0.736126    
ibd_3Unspecified                       -4.473e-02  5.046e-01  -0.089 0.929358    
age_yrs                                -8.597e-03  2.245e-03  -3.829 0.000129 ***
genderFemale                            1.760e-01  5.648e-02   3.115 0.001837 ** 
race_5Black                            -5.442e-01  1.257e-01  -4.328 1.50e-05 ***
race_5Asian                             4.999e-01  1.935e-01   2.583 0.009795 ** 
race_5Native                           -2.030e-02  4.926e-01  -0.041 0.967125    
race_5Other                            -1.664e-01  1.718e-01  -0.969 0.332590    
ethnic_3Hispanic                        3.692e-01  2.110e-01   1.749 0.080240 .  
relig_affilNo                          -1.595e-01  5.792e-02  -2.754 0.005881 ** 
mstat_5Unmarried                       -1.916e-01  7.223e-02  -2.652 0.008003 ** 
mstat_5DivorcedSeparated                9.033e-02  1.487e-01   0.607 0.543619    
mstat_5Widow                           -3.464e-01  2.047e-01  -1.692 0.090603 .  
lang_3Other                            -4.776e-02  3.267e-01  -0.146 0.883786    
act_tobYes                             -1.584e-01  9.270e-02  -1.708 0.087552 .  
max_ch                                  2.855e-02  6.151e-03   4.642 3.46e-06 ***
IC                                      5.166e-01  6.399e-02   8.074 6.82e-16 ***
insur_typeMedicare                     -1.146e-01  1.157e-01  -0.991 0.321650    
insur_typeOther                        -2.575e-01  6.250e-01  -0.412 0.680346    
insur_typeOther Governmental Insurance -6.830e-01  3.947e-01  -1.730 0.083572 .  
insur_typePrivate Insurance             4.791e-01  8.739e-02   5.482 4.20e-08 ***
pop_dens                               -1.304e-05  1.505e-05  -0.866 0.386330    
r_pct                                  -1.602e-02  2.031e-03  -7.887 3.09e-15 ***
I(RPL_THEMES^2)                        -8.381e-01  1.382e-01  -6.064 1.33e-09 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 7779.0  on 5637  degrees of freedom
Residual deviance: 7350.6  on 5613  degrees of freedom
  (2593 observations deleted due to missingness)
AIC: 7400.6

Number of Fisher Scoring iterations: 4
broom::glance(Flu2019_SVI_quad )
broom::tidy(Flu2019_SVI_quad , exponentiate = TRUE)
tbl_regression(Flu2019_SVI_quad, label = list(ibd_3 ~ "IBD Type", pop_dens ~ "Population density", gender~ "Gender", ethnic_3 ~ "Ethnicity", lang_3 ~ "Preferred Language", r_pct ~ "Percent Rebuplican", race_5 ~ "Race", max_ch ~ "Charlson Comorbidity Index", act_tob ~ "Active Tobacco Use", IC ~ "Immunocompromised", insur_type ~ "Insurance Type"), exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
IBD Type
    CD — —
    UC 1.02 0.91, 1.15 0.7
    Unspecified 0.96 0.34, 2.53 >0.9
age_yrs 0.99 0.99, 1.00 <0.001
Gender
    Male — —
    Female 1.19 1.07, 1.33 0.002
Race
    White — —
    Black 0.58 0.45, 0.74 <0.001
    Asian 1.65 1.13, 2.43 0.010
    Native 0.98 0.37, 2.61 >0.9
    Other 0.85 0.60, 1.18 0.3
Ethnicity
    NonHispanic — —
    Hispanic 1.45 0.96, 2.19 0.080
relig_affil
    Yes — —
    No 0.85 0.76, 0.95 0.006
mstat_5
    Married — —
    Unmarried 0.83 0.72, 0.95 0.008
    DivorcedSeparated 1.09 0.82, 1.46 0.5
    Widow 0.71 0.47, 1.05 0.091
Preferred Language
    English — —
    Other 0.95 0.50, 1.80 0.9
Active Tobacco Use
    No — —
    Yes 0.85 0.71, 1.02 0.088
Charlson Comorbidity Index 1.03 1.02, 1.04 <0.001
Immunocompromised 1.68 1.48, 1.90 <0.001
Insurance Type
    Medicaid — —
    Medicare 0.89 0.71, 1.12 0.3
    Other 0.77 0.20, 2.52 0.7
    Other Governmental Insurance 0.51 0.22, 1.05 0.084
    Private Insurance 1.61 1.36, 1.92 <0.001
Population density 1.00 1.00, 1.00 0.4
Percent Rebuplican 0.98 0.98, 0.99 <0.001
I(RPL_THEMES^2) 0.43 0.33, 0.57 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

# Model performance 
model_performance(Flu2019_SVI_quad)
# Indices of model performance

AIC      |      BIC | Tjur's R2 |  RMSE | Sigma | Log_loss | Score_log | Score_spherical |   PCP
------------------------------------------------------------------------------------------------
7420.518 | 7586.451 |     0.074 | 0.480 | 1.144 |    0.652 |      -Inf |       1.774e-04 | 0.540
performance::check_model(Flu2019_SVI_quad, panel = TRUE)


# Margins 
cplot(Flu2019_SVI_quad, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Flu Vaccine Given SVI")

Flu 2019 with SVI as Quartile

Flu2019_SVI_quart <- glm(flu_2019 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + 
                      relig_affil + mstat_5 + lang_3 + act_tob + max_ch + IC + insur_type
                      + pop_dens + r_pct + RPL_4,
              family = "binomial", 
              data = flu_clean2)
summary(Flu2019_SVI_quart )

Call:
glm(formula = flu_2019 ~ ibd_3 + age_yrs + gender + race_5 + 
    ethnic_3 + relig_affil + mstat_5 + lang_3 + act_tob + max_ch + 
    IC + insur_type + pop_dens + r_pct + RPL_4, family = "binomial", 
    data = flu_clean2)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.8450  -1.0727  -0.7284   1.1361   2.0425  

Coefficients:
                                         Estimate Std. Error z value Pr(>|z|)    
(Intercept)                             5.125e-01  2.069e-01   2.478 0.013230 *  
ibd_3UC                                 2.156e-02  5.946e-02   0.363 0.716857    
ibd_3Unspecified                       -5.664e-02  5.062e-01  -0.112 0.910910    
age_yrs                                -8.535e-03  2.246e-03  -3.800 0.000145 ***
genderFemale                            1.791e-01  5.650e-02   3.170 0.001524 ** 
race_5Black                            -5.748e-01  1.252e-01  -4.590 4.44e-06 ***
race_5Asian                             5.138e-01  1.937e-01   2.653 0.007986 ** 
race_5Native                           -3.010e-02  4.941e-01  -0.061 0.951412    
race_5Other                            -1.738e-01  1.718e-01  -1.011 0.311817    
ethnic_3Hispanic                        3.541e-01  2.107e-01   1.680 0.092942 .  
relig_affilNo                          -1.586e-01  5.792e-02  -2.738 0.006183 ** 
mstat_5Unmarried                       -1.886e-01  7.227e-02  -2.609 0.009073 ** 
mstat_5DivorcedSeparated                9.514e-02  1.488e-01   0.639 0.522531    
mstat_5Widow                           -3.486e-01  2.046e-01  -1.704 0.088451 .  
lang_3Other                            -6.375e-02  3.272e-01  -0.195 0.845528    
act_tobYes                             -1.581e-01  9.270e-02  -1.706 0.088067 .  
max_ch                                  2.883e-02  6.153e-03   4.685 2.80e-06 ***
IC                                      5.119e-01  6.399e-02   8.000 1.25e-15 ***
insur_typeMedicare                     -1.184e-01  1.157e-01  -1.024 0.306004    
insur_typeOther                        -2.575e-01  6.247e-01  -0.412 0.680234    
insur_typeOther Governmental Insurance -6.759e-01  3.942e-01  -1.715 0.086401 .  
insur_typePrivate Insurance             4.800e-01  8.740e-02   5.492 3.98e-08 ***
pop_dens                               -1.278e-05  1.506e-05  -0.849 0.396042    
r_pct                                  -1.581e-02  2.038e-03  -7.756 8.79e-15 ***
RPL_4Second                            -2.150e-01  6.650e-02  -3.233 0.001224 ** 
RPL_4Third                             -3.683e-01  8.011e-02  -4.597 4.29e-06 ***
RPL_4Fourth                            -5.713e-01  1.122e-01  -5.094 3.50e-07 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 7779  on 5637  degrees of freedom
Residual deviance: 7349  on 5611  degrees of freedom
  (2593 observations deleted due to missingness)
AIC: 7403

Number of Fisher Scoring iterations: 4
broom::glance(Flu2019_SVI_quart )
broom::tidy(Flu2019_SVI_quart , exponentiate = TRUE)
tbl_regression(Flu2019_SVI_quart, label = list(ibd_3 ~ "IBD Type", pop_dens ~ "Population density", gender~ "Gender", ethnic_3 ~ "Ethnicity", lang_3 ~ "Preferred Language", r_pct ~ "Percent Rebuplican", race_5 ~ "Race", max_ch ~ "Charlson Comorbidity Index", act_tob ~ "Active Tobacco Use", IC ~ "Immunocompromised", insur_type ~ "Insurance Type"), exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
IBD Type
    CD — —
    UC 1.02 0.91, 1.15 0.7
    Unspecified 0.94 0.33, 2.51 >0.9
age_yrs 0.99 0.99, 1.00 <0.001
Gender
    Male — —
    Female 1.20 1.07, 1.34 0.002
Race
    White — —
    Black 0.56 0.44, 0.72 <0.001
    Asian 1.67 1.15, 2.46 0.008
    Native 0.97 0.36, 2.59 >0.9
    Other 0.84 0.60, 1.18 0.3
Ethnicity
    NonHispanic — —
    Hispanic 1.42 0.94, 2.16 0.093
relig_affil
    Yes — —
    No 0.85 0.76, 0.96 0.006
mstat_5
    Married — —
    Unmarried 0.83 0.72, 0.95 0.009
    DivorcedSeparated 1.10 0.82, 1.47 0.5
    Widow 0.71 0.47, 1.05 0.088
Preferred Language
    English — —
    Other 0.94 0.49, 1.77 0.8
Active Tobacco Use
    No — —
    Yes 0.85 0.71, 1.02 0.088
Charlson Comorbidity Index 1.03 1.02, 1.04 <0.001
Immunocompromised 1.67 1.47, 1.89 <0.001
Insurance Type
    Medicaid — —
    Medicare 0.89 0.71, 1.11 0.3
    Other 0.77 0.20, 2.52 0.7
    Other Governmental Insurance 0.51 0.22, 1.06 0.086
    Private Insurance 1.62 1.36, 1.92 <0.001
Population density 1.00 1.00, 1.00 0.4
Percent Rebuplican 0.98 0.98, 0.99 <0.001
RPL_4
    First — —
    Second 0.81 0.71, 0.92 0.001
    Third 0.69 0.59, 0.81 <0.001
    Fourth 0.56 0.45, 0.70 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

# Model performance 
model_performance(Flu2019_SVI_quart)
# Indices of model performance

AIC      |      BIC | Tjur's R2 |  RMSE | Sigma | Log_loss | Score_log | Score_spherical |   PCP
------------------------------------------------------------------------------------------------
7402.972 | 7582.179 |     0.074 | 0.479 | 1.144 |    0.652 |      -Inf |       1.774e-04 | 0.540
performance::check_model(Flu2019_SVI_quart, panel = TRUE)


# Margins 
cplot(Flu2019_SVI_quart, "RPL_4", what = "prediction", main = "Predicted Likelihood of Flu Vaccine Given SVI")

NA
NA

Flu 2019 + All SVI Themes

Flu2019_all_themes <- glm(flu_2019 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + 
                      lang_3 + mstat_5 + relig_affil + act_tob + max_ch + IC
                      + pop_dens + r_pct + RPL_THEME1 + RPL_THEME2 + RPL_THEME3
                      + RPL_THEME4,
              family = "binomial",
              data = flu_clean2)
summary(Flu2019_all_themes )

Call:
glm(formula = flu_2019 ~ ibd_3 + age_yrs + gender + race_5 + 
    ethnic_3 + lang_3 + mstat_5 + relig_affil + act_tob + max_ch + 
    IC + pop_dens + r_pct + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + 
    RPL_THEME4, family = "binomial", data = flu_clean2)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.8409  -1.0760  -0.7704   1.1625   1.9130  

Coefficients:
                           Estimate Std. Error z value Pr(>|z|)    
(Intercept)               1.393e+00  2.185e-01   6.377 1.80e-10 ***
ibd_3UC                   3.600e-02  5.928e-02   0.607  0.54362    
ibd_3Unspecified         -1.211e-01  4.992e-01  -0.243  0.80832    
age_yrs                  -1.361e-02  2.036e-03  -6.682 2.35e-11 ***
genderFemale              1.728e-01  5.634e-02   3.067  0.00216 ** 
race_5Black              -5.715e-01  1.261e-01  -4.531 5.87e-06 ***
race_5Asian               5.743e-01  1.955e-01   2.938  0.00330 ** 
race_5Native             -1.361e-01  4.907e-01  -0.277  0.78151    
race_5Other              -2.235e-01  1.715e-01  -1.303  0.19250    
ethnic_3Hispanic          4.088e-01  2.106e-01   1.941  0.05222 .  
lang_3Other              -2.520e-01  3.249e-01  -0.776  0.43804    
mstat_5Unmarried         -3.054e-01  7.075e-02  -4.317 1.58e-05 ***
mstat_5DivorcedSeparated -2.519e-02  1.470e-01  -0.171  0.86395    
mstat_5Widow             -4.595e-01  2.030e-01  -2.263  0.02362 *  
relig_affilNo            -1.539e-01  5.795e-02  -2.656  0.00791 ** 
act_tobYes               -2.081e-01  9.174e-02  -2.268  0.02330 *  
max_ch                    2.387e-02  6.089e-03   3.921 8.83e-05 ***
IC                        5.327e-01  6.394e-02   8.331  < 2e-16 ***
pop_dens                 -9.055e-06  1.598e-05  -0.567  0.57087    
r_pct                    -1.579e-02  2.419e-03  -6.529 6.63e-11 ***
RPL_THEME1               -5.079e-01  1.745e-01  -2.911  0.00360 ** 
RPL_THEME2               -4.615e-01  1.468e-01  -3.145  0.00166 ** 
RPL_THEME3               -2.210e-01  1.188e-01  -1.860  0.06288 .  
RPL_THEME4               -6.330e-02  1.245e-01  -0.508  0.61128    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 7710.5  on 5589  degrees of freedom
Residual deviance: 7350.4  on 5566  degrees of freedom
  (2641 observations deleted due to missingness)
AIC: 7398.4

Number of Fisher Scoring iterations: 4
broom::glance(Flu2019_all_themes )
broom::tidy(Flu2019_all_themes , exponentiate = TRUE)
tbl_regression(Flu2019_all_themes, label = list(ibd_3 ~ "IBD Type", age_yrs ~ "Age", pop_dens ~ "Population density", gender~ "Gender", ethnic_3 ~ "Ethnicity", lang_3 ~ "Preferred Language", relig_affil ~ "Any Religious Affiliation", mstat_5 ~ "Marital Status", r_pct ~ "Percent Rebuplican", race_5 ~ "Race", max_ch ~ "Charlson Comorbidity Index", act_tob ~ "Active Tobacco Use", RPL_THEME1 ~ "Soceioeconomic Status", RPL_THEME2 ~ "Household Composition", RPL_THEME3 ~ "Minority Status and Language", RPL_THEME4 ~ "Housing and Transportation"), exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
IBD Type
    CD — —
    UC 1.04 0.92, 1.16 0.5
    Unspecified 0.89 0.32, 2.32 0.8
Age 0.99 0.98, 0.99 <0.001
Gender
    Male — —
    Female 1.19 1.06, 1.33 0.002
Race
    White — —
    Black 0.56 0.44, 0.72 <0.001
    Asian 1.78 1.22, 2.62 0.003
    Native 0.87 0.33, 2.32 0.8
    Other 0.80 0.57, 1.12 0.2
Ethnicity
    NonHispanic — —
    Hispanic 1.50 1.00, 2.28 0.052
Preferred Language
    English — —
    Other 0.78 0.41, 1.46 0.4
Marital Status
    Married — —
    Unmarried 0.74 0.64, 0.85 <0.001
    DivorcedSeparated 0.98 0.73, 1.30 0.9
    Widow 0.63 0.42, 0.93 0.024
Any Religious Affiliation
    Yes — —
    No 0.86 0.77, 0.96 0.008
Active Tobacco Use
    No — —
    Yes 0.81 0.68, 0.97 0.023
Charlson Comorbidity Index 1.02 1.01, 1.04 <0.001
IC 1.70 1.50, 1.93 <0.001
Population density 1.00 1.00, 1.00 0.6
Percent Rebuplican 0.98 0.98, 0.99 <0.001
Soceioeconomic Status 0.60 0.43, 0.85 0.004
Household Composition 0.63 0.47, 0.84 0.002
Minority Status and Language 0.80 0.63, 1.01 0.063
Housing and Transportation 0.94 0.74, 1.20 0.6
1 OR = Odds Ratio, CI = Confidence Interval

# Model performance 
model_performance(Flu2019_all_themes)
# Indices of model performance

AIC      |      BIC | Tjur's R2 |  RMSE | Sigma | Log_loss | Score_log | Score_spherical |   PCP
------------------------------------------------------------------------------------------------
7398.398 | 7557.487 |     0.063 | 0.482 | 1.149 |    0.657 |      -Inf |       1.789e-04 | 0.535
performance::check_model(Flu2019_all_themes, panel = TRUE)


# Margins 
cplot(Flu2019_all_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Flu Vaccine Given THEME1")

cplot(Flu2019_all_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Flu Vaccine Given THEME2")

cplot(Flu2019_all_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Flu Vaccine Given THEME3")

cplot(Flu2019_all_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Flu Vaccine Given THEME4")

LS0tCnRpdGxlOiAiRmx1IDIwMTkgTW9kZWxzIgpvdXRwdXQ6CiAgaHRtbF9ub3RlYm9vazoKICAgIHRoZW1lczogcGFwZXIKICAgIHRvYzogeWVzCiAgICB0b2NfZmxvYXQ6IHllcwplZGl0b3Jfb3B0aW9uczoKICBjaHVua19vdXRwdXRfdHlwZTogaW5saW5lCmRhdGU6ICIyMDIzLTAxLTA2IgotLS0KIyBMb2FkIFBhY2thZ2VzIApgYGB7cn0KbGlicmFyeSh0aWR5dmVyc2UpCmxpYnJhcnkoY29kZWJvb2tyKQpsaWJyYXJ5KHN1bW1hcnl0b29scykKbGlicmFyeShicm9vbSkgCmxpYnJhcnkocGVyZm9ybWFuY2UpCmxpYnJhcnkoZ3QpCmxpYnJhcnkoZ3RzdW1tYXJ5KQpsaWJyYXJ5KGphbml0b3IpCmxpYnJhcnkoZm9yY2F0cykKbGlicmFyeShoZXJlKQpsaWJyYXJ5KG1hcmdpbnMpCmxpYnJhcnkoZ2dwbG90MikKbGlicmFyeShtZWRpYXRpb24pCmBgYAoKIyBJbXBvcnQgRGF0YSAKYGBge3J9CmxvYWQoIn4vRGVza3RvcC9SLUNvZGUvU0RPSF9WYXgvZmx1XzIwMTlfbGF0ZXIucmRhIikKVmlldyhmbHVfMjAxOV9sYXRlcikKYGBgCgojIEluY2x1ZGUgb25seSBwYXRpZW50cyBmcm9tIE1pY2hpZ2FuC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