Multivariable Models: All Biologics
All biologics rx + total SVI
med_data_ALL$biologic_2 <- as.numeric(med_data_ALL$biologic_2)
Biologic_Rx <- glm(biologic_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + max_ch + act_tob + insurance +
RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(Biologic_Rx )
Call:
glm(formula = biologic_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + max_ch + act_tob + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.1583 -0.9794 0.5214 0.9533 2.3352
Coefficients:
Estimate Std. Error
(Intercept) 2.497283 0.196696
ibd_3UC -1.411463 0.048367
ibd_3IC -11.791994 137.628707
ibd_3Unknown -1.895364 0.398434
age_yrs -0.029825 0.001614
genderFemale -0.206236 0.047882
race_5Black 0.080900 0.098034
race_5Asian or Pacific Islander -0.315182 0.153648
race_5American Indian or Alaska Native -0.473793 0.371300
race_5Other 0.081888 0.142608
ethnic_3Non-Hispanic -0.018151 0.177975
lang_3Other -0.423768 0.262604
max_ch -0.031478 0.005364
act_tobYes -0.087711 0.074639
insuranceMedicaid -0.218958 0.070300
insuranceMedicare -0.187873 0.074594
insuranceOther Governmental -0.501411 0.296163
insuranceOther -0.154811 0.346193
RPL_THEMES 0.099968 0.098885
z value Pr(>|z|)
(Intercept) 12.696 < 2e-16 ***
ibd_3UC -29.182 < 2e-16 ***
ibd_3IC -0.086 0.93172
ibd_3Unknown -4.757 1.96e-06 ***
age_yrs -18.474 < 2e-16 ***
genderFemale -4.307 1.65e-05 ***
race_5Black 0.825 0.40924
race_5Asian or Pacific Islander -2.051 0.04024 *
race_5American Indian or Alaska Native -1.276 0.20194
race_5Other 0.574 0.56582
ethnic_3Non-Hispanic -0.102 0.91877
lang_3Other -1.614 0.10659
max_ch -5.868 4.40e-09 ***
act_tobYes -1.175 0.23994
insuranceMedicaid -3.115 0.00184 **
insuranceMedicare -2.519 0.01178 *
insuranceOther Governmental -1.693 0.09045 .
insuranceOther -0.447 0.65474
RPL_THEMES 1.011 0.31204
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12417 on 8962 degrees of freedom
Residual deviance: 10432 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 10470
Number of Fisher Scoring iterations: 10
broom::glance(Biologic_Rx )
broom::tidy(Biologic_Rx , exponentiate = TRUE)
tbl_regression(Biologic_Rx, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.24 |
0.22, 0.27 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.15 |
0.07, 0.32 |
<0.001 |
| Age |
0.97 |
0.97, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.81 |
0.74, 0.89 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.08 |
0.90, 1.31 |
0.4 |
| Â Â Â Â Asian or Pacific Islander |
0.73 |
0.54, 0.99 |
0.040 |
| Â Â Â Â American Indian or Alaska Native |
0.62 |
0.30, 1.28 |
0.2 |
| Â Â Â Â Other |
1.09 |
0.82, 1.44 |
0.6 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.98 |
0.69, 1.39 |
>0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.65 |
0.39, 1.09 |
0.11 |
| Charlson Comorbidity Index |
0.97 |
0.96, 0.98 |
<0.001 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.92 |
0.79, 1.06 |
0.2 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.80 |
0.70, 0.92 |
0.002 |
| Â Â Â Â Medicare |
0.83 |
0.72, 0.96 |
0.012 |
| Â Â Â Â Other Governmental |
0.61 |
0.34, 1.08 |
0.090 |
| Â Â Â Â Other |
0.86 |
0.43, 1.69 |
0.7 |
| Social Vulnerability Index |
1.11 |
0.91, 1.34 |
0.3 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(Biologic_Rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 26.39475
degrees of freedom = 9
p-value = 0.0017601
# C-Statistic/AUROC
Cstat(Biologic_Rx)
[1] 0.7610202
# Model performance
model_performance(Biologic_Rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
10469.837 | 10469.922 | 10604.753 | 0.205 | 0.446 | 1.080 | 0.582 | -Inf | 1.578e-04 | 0.603
performance::check_model(Biologic_Rx)
Variable `Component` is not in your data frame :/

# Margins
margins(Biologic_Rx)
Average marginal effects
glm(formula = biologic_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + max_ch + act_tob + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(Biologic_Rx, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given SVI")

All biologics rx + SVI Sub-themes
Biologic_Rx_themes <- glm(biologic_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = baseline_rx)
summary(Biologic_Rx_themes )
Call:
glm(formula = biologic_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = baseline_rx)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.1397 -0.9773 0.5182 0.9491 2.3744
Coefficients:
Estimate Std. Error
(Intercept) 2.505815 0.204240
ibd_3UC -1.404756 0.048522
ibd_3IC -11.906524 135.914932
ibd_3Unknown -1.904871 0.398713
age_yrs -0.029964 0.001623
genderFemale -0.200449 0.048036
race_5Black 0.059956 0.099969
race_5Asian or Pacific Islander -0.286736 0.155981
race_5American Indian or Alaska Native -0.459562 0.373243
race_5Other 0.093098 0.143615
ethnic_3Non-Hispanic -0.002235 0.178576
lang_3Other -0.417469 0.264136
act_tobYes -0.096689 0.074896
max_ch -0.031462 0.005390
insuranceMedicaid -0.235469 0.070689
insuranceMedicare -0.189478 0.074816
insuranceOther Governmental -0.510275 0.296214
insuranceOther -0.166931 0.344676
RPL_THEME1 0.284601 0.140237
RPL_THEME2 0.132258 0.120368
RPL_THEME3 0.017103 0.087377
RPL_THEME4 -0.318383 0.100853
z value Pr(>|z|)
(Intercept) 12.269 < 2e-16 ***
ibd_3UC -28.951 < 2e-16 ***
ibd_3IC -0.088 0.930192
ibd_3Unknown -4.778 1.77e-06 ***
age_yrs -18.467 < 2e-16 ***
genderFemale -4.173 3.01e-05 ***
race_5Black 0.600 0.548679
race_5Asian or Pacific Islander -1.838 0.066022 .
race_5American Indian or Alaska Native -1.231 0.218222
race_5Other 0.648 0.516827
ethnic_3Non-Hispanic -0.013 0.990014
lang_3Other -1.581 0.113991
act_tobYes -1.291 0.196709
max_ch -5.837 5.31e-09 ***
insuranceMedicaid -3.331 0.000865 ***
insuranceMedicare -2.533 0.011323 *
insuranceOther Governmental -1.723 0.084951 .
insuranceOther -0.484 0.628163
RPL_THEME1 2.029 0.042414 *
RPL_THEME2 1.099 0.271864
RPL_THEME3 0.196 0.844815
RPL_THEME4 -3.157 0.001595 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12341 on 8908 degrees of freedom
Residual deviance: 10366 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 10410
Number of Fisher Scoring iterations: 10
broom::glance(Biologic_Rx_themes )
broom::tidy(Biologic_Rx_themes , exponentiate = TRUE)
tbl_regression(Biologic_Rx_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.25 |
0.22, 0.27 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.15 |
0.06, 0.31 |
<0.001 |
| Age |
0.97 |
0.97, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.82 |
0.74, 0.90 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.06 |
0.87, 1.29 |
0.5 |
| Â Â Â Â Asian or Pacific Islander |
0.75 |
0.55, 1.02 |
0.066 |
| Â Â Â Â American Indian or Alaska Native |
0.63 |
0.30, 1.30 |
0.2 |
| Â Â Â Â Other |
1.10 |
0.83, 1.46 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.00 |
0.70, 1.41 |
>0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.66 |
0.39, 1.10 |
0.11 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.91 |
0.78, 1.05 |
0.2 |
| Charlson Comorbidity Index |
0.97 |
0.96, 0.98 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.79 |
0.69, 0.91 |
<0.001 |
| Â Â Â Â Medicare |
0.83 |
0.71, 0.96 |
0.011 |
| Â Â Â Â Other Governmental |
0.60 |
0.33, 1.07 |
0.085 |
| Â Â Â Â Other |
0.85 |
0.43, 1.67 |
0.6 |
| Socioeconomic Status |
1.33 |
1.01, 1.75 |
0.042 |
| Household Composition |
1.14 |
0.90, 1.45 |
0.3 |
| Minority and Language Status |
1.02 |
0.86, 1.21 |
0.8 |
| Housing and Transportation |
0.73 |
0.60, 0.89 |
0.002 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(Biologic_Rx_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 27.15167
degrees of freedom = 8
p-value = 0.00066559
# C-Statistic/AUROC
Cstat(Biologic_Rx_themes)
[1] 0.7611032
# Model performance
model_performance(Biologic_Rx_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
10409.812 | 10409.926 | 10565.898 | 0.205 | 0.446 | 1.080 | 0.582 | -Inf | 1.587e-04 | 0.603
performance::check_model(Biologic_Rx_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(Biologic_Rx_themes)
Average marginal effects
glm(formula = biologic_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = baseline_rx)
cplot(Biologic_Rx_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given Theme1")

cplot(Biologic_Rx_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given Theme2")

cplot(Biologic_Rx_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given Theme3")

cplot(Biologic_Rx_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given Theme4")

All biologics rx + sub-sub themes
bio_rx_themes2 <- glm(biologic_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(bio_rx_themes2 )
Call:
glm(formula = biologic_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.0445 -1.0044 0.5316 0.9744 2.2976
Coefficients:
Estimate Std. Error
(Intercept) 2.534708 0.563924
ibd_3UC -1.270566 0.101119
ibd_3Unknown -2.215144 1.091673
age_yrs -0.029422 0.003464
genderFemale -0.225315 0.100387
race_5Black 0.115105 0.217649
race_5Asian or Pacific Islander -0.352491 0.468891
race_5American Indian or Alaska Native -0.091702 0.554575
race_5Other 0.060455 0.351847
ethnic_3Non-Hispanic -0.441428 0.413670
lang_3Other -0.970993 0.777450
act_tobYes -0.077361 0.141440
max_ch -0.024579 0.010709
insuranceMedicaid -0.124857 0.137049
insuranceMedicare -0.211072 0.148230
insuranceOther Governmental -0.080473 0.575876
insuranceOther 0.695267 0.905407
EPL_MUNIT 0.181932 0.287118
EPL_MOBILE 0.210277 0.315687
EPL_CROWD 0.038734 0.241294
EPL_NOVEH -0.160511 0.253192
EPL_GROUPQ 0.122727 0.225204
z value Pr(>|z|)
(Intercept) 4.495 6.96e-06 ***
ibd_3UC -12.565 < 2e-16 ***
ibd_3Unknown -2.029 0.0424 *
age_yrs -8.494 < 2e-16 ***
genderFemale -2.244 0.0248 *
race_5Black 0.529 0.5969
race_5Asian or Pacific Islander -0.752 0.4522
race_5American Indian or Alaska Native -0.165 0.8687
race_5Other 0.172 0.8636
ethnic_3Non-Hispanic -1.067 0.2859
lang_3Other -1.249 0.2117
act_tobYes -0.547 0.5844
max_ch -2.295 0.0217 *
insuranceMedicaid -0.911 0.3623
insuranceMedicare -1.424 0.1545
insuranceOther Governmental -0.140 0.8889
insuranceOther 0.768 0.4425
EPL_MUNIT 0.634 0.5263
EPL_MOBILE 0.666 0.5054
EPL_CROWD 0.161 0.8725
EPL_NOVEH -0.634 0.5261
EPL_GROUPQ 0.545 0.5858
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2788.2 on 2012 degrees of freedom
Residual deviance: 2387.0 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 2431
Number of Fisher Scoring iterations: 4
broom::glance(bio_rx_themes2 )
broom::tidy(bio_rx_themes2 , exponentiate = TRUE)
tbl_regression(bio_rx_themes2, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.28 |
0.23, 0.34 |
<0.001 |
| Â Â Â Â Unknown |
0.11 |
0.01, 0.65 |
0.042 |
| Age |
0.97 |
0.96, 0.98 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.80 |
0.66, 0.97 |
0.025 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.12 |
0.73, 1.73 |
0.6 |
| Â Â Â Â Asian or Pacific Islander |
0.70 |
0.28, 1.77 |
0.5 |
| Â Â Â Â American Indian or Alaska Native |
0.91 |
0.30, 2.73 |
0.9 |
| Â Â Â Â Other |
1.06 |
0.53, 2.13 |
0.9 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.64 |
0.28, 1.43 |
0.3 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.38 |
0.07, 1.62 |
0.2 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.93 |
0.70, 1.22 |
0.6 |
| Charlson Comorbidity Index |
0.98 |
0.96, 1.00 |
0.022 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.88 |
0.67, 1.16 |
0.4 |
| Â Â Â Â Medicare |
0.81 |
0.61, 1.08 |
0.2 |
| Â Â Â Â Other Governmental |
0.92 |
0.30, 2.92 |
0.9 |
| Â Â Â Â Other |
2.00 |
0.38, 15.5 |
0.4 |
| % Housing with 10 or more units |
1.20 |
0.68, 2.11 |
0.5 |
| % Mobile Homes |
1.23 |
0.66, 2.29 |
0.5 |
| % Homes with more people than rooms |
1.04 |
0.65, 1.67 |
0.9 |
| % Homes with no vehicle |
0.85 |
0.52, 1.40 |
0.5 |
| % People in group quarters |
1.13 |
0.73, 1.76 |
0.6 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_rx_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 18.76701
degrees of freedom = 9
p-value = 0.027248
# C-Statistic/AUROC
Cstat(bio_rx_themes2)
[1] 0.7470312
# Model performance
model_performance(bio_rx_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
2430.977 | 2431.485 | 2554.339 | 0.185 | 0.451 | 1.095 | 0.593 | -Inf | 4.974e-04 | 0.593
performance::check_model(bio_rx_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(bio_rx_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given MUNIT")

cplot(bio_rx_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given MOBILE")

cplot(bio_rx_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given CROWD")

cplot(bio_rx_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given NOVEH")

cplot(bio_rx_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given GROUPQ")

Sustained biologic access + total SVI
Biologic_access <- glm(biologic_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + lang_3 + act_tob + max_ch + insurance +
RPL_THEMES,
family = "binomial",
data = baseline_access)
summary(Biologic_access )
Call:
glm(formula = biologic_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = baseline_access)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.9770 -0.9271 -0.5519 0.9979 2.4169
Coefficients:
Estimate Std. Error
(Intercept) 2.113379 0.192640
ibd_3UC -1.223940 0.048626
ibd_3IC -11.176999 138.595371
ibd_3Unknown -2.009342 0.492747
age_yrs -0.031478 0.001617
genderFemale -0.214193 0.047775
race_5Black 0.220209 0.095588
race_5Asian or Pacific Islander -0.096121 0.154202
race_5American Indian or Alaska Native -0.199049 0.378971
race_5Other -0.019268 0.142300
ethnic_3Non-Hispanic -0.185901 0.175106
lang_3Other -0.009360 0.264474
act_tobYes -0.019456 0.073670
max_ch -0.014493 0.005619
insuranceMedicaid -0.162586 0.068622
insuranceMedicare -0.215856 0.078809
insuranceOther Governmental -0.958742 0.326355
insuranceOther -0.068694 0.347709
RPL_THEMES -0.156117 0.098819
z value Pr(>|z|)
(Intercept) 10.971 < 2e-16 ***
ibd_3UC -25.171 < 2e-16 ***
ibd_3IC -0.081 0.93572
ibd_3Unknown -4.078 4.55e-05 ***
age_yrs -19.465 < 2e-16 ***
genderFemale -4.483 7.35e-06 ***
race_5Black 2.304 0.02124 *
race_5Asian or Pacific Islander -0.623 0.53306
race_5American Indian or Alaska Native -0.525 0.59942
race_5Other -0.135 0.89229
ethnic_3Non-Hispanic -1.062 0.28839
lang_3Other -0.035 0.97177
act_tobYes -0.264 0.79171
max_ch -2.579 0.00990 **
insuranceMedicaid -2.369 0.01782 *
insuranceMedicare -2.739 0.00616 **
insuranceOther Governmental -2.938 0.00331 **
insuranceOther -0.198 0.84339
RPL_THEMES -1.580 0.11415
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12101 on 8962 degrees of freedom
Residual deviance: 10411 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 10449
Number of Fisher Scoring iterations: 10
broom::glance(Biologic_access )
broom::tidy(Biologic_access , exponentiate = TRUE)
tbl_regression(Biologic_access, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.29 |
0.27, 0.32 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.13 |
0.04, 0.32 |
<0.001 |
| Age |
0.97 |
0.97, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.81 |
0.74, 0.89 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.25 |
1.03, 1.50 |
0.021 |
| Â Â Â Â Asian or Pacific Islander |
0.91 |
0.67, 1.23 |
0.5 |
| Â Â Â Â American Indian or Alaska Native |
0.82 |
0.38, 1.69 |
0.6 |
| Â Â Â Â Other |
0.98 |
0.74, 1.29 |
0.9 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.83 |
0.59, 1.17 |
0.3 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.99 |
0.58, 1.65 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.98 |
0.85, 1.13 |
0.8 |
| Charlson Comorbidity Index |
0.99 |
0.97, 1.00 |
0.010 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.85 |
0.74, 0.97 |
0.018 |
| Â Â Â Â Medicare |
0.81 |
0.69, 0.94 |
0.006 |
| Â Â Â Â Other Governmental |
0.38 |
0.20, 0.71 |
0.003 |
| Â Â Â Â Other |
0.93 |
0.47, 1.83 |
0.8 |
| Social Vulnerability Index |
0.86 |
0.70, 1.04 |
0.11 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(Biologic_access)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 26.29975
degrees of freedom = 9
p-value = 0.0018245
# C-Statistic/AUROC
Cstat(Biologic_access)
[1] 0.7454751
# Model performance
model_performance(Biologic_access)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
10448.552 | 10448.637 | 10583.469 | 0.177 | 0.445 | 1.079 | 0.581 | -Inf | 1.578e-04 | 0.603
performance::check_model(Biologic_access)
Variable `Component` is not in your data frame :/

# Margins
margins(Biologic_access)
Average marginal effects
glm(formula = biologic_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = baseline_access)
cplot(Biologic_access, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Biologic Access Given SVI")

Sustained biologic access + SVI subthemes
Biologic_access_themes <- glm(biologic_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + lang_3 + act_tob + max_ch + insurance +
RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = baseline_access)
summary(Biologic_access_themes )
Call:
glm(formula = biologic_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = baseline_access)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.9242 -0.9321 -0.5503 0.9967 2.4097
Coefficients:
Estimate Std. Error
(Intercept) 2.059729 0.200861
ibd_3UC -1.218029 0.048810
ibd_3IC -11.366639 137.320030
ibd_3Unknown -2.023015 0.493001
age_yrs -0.031489 0.001625
genderFemale -0.209996 0.047948
race_5Black 0.146008 0.097267
race_5Asian or Pacific Islander -0.147042 0.156513
race_5American Indian or Alaska Native -0.179332 0.380358
race_5Other -0.050733 0.143554
ethnic_3Non-Hispanic -0.159575 0.176355
lang_3Other -0.058522 0.265615
act_tobYes -0.024004 0.073963
max_ch -0.014312 0.005649
insuranceMedicaid -0.169820 0.069062
insuranceMedicare -0.210924 0.079050
insuranceOther Governmental -0.960672 0.326089
insuranceOther -0.068491 0.346249
RPL_THEME1 0.186469 0.139864
RPL_THEME2 -0.035070 0.120068
RPL_THEME3 0.218331 0.087290
RPL_THEME4 -0.418652 0.100999
z value Pr(>|z|)
(Intercept) 10.254 < 2e-16 ***
ibd_3UC -24.954 < 2e-16 ***
ibd_3IC -0.083 0.93403
ibd_3Unknown -4.103 4.07e-05 ***
age_yrs -19.380 < 2e-16 ***
genderFemale -4.380 1.19e-05 ***
race_5Black 1.501 0.13333
race_5Asian or Pacific Islander -0.939 0.34748
race_5American Indian or Alaska Native -0.471 0.63730
race_5Other -0.353 0.72378
ethnic_3Non-Hispanic -0.905 0.36554
lang_3Other -0.220 0.82562
act_tobYes -0.325 0.74553
max_ch -2.534 0.01128 *
insuranceMedicaid -2.459 0.01393 *
insuranceMedicare -2.668 0.00762 **
insuranceOther Governmental -2.946 0.00322 **
insuranceOther -0.198 0.84320
RPL_THEME1 1.333 0.18246
RPL_THEME2 -0.292 0.77022
RPL_THEME3 2.501 0.01238 *
RPL_THEME4 -4.145 3.40e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12033 on 8908 degrees of freedom
Residual deviance: 10340 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 10384
Number of Fisher Scoring iterations: 10
broom::glance(Biologic_access_themes )
broom::tidy(Biologic_access_themes , exponentiate = TRUE)
tbl_regression(Biologic_access_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.30 |
0.27, 0.33 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.13 |
0.04, 0.32 |
<0.001 |
| Age |
0.97 |
0.97, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.81 |
0.74, 0.89 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.16 |
0.96, 1.40 |
0.13 |
| Â Â Â Â Asian or Pacific Islander |
0.86 |
0.63, 1.17 |
0.3 |
| Â Â Â Â American Indian or Alaska Native |
0.84 |
0.39, 1.73 |
0.6 |
| Â Â Â Â Other |
0.95 |
0.72, 1.26 |
0.7 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.85 |
0.60, 1.21 |
0.4 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.94 |
0.55, 1.58 |
0.8 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.98 |
0.84, 1.13 |
0.7 |
| Charlson Comorbidity Index |
0.99 |
0.97, 1.00 |
0.011 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.84 |
0.74, 0.97 |
0.014 |
| Â Â Â Â Medicare |
0.81 |
0.69, 0.95 |
0.008 |
| Â Â Â Â Other Governmental |
0.38 |
0.20, 0.71 |
0.003 |
| Â Â Â Â Other |
0.93 |
0.47, 1.83 |
0.8 |
| Socioeconomic Status |
1.20 |
0.92, 1.59 |
0.2 |
| Household Composition |
0.97 |
0.76, 1.22 |
0.8 |
| Minority and Language Status |
1.24 |
1.05, 1.48 |
0.012 |
| Housing and Transportation |
0.66 |
0.54, 0.80 |
<0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(Biologic_access_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 20.1345
degrees of freedom = 8
p-value = 0.009839
# C-Statistic/AUROC
Cstat(Biologic_access_themes)
[1] 0.7461675
# Model performance
model_performance(Biologic_access_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
10383.893 | 10384.007 | 10539.979 | 0.179 | 0.445 | 1.079 | 0.580 | -Inf | 1.587e-04 | 0.604
performance::check_model(Biologic_access_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(Biologic_access_themes)
Average marginal effects
glm(formula = biologic_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = baseline_access)
cplot(Biologic_access_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Biologic Access Given Theme1")

cplot(Biologic_access_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Biologic Access Given Theme2")

cplot(Biologic_access_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Biologic Access Given Theme3")

cplot(Biologic_access_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Biologic Access Given Theme4")

Sustained biologic access + sub-sub themes
med_data_ALL$biologic_3 <- as.numeric(med_data_ALL$biologic_3 )
bio_acc_themes2 <- glm(biologic_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(bio_acc_themes2 )
Call:
glm(formula = biologic_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.9033 -0.9039 -0.5603 0.9851 2.6915
Coefficients:
Estimate Std. Error
(Intercept) 2.265499 0.566514
ibd_3UC -1.193910 0.105235
ibd_3Unknown -14.159183 298.329379
age_yrs -0.030138 0.003558
genderFemale -0.319883 0.102296
race_5Black 0.233166 0.213956
race_5Asian or Pacific Islander 0.094604 0.471575
race_5American Indian or Alaska Native 0.280876 0.561713
race_5Other -0.096012 0.356454
ethnic_3Non-Hispanic -0.429753 0.409917
lang_3Other -0.999913 0.867683
act_tobYes -0.168426 0.143457
max_ch -0.014683 0.011687
insuranceMedicaid 0.043425 0.135656
insuranceMedicare -0.309907 0.162030
insuranceOther Governmental -1.488716 0.691247
insuranceOther 0.694771 0.819232
EPL_MUNIT 0.185514 0.296278
EPL_MOBILE -0.339833 0.322843
EPL_CROWD 0.169916 0.245995
EPL_NOVEH -0.078882 0.259379
EPL_GROUPQ -0.063329 0.230297
z value Pr(>|z|)
(Intercept) 3.999 6.36e-05 ***
ibd_3UC -11.345 < 2e-16 ***
ibd_3Unknown -0.047 0.96215
age_yrs -8.470 < 2e-16 ***
genderFemale -3.127 0.00177 **
race_5Black 1.090 0.27581
race_5Asian or Pacific Islander 0.201 0.84100
race_5American Indian or Alaska Native 0.500 0.61705
race_5Other -0.269 0.78766
ethnic_3Non-Hispanic -1.048 0.29446
lang_3Other -1.152 0.24916
act_tobYes -1.174 0.24037
max_ch -1.256 0.20900
insuranceMedicaid 0.320 0.74889
insuranceMedicare -1.913 0.05579 .
insuranceOther Governmental -2.154 0.03127 *
insuranceOther 0.848 0.39640
EPL_MUNIT 0.626 0.53122
EPL_MOBILE -1.053 0.29251
EPL_CROWD 0.691 0.48974
EPL_NOVEH -0.304 0.76104
EPL_GROUPQ -0.275 0.78332
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2678.4 on 2012 degrees of freedom
Residual deviance: 2294.8 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 2338.8
Number of Fisher Scoring iterations: 13
broom::glance(bio_acc_themes2 )
broom::tidy(bio_acc_themes2 , exponentiate = TRUE)
tbl_regression(bio_acc_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.30 |
0.25, 0.37 |
<0.001 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
0.97 |
0.96, 0.98 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.73 |
0.59, 0.89 |
0.002 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.26 |
0.83, 1.92 |
0.3 |
| Â Â Â Â Asian or Pacific Islander |
1.10 |
0.42, 2.75 |
0.8 |
| Â Â Â Â American Indian or Alaska Native |
1.32 |
0.42, 3.93 |
0.6 |
| Â Â Â Â Other |
0.91 |
0.45, 1.82 |
0.8 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.65 |
0.29, 1.46 |
0.3 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.37 |
0.05, 1.74 |
0.2 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.84 |
0.64, 1.12 |
0.2 |
| Charlson Comorbidity Index |
0.99 |
0.96, 1.01 |
0.2 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.04 |
0.80, 1.36 |
0.7 |
| Â Â Â Â Medicare |
0.73 |
0.53, 1.01 |
0.056 |
| Â Â Â Â Other Governmental |
0.23 |
0.05, 0.79 |
0.031 |
| Â Â Â Â Other |
2.00 |
0.42, 11.3 |
0.4 |
| % Housing with 10 or more units |
1.20 |
0.67, 2.15 |
0.5 |
| % Mobile Homes |
0.71 |
0.38, 1.34 |
0.3 |
| % Homes with more people than rooms |
1.19 |
0.73, 1.92 |
0.5 |
| % Homes with no vehicle |
0.92 |
0.56, 1.54 |
0.8 |
| % People in group quarters |
0.94 |
0.60, 1.47 |
0.8 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_acc_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 11.43504
degrees of freedom = 9
p-value = 0.24706
# C-Statistic/AUROC
Cstat(bio_acc_themes2)
[1] 0.7487363
# Model performance
model_performance(bio_acc_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
2338.778 | 2339.286 | 2462.140 | 0.179 | 0.440 | 1.074 | 0.570 | -Inf | 0.001 | 0.612
performance::check_model(bio_acc_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(bio_acc_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given MUNIT")

cplot(bio_acc_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given MOBILE")

cplot(bio_acc_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given CROWD")

cplot(bio_acc_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given NOVEH")

cplot(bio_acc_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of Biologic Rx Given GROUPQ")

Infliximab
Infliximab rx + SVI
med_data_ALL$infliximab_2 <- as.numeric(med_data_ALL$infliximab_2)
infliximab_rx <- glm(infliximab_2 ~ ibd_3 + age_yrs + gender +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(infliximab_rx )
Call:
glm(formula = infliximab_2 ~ ibd_3 + age_yrs + gender + +lang_3 +
act_tob + max_ch + insurance + RPL_THEMES, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5023 -0.7889 -0.5430 0.9724 2.6525
Coefficients:
Estimate Std. Error z value
(Intercept) 1.050631 0.086120 12.200
ibd_3UC -0.764092 0.052529 -14.546
ibd_3IC -10.314857 137.022104 -0.075
ibd_3Unknown -1.679641 0.613045 -2.740
age_yrs -0.035361 0.001759 -20.100
genderFemale -0.224944 0.051023 -4.409
lang_3Other -0.409370 0.302502 -1.353
act_tobYes 0.065939 0.077669 0.849
max_ch -0.020181 0.006642 -3.038
insuranceMedicaid 0.034303 0.070553 0.486
insuranceMedicare 0.075890 0.091947 0.825
insuranceOther Governmental -0.239512 0.337112 -0.710
insuranceOther 0.099158 0.364408 0.272
RPL_THEMES -0.089601 0.103212 -0.868
Pr(>|z|)
(Intercept) < 2e-16 ***
ibd_3UC < 2e-16 ***
ibd_3IC 0.93999
ibd_3Unknown 0.00615 **
age_yrs < 2e-16 ***
genderFemale 1.04e-05 ***
lang_3Other 0.17597
act_tobYes 0.39590
max_ch 0.00238 **
insuranceMedicaid 0.62682
insuranceMedicare 0.40916
insuranceOther Governmental 0.47740
insuranceOther 0.78554
RPL_THEMES 0.38533
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 10508.5 on 9206 degrees of freedom
Residual deviance: 9365.8 on 9193 degrees of freedom
(66 observations deleted due to missingness)
AIC: 9393.8
Number of Fisher Scoring iterations: 10
broom::glance(infliximab_rx )
broom::tidy(infliximab_rx , exponentiate = TRUE)
tbl_regression(infliximab_rx, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.47 |
0.42, 0.52 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.19 |
0.04, 0.53 |
0.006 |
| Age |
0.97 |
0.96, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.80 |
0.72, 0.88 |
<0.001 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.66 |
0.35, 1.17 |
0.2 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.07 |
0.92, 1.24 |
0.4 |
| Charlson Comorbidity Index |
0.98 |
0.97, 0.99 |
0.002 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.03 |
0.90, 1.19 |
0.6 |
| Â Â Â Â Medicare |
1.08 |
0.90, 1.29 |
0.4 |
| Â Â Â Â Other Governmental |
0.79 |
0.39, 1.48 |
0.5 |
| Â Â Â Â Other |
1.10 |
0.52, 2.20 |
0.8 |
| Social Vulnerability Index |
0.91 |
0.75, 1.12 |
0.4 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(infliximab_rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 67.57224
degrees of freedom = 8
p-value = 1.4929e-11
# C-Statistic/AUROC
Cstat(infliximab_rx)
[1] 0.7218414
# Model performance
model_performance(infliximab_rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
9393.801 | 9393.847 | 9493.589 | 0.125 | 0.408 | 1.009 | 0.509 | -Inf | 1.536e-04 | 0.665
performance::check_model(infliximab_rx)
Variable `Component` is not in your data frame :/

# Margins
margins(infliximab_rx)
Average marginal effects
glm(formula = infliximab_2 ~ ibd_3 + age_yrs + gender + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(infliximab_rx, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given SVI")

Infliximab rx + all themes
infliximab_rx_themes <- glm(infliximab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(infliximab_rx_themes )
Call:
glm(formula = infliximab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5081 -0.7883 -0.5424 0.9736 2.7234
Coefficients:
Estimate Std. Error
(Intercept) 1.206555 0.209257
ibd_3UC -0.739887 0.053474
ibd_3IC -10.433563 135.977729
ibd_3Unknown -1.671273 0.614000
age_yrs -0.035716 0.001791
genderFemale -0.236674 0.051876
race_5Black 0.199234 0.101492
race_5Asian or Pacific Islander -0.278059 0.175658
race_5American Indian or Alaska Native -0.254540 0.439922
race_5Other -0.088725 0.155438
ethnic_3Non-Hispanic -0.119118 0.184573
lang_3Other -0.279067 0.313121
act_tobYes 0.049890 0.078889
max_ch -0.020190 0.006764
insuranceMedicaid 0.021171 0.072211
insuranceMedicare 0.071049 0.093306
insuranceOther Governmental -0.262673 0.337658
insuranceOther 0.129474 0.366515
RPL_THEME1 0.049988 0.151464
RPL_THEME2 0.149323 0.130046
RPL_THEME3 0.089277 0.094696
RPL_THEME4 -0.400767 0.109524
z value Pr(>|z|)
(Intercept) 5.766 8.12e-09 ***
ibd_3UC -13.836 < 2e-16 ***
ibd_3IC -0.077 0.938838
ibd_3Unknown -2.722 0.006490 **
age_yrs -19.940 < 2e-16 ***
genderFemale -4.562 5.06e-06 ***
race_5Black 1.963 0.049641 *
race_5Asian or Pacific Islander -1.583 0.113432
race_5American Indian or Alaska Native -0.579 0.562857
race_5Other -0.571 0.568132
ethnic_3Non-Hispanic -0.645 0.518688
lang_3Other -0.891 0.372799
act_tobYes 0.632 0.527119
max_ch -2.985 0.002836 **
insuranceMedicaid 0.293 0.769382
insuranceMedicare 0.761 0.446385
insuranceOther Governmental -0.778 0.436614
insuranceOther 0.353 0.723897
RPL_THEME1 0.330 0.741377
RPL_THEME2 1.148 0.250872
RPL_THEME3 0.943 0.345796
RPL_THEME4 -3.659 0.000253 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 10216.3 on 8908 degrees of freedom
Residual deviance: 9080.6 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 9124.6
Number of Fisher Scoring iterations: 10
broom::glance(infliximab_rx_themes )
broom::tidy(infliximab_rx_themes , exponentiate = TRUE)
tbl_regression(infliximab_rx_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.48 |
0.43, 0.53 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.19 |
0.04, 0.54 |
0.006 |
| Age |
0.96 |
0.96, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.79 |
0.71, 0.87 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.22 |
1.00, 1.49 |
0.050 |
| Â Â Â Â Asian or Pacific Islander |
0.76 |
0.53, 1.06 |
0.11 |
| Â Â Â Â American Indian or Alaska Native |
0.78 |
0.30, 1.74 |
0.6 |
| Â Â Â Â Other |
0.92 |
0.67, 1.24 |
0.6 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.89 |
0.62, 1.28 |
0.5 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.76 |
0.40, 1.36 |
0.4 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.05 |
0.90, 1.23 |
0.5 |
| Charlson Comorbidity Index |
0.98 |
0.97, 0.99 |
0.003 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.02 |
0.89, 1.18 |
0.8 |
| Â Â Â Â Medicare |
1.07 |
0.89, 1.29 |
0.4 |
| Â Â Â Â Other Governmental |
0.77 |
0.38, 1.45 |
0.4 |
| Â Â Â Â Other |
1.14 |
0.54, 2.28 |
0.7 |
| Socioeconomic Status |
1.05 |
0.78, 1.41 |
0.7 |
| Household Composition |
1.16 |
0.90, 1.50 |
0.3 |
| Minority and Language Status |
1.09 |
0.91, 1.32 |
0.3 |
| Housing and Transportation |
0.67 |
0.54, 0.83 |
<0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(infliximab_rx_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 50.98939
degrees of freedom = 8
p-value = 2.6364e-08
# C-Statistic/AUROC
Cstat(infliximab_rx_themes)
[1] 0.7241588
# Model performance
model_performance(infliximab_rx_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
9124.560 | 9124.674 | 9280.646 | 0.129 | 0.409 | 1.011 | 0.510 | -Inf | 1.587e-04 | 0.665
performance::check_model(infliximab_rx_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(infliximab_rx_themes)
Average marginal effects
glm(formula = infliximab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(infliximab_rx_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given Theme1")

cplot(infliximab_rx_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given Theme2")

cplot(infliximab_rx_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given Theme3")

cplot(infliximab_rx_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given Theme4")

Infliximab Rx + Sub-sub themes
med_data_ALL$infliximab_2 <- as.numeric(med_data_ALL$infliximab_2)
inf_rx_themes2 <- glm(infliximab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(inf_rx_themes2 )
Call:
glm(formula = infliximab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5902 -0.7892 -0.5324 0.8960 2.7521
Coefficients:
Estimate Std. Error
(Intercept) 1.799442 0.603132
ibd_3UC -0.638430 0.114371
ibd_3Unknown -13.324697 290.828547
age_yrs -0.035170 0.003925
genderFemale -0.363994 0.110234
race_5Black 0.445226 0.218751
race_5Asian or Pacific Islander 0.237742 0.488798
race_5American Indian or Alaska Native 0.246602 0.621332
race_5Other 0.048428 0.384515
ethnic_3Non-Hispanic -0.305877 0.427751
lang_3Other -1.262183 1.126997
act_tobYes 0.003925 0.152981
max_ch -0.024375 0.013939
insuranceMedicaid 0.113952 0.142480
insuranceMedicare 0.041935 0.187807
insuranceOther Governmental 0.163435 0.604300
insuranceOther 0.206799 0.800470
EPL_MUNIT -0.354522 0.323241
EPL_MOBILE 0.204071 0.350964
EPL_CROWD -0.377735 0.265986
EPL_NOVEH 0.164668 0.281470
EPL_GROUPQ -0.528598 0.248564
z value Pr(>|z|)
(Intercept) 2.983 0.00285 **
ibd_3UC -5.582 2.38e-08 ***
ibd_3Unknown -0.046 0.96346
age_yrs -8.961 < 2e-16 ***
genderFemale -3.302 0.00096 ***
race_5Black 2.035 0.04182 *
race_5Asian or Pacific Islander 0.486 0.62670
race_5American Indian or Alaska Native 0.397 0.69145
race_5Other 0.126 0.89978
ethnic_3Non-Hispanic -0.715 0.47456
lang_3Other -1.120 0.26273
act_tobYes 0.026 0.97953
max_ch -1.749 0.08036 .
insuranceMedicaid 0.800 0.42384
insuranceMedicare 0.223 0.82331
insuranceOther Governmental 0.270 0.78681
insuranceOther 0.258 0.79614
EPL_MUNIT -1.097 0.27274
EPL_MOBILE 0.581 0.56093
EPL_CROWD -1.420 0.15557
EPL_NOVEH 0.585 0.55853
EPL_GROUPQ -2.127 0.03345 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2289.4 on 2012 degrees of freedom
Residual deviance: 2026.1 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 2070.1
Number of Fisher Scoring iterations: 13
broom::glance(inf_rx_themes2 )
broom::tidy(inf_rx_themes2 , exponentiate = TRUE)
tbl_regression(inf_rx_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.53 |
0.42, 0.66 |
<0.001 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
0.97 |
0.96, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.69 |
0.56, 0.86 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.56 |
1.01, 2.39 |
0.042 |
| Â Â Â Â Asian or Pacific Islander |
1.27 |
0.46, 3.22 |
0.6 |
| Â Â Â Â American Indian or Alaska Native |
1.28 |
0.33, 4.06 |
0.7 |
| Â Â Â Â Other |
1.05 |
0.48, 2.19 |
0.9 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.74 |
0.32, 1.74 |
0.5 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.28 |
0.01, 1.82 |
0.3 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.00 |
0.74, 1.35 |
>0.9 |
| Charlson Comorbidity Index |
0.98 |
0.95, 1.00 |
0.080 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.12 |
0.85, 1.48 |
0.4 |
| Â Â Â Â Medicare |
1.04 |
0.72, 1.50 |
0.8 |
| Â Â Â Â Other Governmental |
1.18 |
0.33, 3.71 |
0.8 |
| Â Â Â Â Other |
1.23 |
0.23, 5.73 |
0.8 |
| % Housing with 10 or more units |
0.70 |
0.37, 1.32 |
0.3 |
| % Mobile Homes |
1.23 |
0.62, 2.44 |
0.6 |
| % Homes with more people than rooms |
0.69 |
0.41, 1.15 |
0.2 |
| % Homes with no vehicle |
1.18 |
0.68, 2.05 |
0.6 |
| % People in group quarters |
0.59 |
0.36, 0.96 |
0.033 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(inf_rx_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 20.98619
degrees of freedom = 9
p-value = 0.012712
# C-Statistic/AUROC
Cstat(inf_rx_themes2)
[1] 0.7275293
# Model performance
model_performance(inf_rx_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
2070.136 | 2070.645 | 2193.498 | 0.133 | 0.405 | 1.009 | 0.503 | -Inf | 0.001 | 0.670
performance::check_model(inf_rx_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(inf_rx_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given MUNIT")

cplot(inf_rx_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given MOBILE")

cplot(inf_rx_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given CROWD")

cplot(inf_rx_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given NOVEH")

cplot(inf_rx_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given GROUPQ")

Sustained infliximab access + SVI
med_data_ALL$infliximab_3 <- as.numeric(med_data_ALL$infliximab_3)
infliximab_access <- glm(infliximab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(infliximab_access )
Call:
glm(formula = infliximab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5061 -0.6748 -0.4526 -0.2712 2.9468
Coefficients:
Estimate Std. Error
(Intercept) 0.957532 0.218912
ibd_3UC -0.756603 0.060495
ibd_3IC -9.585825 138.361075
ibd_3Unknown -2.366643 1.023287
age_yrs -0.041530 0.002045
genderFemale -0.282298 0.057837
race_5Black 0.418859 0.107689
race_5Asian or Pacific Islander -0.033244 0.182981
race_5American Indian or Alaska Native -0.186643 0.501528
race_5Other 0.115356 0.165260
ethnic_3Non-Hispanic -0.012501 0.201481
lang_3Other 0.046949 0.327333
act_tobYes 0.005983 0.088413
max_ch -0.006424 0.007825
insuranceMedicaid 0.070176 0.078228
insuranceMedicare -0.028297 0.114289
insuranceOther Governmental -0.649121 0.426297
insuranceOther -0.036705 0.421381
RPL_THEMES -0.462242 0.120878
z value Pr(>|z|)
(Intercept) 4.374 1.22e-05 ***
ibd_3UC -12.507 < 2e-16 ***
ibd_3IC -0.069 0.944766
ibd_3Unknown -2.313 0.020734 *
age_yrs -20.308 < 2e-16 ***
genderFemale -4.881 1.06e-06 ***
race_5Black 3.890 0.000100 ***
race_5Asian or Pacific Islander -0.182 0.855836
race_5American Indian or Alaska Native -0.372 0.709782
race_5Other 0.698 0.485160
ethnic_3Non-Hispanic -0.062 0.950527
lang_3Other 0.143 0.885950
act_tobYes 0.068 0.946047
max_ch -0.821 0.411690
insuranceMedicaid 0.897 0.369683
insuranceMedicare -0.248 0.804448
insuranceOther Governmental -1.523 0.127835
insuranceOther -0.087 0.930588
RPL_THEMES -3.824 0.000131 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 8707.4 on 8962 degrees of freedom
Residual deviance: 7613.7 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 7651.7
Number of Fisher Scoring iterations: 10
broom::glance(infliximab_access )
broom::tidy(infliximab_access , exponentiate = TRUE)
tbl_regression(infliximab_access, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.47 |
0.42, 0.53 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.09 |
0.01, 0.45 |
0.021 |
| Age |
0.96 |
0.96, 0.96 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.75 |
0.67, 0.84 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.52 |
1.23, 1.87 |
<0.001 |
| Â Â Â Â Asian or Pacific Islander |
0.97 |
0.67, 1.37 |
0.9 |
| Â Â Â Â American Indian or Alaska Native |
0.83 |
0.27, 2.04 |
0.7 |
| Â Â Â Â Other |
1.12 |
0.81, 1.54 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.99 |
0.67, 1.48 |
>0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.05 |
0.53, 1.94 |
0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.01 |
0.84, 1.19 |
>0.9 |
| Charlson Comorbidity Index |
0.99 |
0.98, 1.01 |
0.4 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.07 |
0.92, 1.25 |
0.4 |
| Â Â Â Â Medicare |
0.97 |
0.77, 1.21 |
0.8 |
| Â Â Â Â Other Governmental |
0.52 |
0.21, 1.13 |
0.13 |
| Â Â Â Â Other |
0.96 |
0.40, 2.11 |
>0.9 |
| Social Vulnerability Index |
0.63 |
0.50, 0.80 |
<0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(infliximab_access)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 51.38234
degrees of freedom = 9
p-value = 5.9138e-08
# C-Statistic/AUROC
Cstat(infliximab_access)
[1] 0.7424695
# Model performance
model_performance(infliximab_access)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
7651.719 | 7651.804 | 7786.635 | 0.130 | 0.364 | 0.923 | 0.425 | -Inf | 1.579e-04 | 0.733
performance::check_model(infliximab_access)
Variable `Component` is not in your data frame :/

# Margins
margins(infliximab_access)
Average marginal effects
glm(formula = infliximab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(infliximab_access, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given SVI")

Sustained infliximab access + all themes
infliximab_acc_themes <- glm(infliximab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(infliximab_acc_themes )
Call:
glm(formula = infliximab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.4303 -0.6714 -0.4524 -0.2696 2.9463
Coefficients:
Estimate Std. Error
(Intercept) 0.897456 0.231167
ibd_3UC -0.748341 0.060739
ibd_3IC -9.818675 137.481384
ibd_3Unknown -2.369939 1.022909
age_yrs -0.041796 0.002056
genderFemale -0.281053 0.058073
race_5Black 0.341744 0.109569
race_5Asian or Pacific Islander -0.103945 0.186195
race_5American Indian or Alaska Native -0.153084 0.501489
race_5Other 0.058551 0.167739
ethnic_3Non-Hispanic 0.037207 0.204711
lang_3Other 0.009588 0.328889
act_tobYes 0.008389 0.088783
max_ch -0.005878 0.007865
insuranceMedicaid 0.068057 0.078954
insuranceMedicare -0.017638 0.114666
insuranceOther Governmental -0.636879 0.426561
insuranceOther -0.014520 0.420085
RPL_THEME1 -0.071631 0.169688
RPL_THEME2 -0.012365 0.145914
RPL_THEME3 0.239117 0.106094
RPL_THEME4 -0.544817 0.123002
z value Pr(>|z|)
(Intercept) 3.882 0.000103 ***
ibd_3UC -12.321 < 2e-16 ***
ibd_3IC -0.071 0.943065
ibd_3Unknown -2.317 0.020511 *
age_yrs -20.333 < 2e-16 ***
genderFemale -4.840 1.30e-06 ***
race_5Black 3.119 0.001815 **
race_5Asian or Pacific Islander -0.558 0.576667
race_5American Indian or Alaska Native -0.305 0.760169
race_5Other 0.349 0.727046
ethnic_3Non-Hispanic 0.182 0.855777
lang_3Other 0.029 0.976743
act_tobYes 0.094 0.924724
max_ch -0.747 0.454824
insuranceMedicaid 0.862 0.388697
insuranceMedicare -0.154 0.877753
insuranceOther Governmental -1.493 0.135423
insuranceOther -0.035 0.972426
RPL_THEME1 -0.422 0.672927
RPL_THEME2 -0.085 0.932468
RPL_THEME3 2.254 0.024207 *
RPL_THEME4 -4.429 9.45e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 8661.5 on 8908 degrees of freedom
Residual deviance: 7553.9 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 7597.9
Number of Fisher Scoring iterations: 10
broom::glance(infliximab_acc_themes )
broom::tidy(infliximab_acc_themes , exponentiate = TRUE)
tbl_regression(infliximab_acc_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.47 |
0.42, 0.53 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.09 |
0.01, 0.44 |
0.021 |
| Age |
0.96 |
0.96, 0.96 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.75 |
0.67, 0.85 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.41 |
1.13, 1.74 |
0.002 |
| Â Â Â Â Asian or Pacific Islander |
0.90 |
0.62, 1.29 |
0.6 |
| Â Â Â Â American Indian or Alaska Native |
0.86 |
0.28, 2.11 |
0.8 |
| Â Â Â Â Other |
1.06 |
0.76, 1.46 |
0.7 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.04 |
0.70, 1.57 |
0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.01 |
0.51, 1.87 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.01 |
0.85, 1.20 |
>0.9 |
| Charlson Comorbidity Index |
0.99 |
0.98, 1.01 |
0.5 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.07 |
0.92, 1.25 |
0.4 |
| Â Â Â Â Medicare |
0.98 |
0.78, 1.23 |
0.9 |
| Â Â Â Â Other Governmental |
0.53 |
0.21, 1.15 |
0.14 |
| Â Â Â Â Other |
0.99 |
0.41, 2.15 |
>0.9 |
| Socioeconomic Status |
0.93 |
0.67, 1.30 |
0.7 |
| Household Composition |
0.99 |
0.74, 1.32 |
>0.9 |
| Minority and Language Status |
1.27 |
1.03, 1.56 |
0.024 |
| Housing and Transportation |
0.58 |
0.46, 0.74 |
<0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(infliximab_acc_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 42.93351
degrees of freedom = 8
p-value = 9.0412e-07
# C-Statistic/AUROC
Cstat(infliximab_acc_themes)
[1] 0.7445937
# Model performance
model_performance(infliximab_acc_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
7597.879 | 7597.993 | 7753.965 | 0.132 | 0.364 | 0.922 | 0.424 | -Inf | 1.589e-04 | 0.733
performance::check_model(infliximab_acc_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(infliximab_acc_themes)
Average marginal effects
glm(formula = infliximab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(infliximab_acc_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given Theme1")

cplot(infliximab_acc_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given Theme2")

cplot(infliximab_acc_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given Theme3")

cplot(infliximab_acc_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given Theme4")

Sustained infliximab access + sub-sub themes
med_data_ALL$infliximab_3 <- as.numeric(med_data_ALL$infliximab_3)
inf_acc_themes2 <- glm(infliximab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(inf_acc_themes2 )
Call:
glm(formula = infliximab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5288 -0.6307 -0.4050 -0.2364 2.8341
Coefficients:
Estimate Std. Error
(Intercept) 1.991264 0.727806
ibd_3UC -0.741195 0.138784
ibd_3Unknown -13.756634 481.203929
age_yrs -0.043558 0.004840
genderFemale -0.430566 0.130631
race_5Black 0.511624 0.243227
race_5Asian or Pacific Islander 0.669365 0.515306
race_5American Indian or Alaska Native 0.504565 0.688196
race_5Other 0.188687 0.450737
ethnic_3Non-Hispanic 0.025213 0.524194
lang_3Other -13.836543 398.694877
act_tobYes -0.091570 0.182319
max_ch -0.003893 0.017196
insuranceMedicaid 0.250278 0.161699
insuranceMedicare -0.068589 0.248749
insuranceOther Governmental -1.430944 1.073087
insuranceOther 0.102603 0.905025
EPL_MUNIT -0.349325 0.387342
EPL_MOBILE -0.537772 0.414713
EPL_CROWD -0.444657 0.314701
EPL_NOVEH 0.057697 0.332078
EPL_GROUPQ -0.881393 0.294844
z value Pr(>|z|)
(Intercept) 2.736 0.006219 **
ibd_3UC -5.341 9.26e-08 ***
ibd_3Unknown -0.029 0.977193
age_yrs -9.000 < 2e-16 ***
genderFemale -3.296 0.000981 ***
race_5Black 2.103 0.035423 *
race_5Asian or Pacific Islander 1.299 0.193956
race_5American Indian or Alaska Native 0.733 0.463455
race_5Other 0.419 0.675495
ethnic_3Non-Hispanic 0.048 0.961637
lang_3Other -0.035 0.972315
act_tobYes -0.502 0.615492
max_ch -0.226 0.820890
insuranceMedicaid 1.548 0.121671
insuranceMedicare -0.276 0.782750
insuranceOther Governmental -1.333 0.182373
insuranceOther 0.113 0.909737
EPL_MUNIT -0.902 0.367136
EPL_MOBILE -1.297 0.194723
EPL_CROWD -1.413 0.157670
EPL_NOVEH 0.174 0.862065
EPL_GROUPQ -2.989 0.002796 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1799.4 on 2012 degrees of freedom
Residual deviance: 1537.6 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 1581.6
Number of Fisher Scoring iterations: 14
broom::glance(inf_acc_themes2 )
broom::tidy(inf_acc_themes2 , exponentiate = TRUE)
tbl_regression(inf_acc_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.48 |
0.36, 0.62 |
<0.001 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
0.96 |
0.95, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.65 |
0.50, 0.84 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.67 |
1.02, 2.66 |
0.035 |
| Â Â Â Â Asian or Pacific Islander |
1.95 |
0.66, 5.15 |
0.2 |
| Â Â Â Â American Indian or Alaska Native |
1.66 |
0.35, 5.75 |
0.5 |
| Â Â Â Â Other |
1.21 |
0.48, 2.83 |
0.7 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.03 |
0.38, 3.06 |
>0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.00 |
|
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.91 |
0.63, 1.30 |
0.6 |
| Charlson Comorbidity Index |
1.00 |
0.96, 1.03 |
0.8 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.28 |
0.93, 1.76 |
0.12 |
| Â Â Â Â Medicare |
0.93 |
0.57, 1.50 |
0.8 |
| Â Â Â Â Other Governmental |
0.24 |
0.01, 1.33 |
0.2 |
| Â Â Â Â Other |
1.11 |
0.14, 5.86 |
>0.9 |
| % Housing with 10 or more units |
0.71 |
0.33, 1.51 |
0.4 |
| % Mobile Homes |
0.58 |
0.26, 1.32 |
0.2 |
| % Homes with more people than rooms |
0.64 |
0.34, 1.18 |
0.2 |
| % Homes with no vehicle |
1.06 |
0.55, 2.04 |
0.9 |
| % People in group quarters |
0.41 |
0.23, 0.74 |
0.003 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(inf_acc_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 10.21925
degrees of freedom = 9
p-value = 0.33303
# C-Statistic/AUROC
Cstat(inf_acc_themes2)
[1] 0.7604456
# Model performance
model_performance(inf_acc_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
1581.571 | 1582.080 | 1704.933 | 0.142 | 0.342 | 0.879 | 0.382 | -64.083 | 0.002 | 0.764
performance::check_model(inf_acc_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(inf_acc_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given MUNIT")

cplot(inf_acc_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given MOBILE")

cplot(inf_acc_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given CROWD")

cplot(inf_acc_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given NOVEH")

cplot(inf_acc_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of Infliximab Rx Given GROUPQ")

Adalimumab
Adalimumab rx + SVI
med_data_ALL$adalimumab_2 <- as.numeric(med_data_ALL$adalimumab_2)
adalimumab_rx <- glm(adalimumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(adalimumab_rx )
Call:
glm(formula = adalimumab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0361 -0.7929 -0.5865 -0.3706 2.4630
Coefficients:
Estimate Std. Error
(Intercept) -8.218e-01 2.216e-01
ibd_3UC -1.001e+00 5.547e-02
ibd_3IC -1.052e+01 1.393e+02
ibd_3Unknown -8.166e-01 4.487e-01
age_yrs -2.215e-03 1.732e-03
genderFemale 3.413e-03 5.250e-02
race_5Black -5.203e-02 1.047e-01
race_5Asian or Pacific Islander -2.029e-01 1.820e-01
race_5American Indian or Alaska Native -2.792e-01 4.584e-01
race_5Other -5.965e-04 1.605e-01
ethnic_3Non-Hispanic 2.371e-01 2.071e-01
lang_3Other -3.760e-01 3.281e-01
act_tobYes 5.071e-02 7.939e-02
max_ch -3.755e-02 6.587e-03
insuranceMedicaid -1.010e-01 7.479e-02
insuranceMedicare -4.683e-01 8.910e-02
insuranceOther Governmental -1.765e-01 3.233e-01
insuranceOther -1.293e-01 3.872e-01
RPL_THEMES 2.763e-01 1.074e-01
z value Pr(>|z|)
(Intercept) -3.709 0.000208 ***
ibd_3UC -18.053 < 2e-16 ***
ibd_3IC -0.076 0.939795
ibd_3Unknown -1.820 0.068760 .
age_yrs -1.279 0.201031
genderFemale 0.065 0.948174
race_5Black -0.497 0.619346
race_5Asian or Pacific Islander -1.115 0.265025
race_5American Indian or Alaska Native -0.609 0.542430
race_5Other -0.004 0.997035
ethnic_3Non-Hispanic 1.145 0.252232
lang_3Other -1.146 0.251836
act_tobYes 0.639 0.523019
max_ch -5.701 1.19e-08 ***
insuranceMedicaid -1.351 0.176840
insuranceMedicare -5.256 1.47e-07 ***
insuranceOther Governmental -0.546 0.585229
insuranceOther -0.334 0.738366
RPL_THEMES 2.572 0.010099 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 9585.4 on 8962 degrees of freedom
Residual deviance: 9046.9 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 9084.9
Number of Fisher Scoring iterations: 10
broom::glance(adalimumab_rx )
broom::tidy(adalimumab_rx , exponentiate = TRUE)
tbl_regression(adalimumab_rx, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.37 |
0.33, 0.41 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.44 |
0.17, 0.99 |
0.069 |
| Age |
1.00 |
0.99, 1.00 |
0.2 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.00 |
0.91, 1.11 |
>0.9 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.95 |
0.77, 1.16 |
0.6 |
| Â Â Â Â Asian or Pacific Islander |
0.82 |
0.56, 1.15 |
0.3 |
| Â Â Â Â American Indian or Alaska Native |
0.76 |
0.28, 1.74 |
0.5 |
| Â Â Â Â Other |
1.00 |
0.72, 1.36 |
>0.9 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.27 |
0.85, 1.93 |
0.3 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.69 |
0.34, 1.26 |
0.3 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.05 |
0.90, 1.23 |
0.5 |
| Charlson Comorbidity Index |
0.96 |
0.95, 0.98 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.90 |
0.78, 1.05 |
0.2 |
| Â Â Â Â Medicare |
0.63 |
0.53, 0.74 |
<0.001 |
| Â Â Â Â Other Governmental |
0.84 |
0.43, 1.54 |
0.6 |
| Â Â Â Â Other |
0.88 |
0.39, 1.80 |
0.7 |
| Social Vulnerability Index |
1.32 |
1.07, 1.63 |
0.010 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(adalimumab_rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 9.85305
degrees of freedom = 9
p-value = 0.36251
# C-Statistic/AUROC
Cstat(adalimumab_rx)
[1] 0.6611943
# Model performance
model_performance(adalimumab_rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
9084.868 | 9084.953 | 9219.785 | 0.058 | 0.406 | 1.006 | 0.505 | -Inf | 1.578e-04 | 0.670
performance::check_model(adalimumab_rx)
Variable `Component` is not in your data frame :/

# Margins
margins(adalimumab_rx)
Average marginal effects
glm(formula = adalimumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(adalimumab_rx, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Adalimumab Rx Given SVI")

Adalimumab rx + all themes
adalimumab_rx_themes <- glm(adalimumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(adalimumab_rx_themes )
Call:
glm(formula = adalimumab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0707 -0.8007 -0.5824 -0.3719 2.4838
Coefficients:
Estimate Std. Error
(Intercept) -0.847277 0.231215
ibd_3UC -0.999653 0.055660
ibd_3IC -10.602781 139.003668
ibd_3Unknown -0.825619 0.448708
age_yrs -0.002227 0.001738
genderFemale 0.006836 0.052659
race_5Black -0.070944 0.106697
race_5Asian or Pacific Islander -0.171434 0.184263
race_5American Indian or Alaska Native -0.271851 0.459696
race_5Other 0.003002 0.161849
ethnic_3Non-Hispanic 0.254039 0.209153
lang_3Other -0.373700 0.329648
act_tobYes 0.036424 0.079704
max_ch -0.037370 0.006610
insuranceMedicaid -0.119267 0.075280
insuranceMedicare -0.472851 0.089256
insuranceOther Governmental -0.185213 0.323344
insuranceOther -0.134290 0.386836
RPL_THEME1 0.384347 0.152709
RPL_THEME2 0.150760 0.131493
RPL_THEME3 0.032538 0.095766
RPL_THEME4 -0.215680 0.110714
z value Pr(>|z|)
(Intercept) -3.664 0.000248 ***
ibd_3UC -17.960 < 2e-16 ***
ibd_3IC -0.076 0.939199
ibd_3Unknown -1.840 0.065769 .
age_yrs -1.281 0.200181
genderFemale 0.130 0.896710
race_5Black -0.665 0.506108
race_5Asian or Pacific Islander -0.930 0.352175
race_5American Indian or Alaska Native -0.591 0.554272
race_5Other 0.019 0.985202
ethnic_3Non-Hispanic 1.215 0.224514
lang_3Other -1.134 0.256949
act_tobYes 0.457 0.647674
max_ch -5.654 1.57e-08 ***
insuranceMedicaid -1.584 0.113122
insuranceMedicare -5.298 1.17e-07 ***
insuranceOther Governmental -0.573 0.566777
insuranceOther -0.347 0.728478
RPL_THEME1 2.517 0.011841 *
RPL_THEME2 1.147 0.251578
RPL_THEME3 0.340 0.734031
RPL_THEME4 -1.948 0.051405 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 9535.6 on 8908 degrees of freedom
Residual deviance: 8992.5 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 9036.5
Number of Fisher Scoring iterations: 10
broom::glance(adalimumab_rx_themes )
broom::tidy(adalimumab_rx_themes , exponentiate = TRUE)
tbl_regression(adalimumab_rx_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.37 |
0.33, 0.41 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.44 |
0.16, 0.98 |
0.066 |
| Age |
1.00 |
0.99, 1.00 |
0.2 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.01 |
0.91, 1.12 |
0.9 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.93 |
0.75, 1.15 |
0.5 |
| Â Â Â Â Asian or Pacific Islander |
0.84 |
0.58, 1.20 |
0.4 |
| Â Â Â Â American Indian or Alaska Native |
0.76 |
0.28, 1.76 |
0.6 |
| Â Â Â Â Other |
1.00 |
0.73, 1.37 |
>0.9 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.29 |
0.87, 1.97 |
0.2 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.69 |
0.34, 1.27 |
0.3 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.04 |
0.89, 1.21 |
0.6 |
| Charlson Comorbidity Index |
0.96 |
0.95, 0.98 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.89 |
0.77, 1.03 |
0.11 |
| Â Â Â Â Medicare |
0.62 |
0.52, 0.74 |
<0.001 |
| Â Â Â Â Other Governmental |
0.83 |
0.42, 1.52 |
0.6 |
| Â Â Â Â Other |
0.87 |
0.39, 1.79 |
0.7 |
| Socioeconomic Status |
1.47 |
1.09, 1.98 |
0.012 |
| Household Composition |
1.16 |
0.90, 1.50 |
0.3 |
| Minority and Language Status |
1.03 |
0.86, 1.25 |
0.7 |
| Housing and Transportation |
0.81 |
0.65, 1.00 |
0.051 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(adalimumab_rx_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 7.93105
degrees of freedom = 8
p-value = 0.44023
# C-Statistic/AUROC
Cstat(adalimumab_rx_themes)
[1] 0.6636057
# Model performance
model_performance(adalimumab_rx_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
9036.453 | 9036.567 | 9192.539 | 0.059 | 0.406 | 1.006 | 0.505 | -Inf | 1.587e-04 | 0.670
performance::check_model(adalimumab_rx_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(adalimumab_rx_themes)
Average marginal effects
glm(formula = adalimumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(adalimumab_rx_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Adalimumab Rx Given Theme1")

cplot(adalimumab_rx_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Adalimumab Rx Given Theme2")

cplot(adalimumab_rx_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Adalimumab Rx Given Theme3")

cplot(adalimumab_rx_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Adalimumab Rx Given Theme4")

Adalimumab rx + sub-sub themes
ada_rx_themes2 <- glm(adalimumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(ada_rx_themes2 )
Call:
glm(formula = adalimumab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.2151 -0.7825 -0.5962 -0.3417 2.4207
Coefficients:
Estimate Std. Error
(Intercept) -0.1548165 0.5997755
ibd_3UC -0.9769976 0.1174803
ibd_3Unknown -0.9285580 1.0779156
age_yrs 0.0004886 0.0037718
genderFemale 0.2109036 0.1116091
race_5Black -0.2865992 0.2418134
race_5Asian or Pacific Islander 0.1074273 0.5268775
race_5American Indian or Alaska Native -1.4127425 1.0458716
race_5Other -0.5900427 0.4127290
ethnic_3Non-Hispanic -0.5484330 0.4345779
lang_3Other 0.1042124 0.8565034
act_tobYes 0.1174244 0.1513334
max_ch -0.0295586 0.0131143
insuranceMedicaid -0.0778573 0.1460753
insuranceMedicare -0.7047069 0.1798255
insuranceOther Governmental -0.5981851 0.6506835
insuranceOther -1.1991703 1.0816341
EPL_MUNIT 0.1120031 0.3185668
EPL_MOBILE -0.3606544 0.3472826
EPL_CROWD 0.2023927 0.2655459
EPL_NOVEH -0.2404408 0.2791367
EPL_GROUPQ 0.3249076 0.2477498
z value Pr(>|z|)
(Intercept) -0.258 0.7963
ibd_3UC -8.316 < 2e-16 ***
ibd_3Unknown -0.861 0.3890
age_yrs 0.130 0.8969
genderFemale 1.890 0.0588 .
race_5Black -1.185 0.2359
race_5Asian or Pacific Islander 0.204 0.8384
race_5American Indian or Alaska Native -1.351 0.1768
race_5Other -1.430 0.1528
ethnic_3Non-Hispanic -1.262 0.2070
lang_3Other 0.122 0.9032
act_tobYes 0.776 0.4378
max_ch -2.254 0.0242 *
insuranceMedicaid -0.533 0.5940
insuranceMedicare -3.919 8.9e-05 ***
insuranceOther Governmental -0.919 0.3579
insuranceOther -1.109 0.2676
EPL_MUNIT 0.352 0.7252
EPL_MOBILE -1.039 0.2990
EPL_CROWD 0.762 0.4460
EPL_NOVEH -0.861 0.3890
EPL_GROUPQ 1.311 0.1897
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2178.4 on 2012 degrees of freedom
Residual deviance: 2049.4 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 2093.4
Number of Fisher Scoring iterations: 5
broom::glance(ada_rx_themes2 )
broom::tidy(ada_rx_themes2 , exponentiate = TRUE)
tbl_regression(ada_rx_themes2, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.38 |
0.30, 0.47 |
<0.001 |
| Â Â Â Â Unknown |
0.40 |
0.02, 2.27 |
0.4 |
| Age |
1.00 |
0.99, 1.01 |
0.9 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.23 |
0.99, 1.54 |
0.059 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.75 |
0.46, 1.19 |
0.2 |
| Â Â Â Â Asian or Pacific Islander |
1.11 |
0.36, 2.93 |
0.8 |
| Â Â Â Â American Indian or Alaska Native |
0.24 |
0.01, 1.25 |
0.2 |
| Â Â Â Â Other |
0.55 |
0.24, 1.20 |
0.2 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.58 |
0.25, 1.39 |
0.2 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.11 |
0.15, 5.18 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.12 |
0.83, 1.51 |
0.4 |
| Charlson Comorbidity Index |
0.97 |
0.95, 1.00 |
0.024 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.93 |
0.69, 1.23 |
0.6 |
| Â Â Â Â Medicare |
0.49 |
0.35, 0.70 |
<0.001 |
| Â Â Â Â Other Governmental |
0.55 |
0.12, 1.75 |
0.4 |
| Â Â Â Â Other |
0.30 |
0.02, 1.76 |
0.3 |
| % Housing with 10 or more units |
1.12 |
0.60, 2.09 |
0.7 |
| % Mobile Homes |
0.70 |
0.35, 1.38 |
0.3 |
| % Homes with more people than rooms |
1.22 |
0.73, 2.06 |
0.4 |
| % Homes with no vehicle |
0.79 |
0.46, 1.36 |
0.4 |
| % People in group quarters |
1.38 |
0.85, 2.25 |
0.2 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(ada_rx_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 10.96362
degrees of freedom = 9
p-value = 0.27821
# C-Statistic/AUROC
Cstat(ada_rx_themes2)
[1] 0.6719055
# Model performance
model_performance(ada_rx_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
2093.362 | 2093.871 | 2216.725 | 0.063 | 0.408 | 1.015 | 0.509 | -126.045 | 4.968e-04 | 0.667
performance::check_model(ada_rx_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(ada_rx_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of ADA Rx Given MUNIT")

cplot(ada_rx_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of ADA Rx Given MOBILE")

cplot(ada_rx_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of ADA Rx Given CROWD")

cplot(ada_rx_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of ADA Rx Given NOVEH")

cplot(ada_rx_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of ADA Rx Given GROUPQ")

Sustained adalimumab access + SVI
med_data_ALL$adalimumab_3 <- as.numeric(med_data_ALL$adalimumab_3)
adalimumab_access <- glm(adalimumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(adalimumab_access )
Call:
glm(formula = adalimumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.9146 -0.7082 -0.4884 -0.3545 2.6378
Coefficients:
Estimate Std. Error
(Intercept) -0.926767 0.240208
ibd_3UC -1.006190 0.064310
ibd_3IC -10.001869 139.266699
ibd_3Unknown -0.812123 0.532805
age_yrs -0.003694 0.001963
genderFemale -0.026982 0.059455
race_5Black 0.137911 0.113950
race_5Asian or Pacific Islander -0.105324 0.201360
race_5American Indian or Alaska Native 0.182698 0.459112
race_5Other -0.065122 0.183475
ethnic_3Non-Hispanic 0.022704 0.223650
lang_3Other -0.017212 0.341791
act_tobYes 0.090520 0.088659
max_ch -0.040406 0.007833
insuranceMedicaid -0.111173 0.083683
insuranceMedicare -0.544396 0.106149
insuranceOther Governmental -0.702757 0.438219
insuranceOther -0.213995 0.450693
RPL_THEMES 0.142969 0.121831
z value Pr(>|z|)
(Intercept) -3.858 0.000114 ***
ibd_3UC -15.646 < 2e-16 ***
ibd_3IC -0.072 0.942747
ibd_3Unknown -1.524 0.127448
age_yrs -1.882 0.059903 .
genderFemale -0.454 0.649955
race_5Black 1.210 0.226173
race_5Asian or Pacific Islander -0.523 0.600932
race_5American Indian or Alaska Native 0.398 0.690676
race_5Other -0.355 0.722638
ethnic_3Non-Hispanic 0.102 0.919141
lang_3Other -0.050 0.959836
act_tobYes 1.021 0.307258
max_ch -5.159 2.49e-07 ***
insuranceMedicaid -1.329 0.184012
insuranceMedicare -5.129 2.92e-07 ***
insuranceOther Governmental -1.604 0.108788
insuranceOther -0.475 0.634921
RPL_THEMES 1.173 0.240596
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 7904.4 on 8962 degrees of freedom
Residual deviance: 7458.4 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 7496.4
Number of Fisher Scoring iterations: 10
broom::glance(adalimumab_access )
broom::tidy(adalimumab_access , exponentiate = TRUE)
tbl_regression(adalimumab_access, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.37 |
0.32, 0.41 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.44 |
0.13, 1.12 |
0.13 |
| Age |
1.00 |
0.99, 1.00 |
0.060 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.97 |
0.87, 1.09 |
0.6 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.15 |
0.91, 1.43 |
0.2 |
| Â Â Â Â Asian or Pacific Islander |
0.90 |
0.60, 1.32 |
0.6 |
| Â Â Â Â American Indian or Alaska Native |
1.20 |
0.44, 2.76 |
0.7 |
| Â Â Â Â Other |
0.94 |
0.65, 1.33 |
0.7 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.02 |
0.67, 1.61 |
>0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.98 |
0.48, 1.85 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.09 |
0.92, 1.30 |
0.3 |
| Charlson Comorbidity Index |
0.96 |
0.95, 0.98 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.89 |
0.76, 1.05 |
0.2 |
| Â Â Â Â Medicare |
0.58 |
0.47, 0.71 |
<0.001 |
| Â Â Â Â Other Governmental |
0.50 |
0.19, 1.08 |
0.11 |
| Â Â Â Â Other |
0.81 |
0.30, 1.82 |
0.6 |
| Social Vulnerability Index |
1.15 |
0.91, 1.46 |
0.2 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(adalimumab_access)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 8.79412
degrees of freedom = 9
p-value = 0.45649
# C-Statistic/AUROC
Cstat(adalimumab_access)
[1] 0.6669038
# Model performance
model_performance(adalimumab_access)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
7496.377 | 7496.462 | 7631.293 | 0.048 | 0.358 | 0.913 | 0.416 | -258.497 | 1.578e-04 | 0.743
performance::check_model(adalimumab_access)
Variable `Component` is not in your data frame :/

# Margins
margins(adalimumab_access)
Average marginal effects
glm(formula = adalimumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(adalimumab_access, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Adalimumab Rx Given SVI")

Sustained adalimumab access + all themes
adalimumab_acc_themes <- glm(adalimumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(adalimumab_acc_themes )
Call:
glm(formula = adalimumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.9036 -0.7076 -0.4892 -0.3555 2.6203
Coefficients:
Estimate Std. Error
(Intercept) -1.010825 0.251910
ibd_3UC -1.001758 0.064438
ibd_3IC -10.069613 139.275546
ibd_3Unknown -0.816443 0.532881
age_yrs -0.003600 0.001969
genderFemale -0.025243 0.059579
race_5Black 0.112082 0.115952
race_5Asian or Pacific Islander -0.140641 0.203754
race_5American Indian or Alaska Native 0.189243 0.459422
race_5Other -0.088760 0.185236
ethnic_3Non-Hispanic 0.056777 0.226429
lang_3Other -0.034943 0.342986
act_tobYes 0.093225 0.088855
max_ch -0.040017 0.007848
insuranceMedicaid -0.108700 0.084171
insuranceMedicare -0.540617 0.106294
insuranceOther Governmental -0.696438 0.438226
insuranceOther -0.207636 0.450459
RPL_THEME1 0.126129 0.172655
RPL_THEME2 0.025829 0.148467
RPL_THEME3 0.153214 0.108472
RPL_THEME4 -0.066442 0.125050
z value Pr(>|z|)
(Intercept) -4.013 6.00e-05 ***
ibd_3UC -15.546 < 2e-16 ***
ibd_3IC -0.072 0.9424
ibd_3Unknown -1.532 0.1255
age_yrs -1.828 0.0675 .
genderFemale -0.424 0.6718
race_5Black 0.967 0.3337
race_5Asian or Pacific Islander -0.690 0.4900
race_5American Indian or Alaska Native 0.412 0.6804
race_5Other -0.479 0.6318
ethnic_3Non-Hispanic 0.251 0.8020
lang_3Other -0.102 0.9189
act_tobYes 1.049 0.2941
max_ch -5.099 3.41e-07 ***
insuranceMedicaid -1.291 0.1966
insuranceMedicare -5.086 3.66e-07 ***
insuranceOther Governmental -1.589 0.1120
insuranceOther -0.461 0.6448
RPL_THEME1 0.731 0.4651
RPL_THEME2 0.174 0.8619
RPL_THEME3 1.412 0.1578
RPL_THEME4 -0.531 0.5952
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 7869.0 on 8908 degrees of freedom
Residual deviance: 7426.9 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 7470.9
Number of Fisher Scoring iterations: 10
broom::glance(adalimumab_acc_themes )
broom::tidy(adalimumab_acc_themes , exponentiate = TRUE)
tbl_regression(adalimumab_acc_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.37 |
0.32, 0.42 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.44 |
0.13, 1.12 |
0.13 |
| Age |
1.00 |
0.99, 1.00 |
0.068 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.98 |
0.87, 1.10 |
0.7 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.12 |
0.89, 1.40 |
0.3 |
| Â Â Â Â Asian or Pacific Islander |
0.87 |
0.57, 1.28 |
0.5 |
| Â Â Â Â American Indian or Alaska Native |
1.21 |
0.45, 2.78 |
0.7 |
| Â Â Â Â Other |
0.92 |
0.63, 1.30 |
0.6 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.06 |
0.69, 1.68 |
0.8 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.97 |
0.47, 1.82 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.10 |
0.92, 1.30 |
0.3 |
| Charlson Comorbidity Index |
0.96 |
0.95, 0.98 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.90 |
0.76, 1.06 |
0.2 |
| Â Â Â Â Medicare |
0.58 |
0.47, 0.72 |
<0.001 |
| Â Â Â Â Other Governmental |
0.50 |
0.19, 1.09 |
0.11 |
| Â Â Â Â Other |
0.81 |
0.30, 1.83 |
0.6 |
| Socioeconomic Status |
1.13 |
0.81, 1.59 |
0.5 |
| Household Composition |
1.03 |
0.77, 1.37 |
0.9 |
| Minority and Language Status |
1.17 |
0.94, 1.44 |
0.2 |
| Housing and Transportation |
0.94 |
0.73, 1.20 |
0.6 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(adalimumab_acc_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 11.73194
degrees of freedom = 8
p-value = 0.16357
# C-Statistic/AUROC
Cstat(adalimumab_acc_themes)
[1] 0.6672285
# Model performance
model_performance(adalimumab_acc_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
7470.934 | 7471.048 | 7627.020 | 0.048 | 0.359 | 0.914 | 0.417 | -258.307 | 1.587e-04 | 0.743
performance::check_model(adalimumab_acc_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(adalimumab_acc_themes)
Average marginal effects
glm(formula = adalimumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(adalimumab_acc_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Adalimumab Access Given Theme1")

cplot(adalimumab_acc_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Adalimumab Access Given Theme2")

cplot(adalimumab_acc_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Adalimumab Access Given Theme3")

cplot(adalimumab_acc_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Adalimumab Access Given Theme4")

Sustained adalimumab access + sub-sub themes
ada_acc_themes2 <- glm(adalimumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(ada_acc_themes2 )
Call:
glm(formula = adalimumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.1213 -0.7020 -0.4893 -0.3304 2.6435
Coefficients:
Estimate Std. Error
(Intercept) -0.346130 0.667418
ibd_3UC -1.033476 0.138227
ibd_3Unknown -15.012297 842.657464
age_yrs -0.001333 0.004322
genderFemale 0.055736 0.126907
race_5Black 0.096246 0.252550
race_5Asian or Pacific Islander -0.104077 0.638121
race_5American Indian or Alaska Native -0.884737 1.048493
race_5Other -0.633885 0.472730
ethnic_3Non-Hispanic -0.662975 0.471354
lang_3Other 0.633378 0.872589
act_tobYes 0.089680 0.171971
max_ch -0.041775 0.016146
insuranceMedicaid -0.114471 0.165560
insuranceMedicare -0.671611 0.214130
insuranceOther Governmental -15.157333 562.214534
insuranceOther -15.317583 831.783721
EPL_MUNIT 0.487840 0.366352
EPL_MOBILE -0.438611 0.395285
EPL_CROWD 0.291194 0.302571
EPL_NOVEH -0.457654 0.316034
EPL_GROUPQ 0.203792 0.283268
z value Pr(>|z|)
(Intercept) -0.519 0.60403
ibd_3UC -7.477 7.62e-14 ***
ibd_3Unknown -0.018 0.98579
age_yrs -0.308 0.75782
genderFemale 0.439 0.66052
race_5Black 0.381 0.70313
race_5Asian or Pacific Islander -0.163 0.87044
race_5American Indian or Alaska Native -0.844 0.39877
race_5Other -1.341 0.17995
ethnic_3Non-Hispanic -1.407 0.15957
lang_3Other 0.726 0.46792
act_tobYes 0.521 0.60203
max_ch -2.587 0.00967 **
insuranceMedicaid -0.691 0.48930
insuranceMedicare -3.136 0.00171 **
insuranceOther Governmental -0.027 0.97849
insuranceOther -0.018 0.98531
EPL_MUNIT 1.332 0.18299
EPL_MOBILE -1.110 0.26717
EPL_CROWD 0.962 0.33585
EPL_NOVEH -1.448 0.14758
EPL_GROUPQ 0.719 0.47187
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1783.1 on 2012 degrees of freedom
Residual deviance: 1658.8 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 1702.8
Number of Fisher Scoring iterations: 15
broom::glance(ada_acc_themes2 )
broom::tidy(ada_acc_themes2 , exponentiate = TRUE)
tbl_regression(ada_acc_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.36 |
0.27, 0.46 |
<0.001 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
1.00 |
0.99, 1.01 |
0.8 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.06 |
0.82, 1.36 |
0.7 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.10 |
0.66, 1.78 |
0.7 |
| Â Â Â Â Asian or Pacific Islander |
0.90 |
0.21, 2.76 |
0.9 |
| Â Â Â Â American Indian or Alaska Native |
0.41 |
0.02, 2.13 |
0.4 |
| Â Â Â Â Other |
0.53 |
0.20, 1.27 |
0.2 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.52 |
0.21, 1.35 |
0.2 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.88 |
0.26, 9.18 |
0.5 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.09 |
0.78, 1.52 |
0.6 |
| Charlson Comorbidity Index |
0.96 |
0.93, 0.99 |
0.010 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.89 |
0.64, 1.23 |
0.5 |
| Â Â Â Â Medicare |
0.51 |
0.33, 0.77 |
0.002 |
| Â Â Â Â Other Governmental |
0.00 |
|
>0.9 |
| Â Â Â Â Other |
0.00 |
|
>0.9 |
| % Housing with 10 or more units |
1.63 |
0.80, 3.35 |
0.2 |
| % Mobile Homes |
0.64 |
0.30, 1.40 |
0.3 |
| % Homes with more people than rooms |
1.34 |
0.74, 2.42 |
0.3 |
| % Homes with no vehicle |
0.63 |
0.34, 1.18 |
0.15 |
| % People in group quarters |
1.23 |
0.70, 2.14 |
0.5 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(ada_acc_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 4.9742
degrees of freedom = 9
p-value = 0.83655
# C-Statistic/AUROC
Cstat(ada_acc_themes2)
[1] 0.6859383
# Model performance
model_performance(ada_acc_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
1702.809 | 1703.318 | 1826.171 | 0.059 | 0.357 | 0.913 | 0.412 | -58.799 | 0.003 | 0.745
performance::check_model(ada_acc_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(ada_acc_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of ADA Rx Given MUNIT")

cplot(ada_acc_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of ADA Rx Given MOBILE")

cplot(ada_acc_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of ADA Rx Given CROWD")

cplot(ada_acc_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of ADA Rx Given NOVEH")

cplot(ada_acc_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of ADA Rx Given GROUPQ")

Vedolizumab
Vedolizumab rx + SVI
med_data_ALL$vedolizumab_2 <- as.numeric(med_data_ALL$vedolizumab_2)
vedolizumab_rx <- glm(vedolizumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(vedolizumab_rx )
Call:
glm(formula = vedolizumab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.7876 -0.5241 -0.4839 -0.4380 2.7111
Coefficients:
Estimate Std. Error
(Intercept) -1.577588 0.259315
ibd_3UC -0.058076 0.067618
ibd_3IC -10.331336 229.593291
ibd_3Unknown -1.611225 1.015152
age_yrs -0.010277 0.002233
genderFemale 0.071645 0.066900
race_5Black -0.156167 0.144348
race_5Asian or Pacific Islander -0.047122 0.216073
race_5American Indian or Alaska Native -0.344624 0.606379
race_5Other 0.334753 0.180987
ethnic_3Non-Hispanic 0.004099 0.237246
lang_3Other 0.103023 0.353480
act_tobYes -0.244353 0.113658
max_ch 0.029333 0.007182
insuranceMedicaid -0.109912 0.099806
insuranceMedicare -0.034499 0.107113
insuranceOther Governmental -1.416052 0.721940
insuranceOther -0.551479 0.602432
RPL_THEMES -0.103032 0.139205
z value Pr(>|z|)
(Intercept) -6.084 1.17e-09 ***
ibd_3UC -0.859 0.3904
ibd_3IC -0.045 0.9641
ibd_3Unknown -1.587 0.1125
age_yrs -4.601 4.20e-06 ***
genderFemale 1.071 0.2842
race_5Black -1.082 0.2793
race_5Asian or Pacific Islander -0.218 0.8274
race_5American Indian or Alaska Native -0.568 0.5698
race_5Other 1.850 0.0644 .
ethnic_3Non-Hispanic 0.017 0.9862
lang_3Other 0.291 0.7707
act_tobYes -2.150 0.0316 *
max_ch 4.084 4.42e-05 ***
insuranceMedicaid -1.101 0.2708
insuranceMedicare -0.322 0.7474
insuranceOther Governmental -1.961 0.0498 *
insuranceOther -0.915 0.3600
RPL_THEMES -0.740 0.4592
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 6422.3 on 8962 degrees of freedom
Residual deviance: 6366.1 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 6404.1
Number of Fisher Scoring iterations: 11
broom::glance(vedolizumab_rx )
broom::tidy(vedolizumab_rx , exponentiate = TRUE)
tbl_regression(vedolizumab_rx, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.94 |
0.83, 1.08 |
0.4 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.20 |
0.01, 0.93 |
0.11 |
| Age |
0.99 |
0.99, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.07 |
0.94, 1.23 |
0.3 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.86 |
0.64, 1.13 |
0.3 |
| Â Â Â Â Asian or Pacific Islander |
0.95 |
0.61, 1.43 |
0.8 |
| Â Â Â Â American Indian or Alaska Native |
0.71 |
0.17, 1.99 |
0.6 |
| Â Â Â Â Other |
1.40 |
0.97, 1.97 |
0.064 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.00 |
0.64, 1.63 |
>0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.11 |
0.52, 2.12 |
0.8 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.78 |
0.62, 0.97 |
0.032 |
| Charlson Comorbidity Index |
1.03 |
1.02, 1.04 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.90 |
0.73, 1.09 |
0.3 |
| Â Â Â Â Medicare |
0.97 |
0.78, 1.19 |
0.7 |
| Â Â Â Â Other Governmental |
0.24 |
0.04, 0.78 |
0.050 |
| Â Â Â Â Other |
0.58 |
0.14, 1.60 |
0.4 |
| Social Vulnerability Index |
0.90 |
0.69, 1.18 |
0.5 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(vedolizumab_rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 8.84713
degrees of freedom = 9
p-value = 0.4515
# C-Statistic/AUROC
Cstat(vedolizumab_rx)
[1] 0.5657406
# Model performance
model_performance(vedolizumab_rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
6404.148 | 6404.233 | 6539.064 | 0.006 | 0.319 | 0.844 | 0.355 | -127.342 | 1.578e-04 | 0.797
performance::check_model(vedolizumab_rx)
Variable `Component` is not in your data frame :/

# Margins
margins(vedolizumab_rx)
Average marginal effects
glm(formula = vedolizumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(vedolizumab_rx, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Vedolizumab Rx Given SVI")

Vedolizumab rx + all themes
vedolizumab_rx_themes <- glm(vedolizumab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + lang_3 + act_tob + max_ch +
insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(vedolizumab_rx_themes )
Call:
glm(formula = vedolizumab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.7942 -0.5258 -0.4836 -0.4363 2.7229
Coefficients:
Estimate Std. Error
(Intercept) -1.594685 0.272522
ibd_3UC -0.055133 0.067786
ibd_3IC -10.371788 229.582877
ibd_3Unknown -1.619810 1.015224
age_yrs -0.010062 0.002240
genderFemale 0.079561 0.067086
race_5Black -0.197553 0.146593
race_5Asian or Pacific Islander -0.079422 0.218848
race_5American Indian or Alaska Native -0.344628 0.606669
race_5Other 0.303799 0.182782
ethnic_3Non-Hispanic 0.040915 0.240509
lang_3Other 0.062306 0.354764
act_tobYes -0.258582 0.114322
max_ch 0.029518 0.007203
insuranceMedicaid -0.114008 0.100277
insuranceMedicare -0.031812 0.107393
insuranceOther Governmental -1.429445 0.721942
insuranceOther -0.559409 0.602643
RPL_THEME1 0.267707 0.194957
RPL_THEME2 -0.297126 0.168159
RPL_THEME3 0.043863 0.121458
RPL_THEME4 -0.148630 0.140701
z value Pr(>|z|)
(Intercept) -5.852 4.87e-09 ***
ibd_3UC -0.813 0.4160
ibd_3IC -0.045 0.9640
ibd_3Unknown -1.596 0.1106
age_yrs -4.491 7.09e-06 ***
genderFemale 1.186 0.2356
race_5Black -1.348 0.1778
race_5Asian or Pacific Islander -0.363 0.7167
race_5American Indian or Alaska Native -0.568 0.5700
race_5Other 1.662 0.0965 .
ethnic_3Non-Hispanic 0.170 0.8649
lang_3Other 0.176 0.8606
act_tobYes -2.262 0.0237 *
max_ch 4.098 4.17e-05 ***
insuranceMedicaid -1.137 0.2556
insuranceMedicare -0.296 0.7671
insuranceOther Governmental -1.980 0.0477 *
insuranceOther -0.928 0.3533
RPL_THEME1 1.373 0.1697
RPL_THEME2 -1.767 0.0772 .
RPL_THEME3 0.361 0.7180
RPL_THEME4 -1.056 0.2908
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 6392.7 on 8908 degrees of freedom
Residual deviance: 6332.5 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 6376.5
Number of Fisher Scoring iterations: 11
broom::glance(vedolizumab_rx_themes )
broom::tidy(vedolizumab_rx_themes , exponentiate = TRUE)
tbl_regression(vedolizumab_rx_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.95 |
0.83, 1.08 |
0.4 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.20 |
0.01, 0.92 |
0.11 |
| Age |
0.99 |
0.99, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.08 |
0.95, 1.24 |
0.2 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.82 |
0.61, 1.09 |
0.2 |
| Â Â Â Â Asian or Pacific Islander |
0.92 |
0.59, 1.39 |
0.7 |
| Â Â Â Â American Indian or Alaska Native |
0.71 |
0.17, 1.99 |
0.6 |
| Â Â Â Â Other |
1.35 |
0.94, 1.92 |
0.10 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.04 |
0.66, 1.71 |
0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.06 |
0.50, 2.04 |
0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.77 |
0.61, 0.96 |
0.024 |
| Charlson Comorbidity Index |
1.03 |
1.02, 1.04 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.89 |
0.73, 1.08 |
0.3 |
| Â Â Â Â Medicare |
0.97 |
0.78, 1.19 |
0.8 |
| Â Â Â Â Other Governmental |
0.24 |
0.04, 0.77 |
0.048 |
| Â Â Â Â Other |
0.57 |
0.14, 1.59 |
0.4 |
| Socioeconomic Status |
1.31 |
0.89, 1.91 |
0.2 |
| Household Composition |
0.74 |
0.53, 1.03 |
0.077 |
| Minority and Language Status |
1.04 |
0.82, 1.33 |
0.7 |
| Housing and Transportation |
0.86 |
0.65, 1.13 |
0.3 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(vedolizumab_rx_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 2.60993
degrees of freedom = 8
p-value = 0.95641
# C-Statistic/AUROC
Cstat(vedolizumab_rx_themes)
[1] 0.5703189
# Model performance
model_performance(vedolizumab_rx_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
6376.452 | 6376.566 | 6532.538 | 0.006 | 0.319 | 0.844 | 0.355 | -127.177 | 1.587e-04 | 0.796
performance::check_model(vedolizumab_rx_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(vedolizumab_rx_themes)
Average marginal effects
glm(formula = vedolizumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(vedolizumab_rx_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Vedolizumab Rx Given Theme1")

cplot(vedolizumab_rx_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Vedolizumab Rx Given Theme2")

cplot(vedolizumab_rx_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Vedolizumab Rx Given Theme3")

cplot(vedolizumab_rx_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Vedolizumab Rx Given Theme4")

Vedolizumab rx + sub-sub themes
vedo_rx_themes2 <- glm(vedolizumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(vedo_rx_themes2 )
Call:
glm(formula = vedolizumab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.6697 -0.4917 -0.4524 -0.4084 2.4625
Coefficients:
Estimate Std. Error
(Intercept) -3.144553 0.878752
ibd_3UC 0.124577 0.151339
ibd_3Unknown -14.320355 844.121558
age_yrs -0.004689 0.005128
genderFemale -0.180015 0.149191
race_5Black -0.111267 0.325494
race_5Asian or Pacific Islander -0.149420 0.753429
race_5American Indian or Alaska Native 0.367937 0.767512
race_5Other 0.286364 0.497889
ethnic_3Non-Hispanic 0.510949 0.678557
lang_3Other -14.582308 718.421064
act_tobYes 0.050045 0.209381
max_ch 0.022145 0.015438
insuranceMedicaid 0.196909 0.195115
insuranceMedicare -0.151954 0.231842
insuranceOther Governmental -14.403344 579.439186
insuranceOther 0.371762 1.078914
EPL_MUNIT 0.270462 0.431062
EPL_MOBILE 0.478845 0.473417
EPL_CROWD -0.010399 0.357316
EPL_NOVEH 0.367141 0.381035
EPL_GROUPQ -0.062669 0.334680
z value Pr(>|z|)
(Intercept) -3.578 0.000346 ***
ibd_3UC 0.823 0.410414
ibd_3Unknown -0.017 0.986465
age_yrs -0.914 0.360542
genderFemale -1.207 0.227582
race_5Black -0.342 0.732470
race_5Asian or Pacific Islander -0.198 0.842795
race_5American Indian or Alaska Native 0.479 0.631662
race_5Other 0.575 0.565185
ethnic_3Non-Hispanic 0.753 0.451454
lang_3Other -0.020 0.983806
act_tobYes 0.239 0.811094
max_ch 1.434 0.151437
insuranceMedicaid 1.009 0.312882
insuranceMedicare -0.655 0.512197
insuranceOther Governmental -0.025 0.980169
insuranceOther 0.345 0.730417
EPL_MUNIT 0.627 0.530376
EPL_MOBILE 1.011 0.311794
EPL_CROWD -0.029 0.976781
EPL_NOVEH 0.964 0.335278
EPL_GROUPQ -0.187 0.851465
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1325 on 2012 degrees of freedom
Residual deviance: 1306 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 1350
Number of Fisher Scoring iterations: 15
broom::glance(vedo_rx_themes2 )
broom::tidy(vedo_rx_themes2 , exponentiate = TRUE)
tbl_regression(vedo_rx_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: algorithm did not convergeWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
1.13 |
0.84, 1.52 |
0.4 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
1.00 |
0.99, 1.01 |
0.4 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.84 |
0.62, 1.12 |
0.2 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.89 |
0.45, 1.63 |
0.7 |
| Â Â Â Â Asian or Pacific Islander |
0.86 |
0.14, 3.04 |
0.8 |
| Â Â Â Â American Indian or Alaska Native |
1.44 |
0.22, 5.34 |
0.6 |
| Â Â Â Â Other |
1.33 |
0.46, 3.30 |
0.6 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.67 |
0.50, 7.74 |
0.5 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.00 |
0.00, 0.00 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.05 |
0.69, 1.57 |
0.8 |
| Charlson Comorbidity Index |
1.02 |
0.99, 1.05 |
0.2 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.22 |
0.82, 1.77 |
0.3 |
| Â Â Â Â Medicare |
0.86 |
0.54, 1.35 |
0.5 |
| Â Â Â Â Other Governmental |
0.00 |
|
>0.9 |
| Â Â Â Â Other |
1.45 |
0.08, 8.37 |
0.7 |
| % Housing with 10 or more units |
1.31 |
0.56, 3.06 |
0.5 |
| % Mobile Homes |
1.61 |
0.64, 4.10 |
0.3 |
| % Homes with more people than rooms |
0.99 |
0.49, 1.99 |
>0.9 |
| % Homes with no vehicle |
1.44 |
0.69, 3.07 |
0.3 |
| % People in group quarters |
0.94 |
0.49, 1.81 |
0.9 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(vedo_rx_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 10.5458
degrees of freedom = 9
p-value = 0.30813
# C-Statistic/AUROC
Cstat(vedo_rx_themes2)
[1] 0.5790524
# Model performance
model_performance(vedo_rx_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
1349.999 | 1350.508 | 1473.362 | 0.008 | 0.301 | 0.810 | 0.324 | -21.782 | 0.003 | 0.819
performance::check_model(vedo_rx_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(vedo_rx_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of VEDO Rx Given MUNIT")

cplot(vedo_rx_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of VEDO Rx Given MOBILE")

cplot(vedo_rx_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of VEDO Rx Given CROWD")

cplot(vedo_rx_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of VEDO Rx Given NOVEH")

cplot(vedo_rx_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of VEDO Rx Given GROUPQ")

Sustained vedolizumab access + SVI
med_data_ALL$vedolizumab_3 <- as.numeric(med_data_ALL$vedolizumab_3)
vedolizumab_access <- glm(vedolizumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(vedolizumab_access )
Call:
glm(formula = vedolizumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.8727 -0.4210 -0.3731 -0.3263 2.6275
Coefficients:
Estimate Std. Error
(Intercept) -1.552e+00 2.900e-01
ibd_3UC -6.145e-03 8.324e-02
ibd_3IC -1.383e+01 1.694e+03
ibd_3Unknown -1.398e+01 3.812e+02
age_yrs -1.657e-02 2.774e-03
genderFemale 3.563e-03 8.221e-02
race_5Black 1.076e-01 1.675e-01
race_5Asian or Pacific Islander -1.619e-01 2.778e-01
race_5American Indian or Alaska Native 1.853e-01 6.086e-01
race_5Other 4.144e-01 2.087e-01
ethnic_3Non-Hispanic -2.479e-01 2.610e-01
lang_3Other 5.183e-01 3.787e-01
act_tobYes -8.937e-02 1.344e-01
max_ch 5.061e-02 8.557e-03
insuranceMedicaid 5.376e-03 1.194e-01
insuranceMedicare 5.336e-02 1.337e-01
insuranceOther Governmental -1.407e+01 2.996e+02
insuranceOther -4.573e-01 7.299e-01
RPL_THEMES -5.321e-01 1.748e-01
z value Pr(>|z|)
(Intercept) -5.353 8.66e-08 ***
ibd_3UC -0.074 0.94115
ibd_3IC -0.008 0.99349
ibd_3Unknown -0.037 0.97074
age_yrs -5.975 2.30e-09 ***
genderFemale 0.043 0.96543
race_5Black 0.642 0.52080
race_5Asian or Pacific Islander -0.583 0.55998
race_5American Indian or Alaska Native 0.304 0.76080
race_5Other 1.986 0.04707 *
ethnic_3Non-Hispanic -0.950 0.34221
lang_3Other 1.369 0.17107
act_tobYes -0.665 0.50612
max_ch 5.914 3.33e-09 ***
insuranceMedicaid 0.045 0.96409
insuranceMedicare 0.399 0.68987
insuranceOther Governmental -0.047 0.96254
insuranceOther -0.626 0.53100
RPL_THEMES -3.044 0.00233 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 4683.1 on 8962 degrees of freedom
Residual deviance: 4595.6 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 4633.6
Number of Fisher Scoring iterations: 15
broom::glance(vedolizumab_access )
broom::tidy(vedolizumab_access , exponentiate = TRUE)
tbl_regression(vedolizumab_access, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: algorithm did not convergeWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.99 |
0.84, 1.17 |
>0.9 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.00 |
0.00, 20.9 |
>0.9 |
| Age |
0.98 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.00 |
0.85, 1.18 |
>0.9 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.11 |
0.79, 1.53 |
0.5 |
| Â Â Â Â Asian or Pacific Islander |
0.85 |
0.47, 1.42 |
0.6 |
| Â Â Â Â American Indian or Alaska Native |
1.20 |
0.29, 3.40 |
0.8 |
| Â Â Â Â Other |
1.51 |
0.99, 2.25 |
0.047 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.78 |
0.48, 1.34 |
0.3 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.68 |
0.75, 3.36 |
0.2 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.91 |
0.70, 1.18 |
0.5 |
| Charlson Comorbidity Index |
1.05 |
1.03, 1.07 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.01 |
0.79, 1.27 |
>0.9 |
| Â Â Â Â Medicare |
1.05 |
0.81, 1.37 |
0.7 |
| Â Â Â Â Other Governmental |
0.00 |
0.00, 0.08 |
>0.9 |
| Â Â Â Â Other |
0.63 |
0.10, 2.09 |
0.5 |
| Social Vulnerability Index |
0.59 |
0.42, 0.83 |
0.002 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(vedolizumab_access)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 6.71787
degrees of freedom = 9
p-value = 0.66647
# C-Statistic/AUROC
Cstat(vedolizumab_access)
[1] 0.6015917
# Model performance
model_performance(vedolizumab_access)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
4633.577 | 4633.662 | 4768.493 | 0.009 | 0.259 | 0.717 | 0.256 | -49.509 | 0.001 | 0.866
performance::check_model(vedolizumab_access)
Variable `Component` is not in your data frame :/

# Margins
margins(vedolizumab_access)
Average marginal effects
glm(formula = vedolizumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(vedolizumab_access, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Vedolizumab Rx Given SVI")

Sustained vedolizumab access + all themes
vedolizumab_acc_themes <- glm(vedolizumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + lang_3 +
act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(vedolizumab_acc_themes )
Call:
glm(formula = vedolizumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.8817 -0.4223 -0.3726 -0.3221 2.6911
Coefficients:
Estimate Std. Error
(Intercept) -1.602e+00 3.073e-01
ibd_3UC -6.043e-03 8.350e-02
ibd_3IC -1.396e+01 1.697e+03
ibd_3Unknown -1.399e+01 3.807e+02
age_yrs -1.617e-02 2.786e-03
genderFemale 1.187e-02 8.249e-02
race_5Black 5.954e-03 1.702e-01
race_5Asian or Pacific Islander -2.594e-01 2.805e-01
race_5American Indian or Alaska Native 1.961e-01 6.095e-01
race_5Other 3.457e-01 2.110e-01
ethnic_3Non-Hispanic -2.004e-01 2.648e-01
lang_3Other 4.162e-01 3.796e-01
act_tobYes -1.069e-01 1.355e-01
max_ch 5.096e-02 8.585e-03
insuranceMedicaid 7.210e-03 1.201e-01
insuranceMedicare 6.020e-02 1.343e-01
insuranceOther Governmental -1.408e+01 2.992e+02
insuranceOther -4.537e-01 7.302e-01
RPL_THEME1 1.622e-01 2.407e-01
RPL_THEME2 -5.081e-01 2.095e-01
RPL_THEME3 2.039e-01 1.498e-01
RPL_THEME4 -3.862e-01 1.746e-01
z value Pr(>|z|)
(Intercept) -5.213 1.86e-07 ***
ibd_3UC -0.072 0.9423
ibd_3IC -0.008 0.9934
ibd_3Unknown -0.037 0.9707
age_yrs -5.805 6.45e-09 ***
genderFemale 0.144 0.8856
race_5Black 0.035 0.9721
race_5Asian or Pacific Islander -0.925 0.3549
race_5American Indian or Alaska Native 0.322 0.7477
race_5Other 1.639 0.1013
ethnic_3Non-Hispanic -0.757 0.4491
lang_3Other 1.096 0.2729
act_tobYes -0.789 0.4302
max_ch 5.936 2.93e-09 ***
insuranceMedicaid 0.060 0.9521
insuranceMedicare 0.448 0.6539
insuranceOther Governmental -0.047 0.9625
insuranceOther -0.621 0.5344
RPL_THEME1 0.674 0.5003
RPL_THEME2 -2.425 0.0153 *
RPL_THEME3 1.362 0.1733
RPL_THEME4 -2.212 0.0270 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 4659.7 on 8908 degrees of freedom
Residual deviance: 4563.9 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 4607.9
Number of Fisher Scoring iterations: 15
broom::glance(vedolizumab_acc_themes )
broom::tidy(vedolizumab_acc_themes , exponentiate = TRUE)
tbl_regression(vedolizumab_acc_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: algorithm did not convergeWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.99 |
0.84, 1.17 |
>0.9 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.00 |
0.00, 20.2 |
>0.9 |
| Age |
0.98 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.01 |
0.86, 1.19 |
0.9 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.01 |
0.71, 1.39 |
>0.9 |
| Â Â Â Â Asian or Pacific Islander |
0.77 |
0.43, 1.29 |
0.4 |
| Â Â Â Â American Indian or Alaska Native |
1.22 |
0.29, 3.45 |
0.7 |
| Â Â Â Â Other |
1.41 |
0.92, 2.11 |
0.10 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.82 |
0.50, 1.42 |
0.4 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.52 |
0.68, 3.04 |
0.3 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.90 |
0.68, 1.16 |
0.4 |
| Charlson Comorbidity Index |
1.05 |
1.03, 1.07 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.01 |
0.79, 1.27 |
>0.9 |
| Â Â Â Â Medicare |
1.06 |
0.81, 1.38 |
0.7 |
| Â Â Â Â Other Governmental |
0.00 |
0.00, 0.07 |
>0.9 |
| Â Â Â Â Other |
0.64 |
0.10, 2.10 |
0.5 |
| Socioeconomic Status |
1.18 |
0.73, 1.88 |
0.5 |
| Household Composition |
0.60 |
0.40, 0.91 |
0.015 |
| Minority and Language Status |
1.23 |
0.91, 1.65 |
0.2 |
| Housing and Transportation |
0.68 |
0.48, 0.96 |
0.027 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(vedolizumab_acc_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 1.2177
degrees of freedom = 8
p-value = 0.99646
# C-Statistic/AUROC
Cstat(vedolizumab_acc_themes)
[1] 0.6079255
# Model performance
model_performance(vedolizumab_acc_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
4607.892 | 4608.005 | 4763.978 | 0.010 | 0.259 | 0.717 | 0.256 | -49.380 | 0.001 | 0.866
performance::check_model(vedolizumab_acc_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(vedolizumab_acc_themes)
Average marginal effects
glm(formula = vedolizumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(vedolizumab_acc_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Vedolizumab Access Given Theme1")

cplot(vedolizumab_acc_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Vedolizumab Access Given Theme2")

cplot(vedolizumab_acc_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Vedolizumab Access Given Theme3")

cplot(vedolizumab_acc_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Vedolizumab Access Given Theme4")

Sustained vedolizumab access + sub-sub themes
vedo_acc_themes2 <- glm(vedolizumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(vedo_acc_themes2 )
Call:
glm(formula = vedolizumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.8148 -0.3685 -0.3106 -0.2568 2.7669
Coefficients:
Estimate Std. Error
(Intercept) -2.633101 1.048861
ibd_3UC 0.239805 0.201716
ibd_3Unknown -13.532340 836.545690
age_yrs -0.016689 0.006873
genderFemale -0.254809 0.198743
race_5Black 0.284677 0.381841
race_5Asian or Pacific Islander 0.577946 0.763484
race_5American Indian or Alaska Native 1.104975 0.775981
race_5Other 0.688807 0.579361
ethnic_3Non-Hispanic 0.093300 0.731631
lang_3Other -14.304288 700.267895
act_tobYes 0.098929 0.275240
max_ch 0.056158 0.019630
insuranceMedicaid 0.282454 0.250068
insuranceMedicare -0.209128 0.328888
insuranceOther Governmental -13.627604 572.245782
insuranceOther 1.105867 1.095350
EPL_MUNIT -0.266799 0.581047
EPL_MOBILE 0.617635 0.633585
EPL_CROWD -0.692018 0.481914
EPL_NOVEH 0.716204 0.516428
EPL_GROUPQ -0.140244 0.445361
z value Pr(>|z|)
(Intercept) -2.510 0.01206 *
ibd_3UC 1.189 0.23451
ibd_3Unknown -0.016 0.98709
age_yrs -2.428 0.01517 *
genderFemale -1.282 0.19981
race_5Black 0.746 0.45595
race_5Asian or Pacific Islander 0.757 0.44906
race_5American Indian or Alaska Native 1.424 0.15445
race_5Other 1.189 0.23448
ethnic_3Non-Hispanic 0.128 0.89853
lang_3Other -0.020 0.98370
act_tobYes 0.359 0.71928
max_ch 2.861 0.00423 **
insuranceMedicaid 1.130 0.25868
insuranceMedicare -0.636 0.52487
insuranceOther Governmental -0.024 0.98100
insuranceOther 1.010 0.31269
EPL_MUNIT -0.459 0.64611
EPL_MOBILE 0.975 0.32965
EPL_CROWD -1.436 0.15101
EPL_NOVEH 1.387 0.16549
EPL_GROUPQ -0.315 0.75284
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 859.09 on 2012 degrees of freedom
Residual deviance: 827.17 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 871.17
Number of Fisher Scoring iterations: 15
broom::glance(vedo_acc_themes2 )
broom::tidy(vedo_acc_themes2 , exponentiate = TRUE)
tbl_regression(vedo_acc_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
1.27 |
0.86, 1.89 |
0.2 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
0.98 |
0.97, 1.00 |
0.015 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.78 |
0.52, 1.14 |
0.2 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.33 |
0.59, 2.68 |
0.5 |
| Â Â Â Â Asian or Pacific Islander |
1.78 |
0.28, 6.46 |
0.4 |
| Â Â Â Â American Indian or Alaska Native |
3.02 |
0.46, 11.4 |
0.2 |
| Â Â Â Â Other |
1.99 |
0.57, 5.64 |
0.2 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.10 |
0.30, 5.54 |
0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.00 |
0.00, 6,511 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.10 |
0.63, 1.85 |
0.7 |
| Charlson Comorbidity Index |
1.06 |
1.02, 1.10 |
0.004 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.33 |
0.80, 2.15 |
0.3 |
| Â Â Â Â Medicare |
0.81 |
0.42, 1.52 |
0.5 |
| Â Â Â Â Other Governmental |
0.00 |
|
>0.9 |
| Â Â Â Â Other |
3.02 |
0.16, 18.3 |
0.3 |
| % Housing with 10 or more units |
0.77 |
0.24, 2.40 |
0.6 |
| % Mobile Homes |
1.85 |
0.54, 6.48 |
0.3 |
| % Homes with more people than rooms |
0.50 |
0.19, 1.28 |
0.2 |
| % Homes with no vehicle |
2.05 |
0.75, 5.72 |
0.2 |
| % People in group quarters |
0.87 |
0.36, 2.08 |
0.8 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(vedo_acc_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 16.12019
degrees of freedom = 9
p-value = 0.064414
# C-Statistic/AUROC
Cstat(vedo_acc_themes2)
[1] 0.6371292
# Model performance
model_performance(vedo_acc_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------
871.167 | 871.675 | 994.529 | 0.018 | 0.226 | 0.645 | 0.205 | -6.242 | 0.006 | 0.898
performance::check_model(vedo_acc_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(vedo_acc_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of VEDO Rx Given MUNIT")

cplot(vedo_acc_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of VEDO Rx Given MOBILE")

cplot(vedo_acc_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of VEDO Rx Given CROWD")

cplot(vedo_acc_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of VEDO Rx Given NOVEH")

cplot(vedo_acc_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of VEDO Rx Given GROUPQ")

Ustekinumab
Ustekinumab rx + SVI
med_data_ALL$ustekinumab_2 <- as.numeric(med_data_ALL$ustekinumab_2)
uste_rx <- glm(ustekinumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(uste_rx )
Call:
glm(formula = ustekinumab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.8672 -0.6695 -0.3401 -0.2854 2.6670
Coefficients:
Estimate Std. Error
(Intercept) -1.248846 0.281278
ibd_3UC -1.623219 0.080730
ibd_3IC -11.195022 229.482650
ibd_3Unknown -2.252775 1.014808
age_yrs -0.005661 0.002175
genderFemale 0.142180 0.065950
race_5Black 0.054828 0.124856
race_5Asian or Pacific Islander -0.378674 0.258790
race_5American Indian or Alaska Native -0.855215 0.740331
race_5Other -0.102716 0.212604
ethnic_3Non-Hispanic 0.105164 0.264687
lang_3Other -0.128935 0.416944
act_tobYes 0.104914 0.095410
max_ch -0.009655 0.007950
insuranceMedicaid -0.192929 0.093715
insuranceMedicare -0.237085 0.108317
insuranceOther Governmental -0.644113 0.478920
insuranceOther 0.172043 0.461993
RPL_THEMES 0.233004 0.133296
z value Pr(>|z|)
(Intercept) -4.440 9e-06 ***
ibd_3UC -20.107 < 2e-16 ***
ibd_3IC -0.049 0.96109
ibd_3Unknown -2.220 0.02643 *
age_yrs -2.603 0.00925 **
genderFemale 2.156 0.03109 *
race_5Black 0.439 0.66057
race_5Asian or Pacific Islander -1.463 0.14340
race_5American Indian or Alaska Native -1.155 0.24802
race_5Other -0.483 0.62900
ethnic_3Non-Hispanic 0.397 0.69113
lang_3Other -0.309 0.75714
act_tobYes 1.100 0.27150
max_ch -1.214 0.22457
insuranceMedicaid -2.059 0.03953 *
insuranceMedicare -2.189 0.02861 *
insuranceOther Governmental -1.345 0.17865
insuranceOther 0.372 0.70960
RPL_THEMES 1.748 0.08046 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 6910.4 on 8962 degrees of freedom
Residual deviance: 6301.7 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 6339.7
Number of Fisher Scoring iterations: 11
broom::glance(uste_rx )
broom::tidy(uste_rx , exponentiate = TRUE)
tbl_regression(uste_rx, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.20 |
0.17, 0.23 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.11 |
0.01, 0.49 |
0.026 |
| Age |
0.99 |
0.99, 1.00 |
0.009 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.15 |
1.01, 1.31 |
0.031 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.06 |
0.82, 1.34 |
0.7 |
| Â Â Â Â Asian or Pacific Islander |
0.68 |
0.40, 1.11 |
0.14 |
| Â Â Â Â American Indian or Alaska Native |
0.43 |
0.07, 1.45 |
0.2 |
| Â Â Â Â Other |
0.90 |
0.58, 1.35 |
0.6 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.11 |
0.68, 1.92 |
0.7 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.88 |
0.36, 1.87 |
0.8 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.11 |
0.92, 1.34 |
0.3 |
| Charlson Comorbidity Index |
0.99 |
0.97, 1.01 |
0.2 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.82 |
0.68, 0.99 |
0.040 |
| Â Â Â Â Medicare |
0.79 |
0.64, 0.97 |
0.029 |
| Â Â Â Â Other Governmental |
0.53 |
0.18, 1.22 |
0.2 |
| Â Â Â Â Other |
1.19 |
0.44, 2.75 |
0.7 |
| Social Vulnerability Index |
1.26 |
0.97, 1.64 |
0.080 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(uste_rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 8.1603
degrees of freedom = 9
p-value = 0.51808
# C-Statistic/AUROC
Cstat(uste_rx)
[1] 0.7071491
# Model performance
model_performance(uste_rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
6339.677 | 6339.762 | 6474.593 | 0.064 | 0.325 | 0.839 | 0.352 | -166.028 | 1.578e-04 | 0.789
performance::check_model(uste_rx)
Variable `Component` is not in your data frame :/

# Margins
margins(uste_rx)
Average marginal effects
glm(formula = ustekinumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(uste_rx, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Ustekinumab Rx Given SVI")

Ustekinumab rx + all themes
uste_rx_themes <- glm(ustekinumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(uste_rx_themes )
Call:
glm(formula = ustekinumab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.8774 -0.6639 -0.3409 -0.2848 2.6734
Coefficients:
Estimate Std. Error
(Intercept) -1.216905 0.291101
ibd_3UC -1.620239 0.081108
ibd_3IC -11.244825 228.746113
ibd_3Unknown -2.260330 1.014918
age_yrs -0.005713 0.002184
genderFemale 0.146112 0.066214
race_5Black 0.047077 0.127296
race_5Asian or Pacific Islander -0.322667 0.261016
race_5American Indian or Alaska Native -0.852407 0.740735
race_5Other -0.074744 0.213292
ethnic_3Non-Hispanic 0.085947 0.264710
lang_3Other -0.135810 0.418634
act_tobYes 0.086011 0.095863
max_ch -0.009983 0.007995
insuranceMedicaid -0.212788 0.094336
insuranceMedicare -0.236068 0.108520
insuranceOther Governmental -0.653945 0.479014
insuranceOther 0.168045 0.461877
RPL_THEME1 0.418056 0.190524
RPL_THEME2 0.078486 0.164396
RPL_THEME3 -0.051288 0.119669
RPL_THEME4 -0.179799 0.138410
z value Pr(>|z|)
(Intercept) -4.180 2.91e-05 ***
ibd_3UC -19.976 < 2e-16 ***
ibd_3IC -0.049 0.96079
ibd_3Unknown -2.227 0.02594 *
age_yrs -2.616 0.00889 **
genderFemale 2.207 0.02734 *
race_5Black 0.370 0.71151
race_5Asian or Pacific Islander -1.236 0.21639
race_5American Indian or Alaska Native -1.151 0.24983
race_5Other -0.350 0.72601
ethnic_3Non-Hispanic 0.325 0.74542
lang_3Other -0.324 0.74563
act_tobYes 0.897 0.36960
max_ch -1.249 0.21175
insuranceMedicaid -2.256 0.02409 *
insuranceMedicare -2.175 0.02960 *
insuranceOther Governmental -1.365 0.17219
insuranceOther 0.364 0.71598
RPL_THEME1 2.194 0.02822 *
RPL_THEME2 0.477 0.63306
RPL_THEME3 -0.429 0.66822
RPL_THEME4 -1.299 0.19393
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 6865.0 on 8908 degrees of freedom
Residual deviance: 6255.6 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 6299.6
Number of Fisher Scoring iterations: 11
broom::glance(uste_rx_themes )
broom::tidy(uste_rx_themes , exponentiate = TRUE)
tbl_regression(uste_rx_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.20 |
0.17, 0.23 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.10 |
0.01, 0.48 |
0.026 |
| Age |
0.99 |
0.99, 1.00 |
0.009 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.16 |
1.02, 1.32 |
0.027 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.05 |
0.81, 1.34 |
0.7 |
| Â Â Â Â Asian or Pacific Islander |
0.72 |
0.42, 1.18 |
0.2 |
| Â Â Â Â American Indian or Alaska Native |
0.43 |
0.07, 1.45 |
0.2 |
| Â Â Â Â Other |
0.93 |
0.60, 1.39 |
0.7 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.09 |
0.66, 1.88 |
0.7 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.87 |
0.35, 1.86 |
0.7 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.09 |
0.90, 1.31 |
0.4 |
| Charlson Comorbidity Index |
0.99 |
0.97, 1.01 |
0.2 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.81 |
0.67, 0.97 |
0.024 |
| Â Â Â Â Medicare |
0.79 |
0.64, 0.98 |
0.030 |
| Â Â Â Â Other Governmental |
0.52 |
0.18, 1.21 |
0.2 |
| Â Â Â Â Other |
1.18 |
0.43, 2.74 |
0.7 |
| Socioeconomic Status |
1.52 |
1.04, 2.21 |
0.028 |
| Household Composition |
1.08 |
0.78, 1.49 |
0.6 |
| Minority and Language Status |
0.95 |
0.75, 1.20 |
0.7 |
| Housing and Transportation |
0.84 |
0.64, 1.10 |
0.2 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(uste_rx_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 8.95593
degrees of freedom = 8
p-value = 0.34603
# C-Statistic/AUROC
Cstat(uste_rx_themes)
[1] 0.7091614
# Model performance
model_performance(uste_rx_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
6299.639 | 6299.753 | 6455.725 | 0.065 | 0.325 | 0.839 | 0.351 | -164.795 | 1.587e-04 | 0.789
performance::check_model(uste_rx_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(uste_rx_themes)
Average marginal effects
glm(formula = ustekinumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(uste_rx_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Ustekinumab Rx Given Theme1")

cplot(uste_rx_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Ustekinumab Rx Given Theme2")

cplot(uste_rx_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Ustekinumab Rx Given Theme3")

cplot(uste_rx_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Ustekinumab Rx Given Theme4")

Ustekinumab rx + sub-sub themes
uste_rx_themes2 <- glm(ustekinumab_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(uste_rx_themes2 )
Call:
glm(formula = ustekinumab_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.9998 -0.6423 -0.3797 -0.2915 2.5996
Coefficients:
Estimate Std. Error
(Intercept) -2.434242 0.791057
ibd_3UC -1.461314 0.166772
ibd_3Unknown -13.875689 512.074780
age_yrs -0.005491 0.004735
genderFemale 0.180275 0.139212
race_5Black 0.303850 0.264380
race_5Asian or Pacific Islander -0.205045 0.766174
race_5American Indian or Alaska Native -0.564869 1.059549
race_5Other 0.389108 0.457606
ethnic_3Non-Hispanic 0.321405 0.611091
lang_3Other -13.327069 419.272918
act_tobYes 0.163239 0.180470
max_ch -0.013708 0.016414
insuranceMedicaid 0.023754 0.177753
insuranceMedicare -0.227709 0.217558
insuranceOther Governmental -1.199311 1.046377
insuranceOther 0.423817 0.848941
EPL_MUNIT 0.251703 0.399021
EPL_MOBILE 1.109236 0.441502
EPL_CROWD -0.037964 0.328082
EPL_NOVEH -0.133965 0.347852
EPL_GROUPQ 0.095365 0.310373
z value Pr(>|z|)
(Intercept) -3.077 0.00209 **
ibd_3UC -8.762 < 2e-16 ***
ibd_3Unknown -0.027 0.97838
age_yrs -1.160 0.24620
genderFemale 1.295 0.19533
race_5Black 1.149 0.25044
race_5Asian or Pacific Islander -0.268 0.78899
race_5American Indian or Alaska Native -0.533 0.59395
race_5Other 0.850 0.39515
ethnic_3Non-Hispanic 0.526 0.59892
lang_3Other -0.032 0.97464
act_tobYes 0.905 0.36572
max_ch -0.835 0.40364
insuranceMedicaid 0.134 0.89369
insuranceMedicare -1.047 0.29526
insuranceOther Governmental -1.146 0.25173
insuranceOther 0.499 0.61762
EPL_MUNIT 0.631 0.52817
EPL_MOBILE 2.512 0.01199 *
EPL_CROWD -0.116 0.90788
EPL_NOVEH -0.385 0.70015
EPL_GROUPQ 0.307 0.75865
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1571.9 on 2012 degrees of freedom
Residual deviance: 1441.2 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 1485.2
Number of Fisher Scoring iterations: 14
broom::glance(uste_rx_themes2 )
broom::tidy(uste_rx_themes2 , exponentiate = TRUE)
tbl_regression(uste_rx_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: algorithm did not convergeWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.23 |
0.17, 0.32 |
<0.001 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
1.0 |
0.99, 1.00 |
0.2 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.20 |
0.91, 1.58 |
0.2 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.36 |
0.79, 2.24 |
0.3 |
| Â Â Â Â Asian or Pacific Islander |
0.81 |
0.13, 2.98 |
0.8 |
| Â Â Â Â American Indian or Alaska Native |
0.57 |
0.03, 3.03 |
0.6 |
| Â Â Â Â Other |
1.48 |
0.57, 3.48 |
0.4 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.38 |
0.46, 5.26 |
0.6 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.00 |
0.00, 0.00 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.18 |
0.82, 1.67 |
0.4 |
| Charlson Comorbidity Index |
0.99 |
0.95, 1.02 |
0.4 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.02 |
0.72, 1.44 |
0.9 |
| Â Â Â Â Medicare |
0.80 |
0.52, 1.21 |
0.3 |
| Â Â Â Â Other Governmental |
0.30 |
0.02, 1.55 |
0.3 |
| Â Â Â Â Other |
1.53 |
0.21, 7.18 |
0.6 |
| % Housing with 10 or more units |
1.29 |
0.59, 2.82 |
0.5 |
| % Mobile Homes |
3.03 |
1.28, 7.25 |
0.012 |
| % Homes with more people than rooms |
0.96 |
0.50, 1.83 |
>0.9 |
| % Homes with no vehicle |
0.87 |
0.44, 1.74 |
0.7 |
| % People in group quarters |
1.10 |
0.60, 2.02 |
0.8 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(uste_rx_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 6.5033
degrees of freedom = 9
p-value = 0.68868
# C-Statistic/AUROC
Cstat(uste_rx_themes2)
[1] 0.7067368
# Model performance
model_performance(uste_rx_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
1485.188 | 1485.696 | 1608.550 | 0.061 | 0.328 | 0.851 | 0.358 | -38.469 | 0.002 | 0.785
performance::check_model(uste_rx_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(uste_rx_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of USTE Rx Given MUNIT")

cplot(uste_rx_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of USTE Rx Given MOBILE")

cplot(uste_rx_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of USTE Rx Given CROWD")

cplot(uste_rx_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of USTE Rx Given NOVEH")

cplot(uste_rx_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of USTE Rx Given GROUPQ")

Sustained ustekinumab access + SVI
med_data_ALL$ustekinumab_3 <- as.numeric(med_data_ALL$ustekinumab_3)
uste_access <- glm(ustekinumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(uste_access )
Call:
glm(formula = ustekinumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.7724 -0.5449 -0.2693 -0.2157 2.9528
Coefficients:
Estimate Std. Error
(Intercept) -1.692e+00 3.631e-01
ibd_3UC -1.757e+00 1.039e-01
ibd_3IC -1.363e+01 1.029e+03
ibd_3Unknown -1.369e+01 2.319e+02
age_yrs -1.101e-02 2.602e-03
genderFemale 1.209e-01 7.828e-02
race_5Black 3.085e-02 1.460e-01
race_5Asian or Pacific Islander -3.382e-01 3.018e-01
race_5American Indian or Alaska Native -1.095e+00 1.025e+00
race_5Other -4.055e-01 2.840e-01
ethnic_3Non-Hispanic 3.078e-01 3.465e-01
lang_3Other 2.665e-01 4.519e-01
act_tobYes 2.110e-02 1.144e-01
max_ch -1.055e-03 9.599e-03
insuranceMedicaid -1.950e-01 1.093e-01
insuranceMedicare -3.242e-01 1.353e-01
insuranceOther Governmental -1.190e+00 7.285e-01
insuranceOther -1.598e-01 6.176e-01
RPL_THEMES 3.452e-01 1.577e-01
z value Pr(>|z|)
(Intercept) -4.660 3.16e-06 ***
ibd_3UC -16.920 < 2e-16 ***
ibd_3IC -0.013 0.9894
ibd_3Unknown -0.059 0.9529
age_yrs -4.233 2.31e-05 ***
genderFemale 1.544 0.1226
race_5Black 0.211 0.8326
race_5Asian or Pacific Islander -1.121 0.2624
race_5American Indian or Alaska Native -1.068 0.2857
race_5Other -1.428 0.1532
ethnic_3Non-Hispanic 0.888 0.3743
lang_3Other 0.590 0.5553
act_tobYes 0.184 0.8536
max_ch -0.110 0.9125
insuranceMedicaid -1.784 0.0745 .
insuranceMedicare -2.397 0.0165 *
insuranceOther Governmental -1.633 0.1024
insuranceOther -0.259 0.7958
RPL_THEMES 2.189 0.0286 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 5275.4 on 8962 degrees of freedom
Residual deviance: 4772.0 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 4810
Number of Fisher Scoring iterations: 14
broom::glance(uste_access )
broom::tidy(uste_access , exponentiate = TRUE)
tbl_regression(uste_access, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.17 |
0.14, 0.21 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.00 |
0.00, 0.04 |
>0.9 |
| Age |
0.99 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.13 |
0.97, 1.32 |
0.12 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.03 |
0.77, 1.36 |
0.8 |
| Â Â Â Â Asian or Pacific Islander |
0.71 |
0.38, 1.24 |
0.3 |
| Â Â Â Â American Indian or Alaska Native |
0.33 |
0.02, 1.60 |
0.3 |
| Â Â Â Â Other |
0.67 |
0.37, 1.13 |
0.2 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.36 |
0.72, 2.85 |
0.4 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.31 |
0.49, 2.94 |
0.6 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.02 |
0.81, 1.27 |
0.9 |
| Charlson Comorbidity Index |
1.00 |
0.98, 1.02 |
>0.9 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.82 |
0.66, 1.02 |
0.074 |
| Â Â Â Â Medicare |
0.72 |
0.55, 0.94 |
0.017 |
| Â Â Â Â Other Governmental |
0.30 |
0.05, 1.00 |
0.10 |
| Â Â Â Â Other |
0.85 |
0.20, 2.47 |
0.8 |
| Social Vulnerability Index |
1.41 |
1.04, 1.92 |
0.029 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(uste_access)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 14.9172
degrees of freedom = 9
p-value = 0.093235
# C-Statistic/AUROC
Cstat(uste_access)
[1] 0.7266573
# Model performance
model_performance(uste_access)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
4809.986 | 4810.071 | 4944.902 | 0.052 | 0.274 | 0.730 | 0.266 | -71.695 | 7.174e-04 | 0.850
performance::check_model(uste_access)
Variable `Component` is not in your data frame :/

# Margins
margins(uste_access)
Average marginal effects
glm(formula = ustekinumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(uste_access, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Ustekinumab Rx Given SVI")

Sustained ustekinumab access + all themes
uste_acc_themes <- glm(ustekinumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(uste_acc_themes )
Call:
glm(formula = ustekinumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.8564 -0.5411 -0.2716 -0.2151 2.9428
Coefficients:
Estimate Std. Error
(Intercept) -1.732e+00 3.740e-01
ibd_3UC -1.746e+00 1.040e-01
ibd_3IC -1.376e+01 1.026e+03
ibd_3Unknown -1.370e+01 2.317e+02
age_yrs -1.108e-02 2.609e-03
genderFemale 1.234e-01 7.848e-02
race_5Black -9.740e-03 1.487e-01
race_5Asian or Pacific Islander -3.209e-01 3.041e-01
race_5American Indian or Alaska Native -1.091e+00 1.026e+00
race_5Other -3.976e-01 2.844e-01
ethnic_3Non-Hispanic 3.031e-01 3.463e-01
lang_3Other 2.325e-01 4.538e-01
act_tobYes 9.917e-03 1.147e-01
max_ch -6.285e-04 9.625e-03
insuranceMedicaid -2.188e-01 1.101e-01
insuranceMedicare -3.273e-01 1.354e-01
insuranceOther Governmental -1.195e+00 7.286e-01
insuranceOther -1.527e-01 6.173e-01
RPL_THEME1 5.041e-01 2.247e-01
RPL_THEME2 1.491e-01 1.944e-01
RPL_THEME3 1.230e-01 1.419e-01
RPL_THEME4 -2.704e-01 1.642e-01
z value Pr(>|z|)
(Intercept) -4.630 3.66e-06 ***
ibd_3UC -16.798 < 2e-16 ***
ibd_3IC -0.013 0.9893
ibd_3Unknown -0.059 0.9528
age_yrs -4.248 2.16e-05 ***
genderFemale 1.572 0.1159
race_5Black -0.066 0.9478
race_5Asian or Pacific Islander -1.055 0.2913
race_5American Indian or Alaska Native -1.063 0.2876
race_5Other -1.398 0.1620
ethnic_3Non-Hispanic 0.875 0.3814
lang_3Other 0.512 0.6084
act_tobYes 0.086 0.9311
max_ch -0.065 0.9479
insuranceMedicaid -1.988 0.0468 *
insuranceMedicare -2.417 0.0157 *
insuranceOther Governmental -1.640 0.1010
insuranceOther -0.247 0.8047
RPL_THEME1 2.243 0.0249 *
RPL_THEME2 0.767 0.4432
RPL_THEME3 0.867 0.3860
RPL_THEME4 -1.647 0.0995 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 5251.4 on 8908 degrees of freedom
Residual deviance: 4747.1 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 4791.1
Number of Fisher Scoring iterations: 14
broom::glance(uste_acc_themes )
broom::tidy(uste_acc_themes , exponentiate = TRUE)
tbl_regression(uste_acc_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: collapsing to unique 'x' values
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.17 |
0.14, 0.21 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.00 |
0.00, 0.04 |
>0.9 |
| Age |
0.99 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.13 |
0.97, 1.32 |
0.12 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.99 |
0.73, 1.32 |
>0.9 |
| Â Â Â Â Asian or Pacific Islander |
0.73 |
0.38, 1.27 |
0.3 |
| Â Â Â Â American Indian or Alaska Native |
0.34 |
0.02, 1.61 |
0.3 |
| Â Â Â Â Other |
0.67 |
0.37, 1.14 |
0.2 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.35 |
0.72, 2.84 |
0.4 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.26 |
0.47, 2.86 |
0.6 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.01 |
0.80, 1.26 |
>0.9 |
| Charlson Comorbidity Index |
1.00 |
0.98, 1.02 |
>0.9 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.80 |
0.65, 0.99 |
0.047 |
| Â Â Â Â Medicare |
0.72 |
0.55, 0.94 |
0.016 |
| Â Â Â Â Other Governmental |
0.30 |
0.05, 1.00 |
0.10 |
| Â Â Â Â Other |
0.86 |
0.20, 2.48 |
0.8 |
| Socioeconomic Status |
1.66 |
1.06, 2.57 |
0.025 |
| Household Composition |
1.16 |
0.79, 1.70 |
0.4 |
| Minority and Language Status |
1.13 |
0.86, 1.49 |
0.4 |
| Housing and Transportation |
0.76 |
0.55, 1.05 |
0.10 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(uste_acc_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 9.13718
degrees of freedom = 8
p-value = 0.33086
# C-Statistic/AUROC
Cstat(uste_acc_themes)
[1] 0.7289203
# Model performance
model_performance(uste_acc_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
4791.062 | 4791.176 | 4947.148 | 0.053 | 0.274 | 0.731 | 0.266 | -71.614 | 7.223e-04 | 0.850
performance::check_model(uste_acc_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(uste_acc_themes)
Average marginal effects
glm(formula = ustekinumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(uste_acc_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Ustekinumab Access Given Theme1")

cplot(uste_acc_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Ustekinumab Access Given Theme2")

cplot(uste_acc_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Ustekinumab Access Given Theme3")

cplot(uste_acc_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Ustekinumab Access Given Theme4")

Sustained ustekinumab access + sub-sub themes
uste_acc_themes2 <- glm(ustekinumab_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(uste_acc_themes2 )
Call:
glm(formula = ustekinumab_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.0957 -0.5133 -0.3138 -0.2297 2.8209
Coefficients:
Estimate Std. Error
(Intercept) -3.447e+00 1.011e+00
ibd_3UC -1.433e+00 2.071e-01
ibd_3Unknown -1.533e+01 1.387e+03
age_yrs -1.145e-02 5.741e-03
genderFemale 7.378e-02 1.667e-01
race_5Black -1.403e-01 3.446e-01
race_5Asian or Pacific Islander 1.853e-01 7.695e-01
race_5American Indian or Alaska Native -1.495e+01 9.771e+02
race_5Other 3.382e-01 5.432e-01
ethnic_3Non-Hispanic 7.024e-01 8.116e-01
lang_3Other -1.464e+01 1.147e+03
act_tobYes -1.386e-02 2.232e-01
max_ch -1.411e-02 2.049e-02
insuranceMedicaid 6.862e-02 2.109e-01
insuranceMedicare -1.085e-01 2.676e-01
insuranceOther Governmental -1.537e+01 9.191e+02
insuranceOther 9.994e-01 8.624e-01
EPL_MUNIT 6.478e-01 4.819e-01
EPL_MOBILE 1.165e+00 5.311e-01
EPL_CROWD -1.547e-01 3.942e-01
EPL_NOVEH 1.131e-01 4.179e-01
EPL_GROUPQ 3.092e-01 3.715e-01
z value Pr(>|z|)
(Intercept) -3.411 0.000648 ***
ibd_3UC -6.920 4.5e-12 ***
ibd_3Unknown -0.011 0.991184
age_yrs -1.995 0.046038 *
genderFemale 0.443 0.658059
race_5Black -0.407 0.683871
race_5Asian or Pacific Islander 0.241 0.809675
race_5American Indian or Alaska Native -0.015 0.987789
race_5Other 0.623 0.533518
ethnic_3Non-Hispanic 0.865 0.386767
lang_3Other -0.013 0.989814
act_tobYes -0.062 0.950488
max_ch -0.689 0.491054
insuranceMedicaid 0.325 0.744949
insuranceMedicare -0.405 0.685124
insuranceOther Governmental -0.017 0.986654
insuranceOther 1.159 0.246490
EPL_MUNIT 1.344 0.178843
EPL_MOBILE 2.193 0.028315 *
EPL_CROWD -0.392 0.694720
EPL_NOVEH 0.271 0.786573
EPL_GROUPQ 0.832 0.405376
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1175.1 on 2012 degrees of freedom
Residual deviance: 1077.9 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 1121.9
Number of Fisher Scoring iterations: 16
broom::glance(uste_acc_themes2 )
broom::tidy(uste_acc_themes2 , exponentiate = TRUE)
tbl_regression(uste_acc_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: algorithm did not convergeWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: collapsing to unique 'x' values
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.24 |
0.16, 0.35 |
<0.001 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
0.99 |
0.98, 1.00 |
0.046 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.08 |
0.78, 1.50 |
0.7 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.87 |
0.42, 1.64 |
0.7 |
| Â Â Â Â Asian or Pacific Islander |
1.20 |
0.19, 4.44 |
0.8 |
| Â Â Â Â American Indian or Alaska Native |
0.00 |
|
>0.9 |
| Â Â Â Â Other |
1.40 |
0.43, 3.76 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
2.02 |
0.50, 13.9 |
0.4 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.00 |
0.00, 0.00 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.99 |
0.63, 1.51 |
>0.9 |
| Charlson Comorbidity Index |
0.99 |
0.95, 1.02 |
0.5 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.07 |
0.70, 1.61 |
0.7 |
| Â Â Â Â Medicare |
0.90 |
0.52, 1.50 |
0.7 |
| Â Â Â Â Other Governmental |
0.00 |
|
>0.9 |
| Â Â Â Â Other |
2.72 |
0.37, 13.2 |
0.2 |
| % Housing with 10 or more units |
1.91 |
0.74, 4.94 |
0.2 |
| % Mobile Homes |
3.21 |
1.14, 9.16 |
0.028 |
| % Homes with more people than rooms |
0.86 |
0.39, 1.85 |
0.7 |
| % Homes with no vehicle |
1.12 |
0.50, 2.56 |
0.8 |
| % People in group quarters |
1.36 |
0.66, 2.83 |
0.4 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(uste_acc_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 2.36049
degrees of freedom = 9
p-value = 0.9844
# C-Statistic/AUROC
Cstat(uste_acc_themes2)
[1] 0.7175922
# Model performance
model_performance(uste_acc_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
1121.891 | 1122.400 | 1245.253 | 0.046 | 0.273 | 0.736 | 0.268 | -15.491 | 0.004 | 0.851
performance::check_model(uste_acc_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(uste_acc_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of USTE Rx Given MUNIT")

cplot(uste_acc_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of USTE Rx Given MOBILE")

cplot(uste_acc_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of USTE Rx Given CROWD")

cplot(uste_acc_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of USTE Rx Given NOVEH")

cplot(uste_acc_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of USTE Rx Given GROUPQ")

IV Biologics
IV Biologic rx + Total SVI
med_data_ALL$bio_iv_2 <- as.numeric(med_data_ALL$bio_iv_2)
bio_iv_rx <- glm(bio_iv_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(bio_iv_rx )
Call:
glm(formula = bio_iv_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5966 -0.8994 -0.6290 1.1115 2.3838
Coefficients:
Estimate Std. Error
(Intercept) 1.467460 0.187700
ibd_3UC -0.704635 0.048408
ibd_3IC -10.750403 137.601974
ibd_3Unknown -1.746041 0.538234
age_yrs -0.032113 0.001625
genderFemale -0.177269 0.047574
race_5Black 0.121216 0.094471
race_5Asian or Pacific Islander -0.257005 0.157625
race_5American Indian or Alaska Native -0.377423 0.400793
race_5Other 0.100295 0.140155
ethnic_3Non-Hispanic -0.172224 0.171370
lang_3Other -0.252281 0.276391
act_tobYes -0.044290 0.073779
max_ch -0.003518 0.005676
insuranceMedicaid -0.047930 0.067903
insuranceMedicare 0.066988 0.079970
insuranceOther Governmental -0.511621 0.317887
insuranceOther -0.069191 0.349754
RPL_THEMES -0.133097 0.098536
z value Pr(>|z|)
(Intercept) 7.818 5.36e-15 ***
ibd_3UC -14.556 < 2e-16 ***
ibd_3IC -0.078 0.937727
ibd_3Unknown -3.244 0.001179 **
age_yrs -19.768 < 2e-16 ***
genderFemale -3.726 0.000194 ***
race_5Black 1.283 0.199455
race_5Asian or Pacific Islander -1.630 0.102999
race_5American Indian or Alaska Native -0.942 0.346351
race_5Other 0.716 0.474239
ethnic_3Non-Hispanic -1.005 0.314905
lang_3Other -0.913 0.361364
act_tobYes -0.600 0.548308
max_ch -0.620 0.535421
insuranceMedicaid -0.706 0.480275
insuranceMedicare 0.838 0.402218
insuranceOther Governmental -1.609 0.107519
insuranceOther -0.198 0.843181
RPL_THEMES -1.351 0.176779
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 11492 on 8962 degrees of freedom
Residual deviance: 10463 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 10501
Number of Fisher Scoring iterations: 10
broom::glance(bio_iv_rx )
broom::tidy(bio_iv_rx , exponentiate = TRUE)
tbl_regression(bio_iv_rx, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.49 |
0.45, 0.54 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.17 |
0.05, 0.45 |
0.001 |
| Age |
0.97 |
0.97, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.84 |
0.76, 0.92 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.13 |
0.94, 1.36 |
0.2 |
| Â Â Â Â Asian or Pacific Islander |
0.77 |
0.56, 1.05 |
0.10 |
| Â Â Â Â American Indian or Alaska Native |
0.69 |
0.30, 1.45 |
0.3 |
| Â Â Â Â Other |
1.11 |
0.84, 1.45 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.84 |
0.60, 1.18 |
0.3 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.78 |
0.44, 1.32 |
0.4 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.96 |
0.83, 1.10 |
0.5 |
| Charlson Comorbidity Index |
1.00 |
0.99, 1.01 |
0.5 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.95 |
0.83, 1.09 |
0.5 |
| Â Â Â Â Medicare |
1.07 |
0.91, 1.25 |
0.4 |
| Â Â Â Â Other Governmental |
0.60 |
0.31, 1.09 |
0.11 |
| Â Â Â Â Other |
0.93 |
0.46, 1.82 |
0.8 |
| Social Vulnerability Index |
0.88 |
0.72, 1.06 |
0.2 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_iv_rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 38.66926
degrees of freedom = 9
p-value = 1.3215e-05
# C-Statistic/AUROC
Cstat(bio_iv_rx)
[1] 0.6978825
# Model performance
model_performance(bio_iv_rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
10501.162 | 10501.247 | 10636.079 | 0.112 | 0.446 | 1.082 | 0.584 | -Inf | 1.578e-04 | 0.601
performance::check_model(bio_iv_rx)
Variable `Component` is not in your data frame :/

# Margins
margins(bio_iv_rx)
Average marginal effects
glm(formula = bio_iv_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(bio_iv_rx, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given SVI")

Sustained IV biologic access
med_data_ALL$bio_iv_3 <- as.numeric(med_data_ALL$bio_iv_3)
bio_iv_acc <- glm(bio_iv_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(bio_iv_acc )
Call:
glm(formula = bio_iv_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5751 -0.7657 -0.5402 -0.2601 2.6961
Coefficients:
Estimate Std. Error
(Intercept) 1.303332 0.199285
ibd_3UC -0.653533 0.054048
ibd_3IC -10.071716 138.785316
ibd_3Unknown -2.691742 1.020513
age_yrs -0.038736 0.001834
genderFemale -0.235171 0.052502
race_5Black 0.374052 0.100484
race_5Asian or Pacific Islander -0.118840 0.170115
race_5American Indian or Alaska Native -0.158514 0.438967
race_5Other 0.177704 0.150103
ethnic_3Non-Hispanic -0.203093 0.181709
lang_3Other 0.129194 0.292545
act_tobYes -0.027711 0.081321
max_ch 0.018499 0.006417
insuranceMedicaid 0.047551 0.072914
insuranceMedicare 0.043286 0.094949
insuranceOther Governmental -1.011354 0.421402
insuranceOther -0.068039 0.388213
RPL_THEMES -0.553147 0.110096
z value Pr(>|z|)
(Intercept) 6.540 6.15e-11 ***
ibd_3UC -12.092 < 2e-16 ***
ibd_3IC -0.073 0.942148
ibd_3Unknown -2.638 0.008349 **
age_yrs -21.123 < 2e-16 ***
genderFemale -4.479 7.49e-06 ***
race_5Black 3.723 0.000197 ***
race_5Asian or Pacific Islander -0.699 0.484809
race_5American Indian or Alaska Native -0.361 0.718019
race_5Other 1.184 0.236460
ethnic_3Non-Hispanic -1.118 0.263704
lang_3Other 0.442 0.658765
act_tobYes -0.341 0.733285
max_ch 2.883 0.003941 **
insuranceMedicaid 0.652 0.514305
insuranceMedicare 0.456 0.648471
insuranceOther Governmental -2.400 0.016396 *
insuranceOther -0.175 0.860873
RPL_THEMES -5.024 5.05e-07 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 9951.5 on 8962 degrees of freedom
Residual deviance: 8926.8 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 8964.8
Number of Fisher Scoring iterations: 10
broom::glance(bio_iv_acc )
broom::tidy(bio_iv_acc , exponentiate = TRUE)
tbl_regression(bio_iv_acc, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.52 |
0.47, 0.58 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.07 |
0.00, 0.32 |
0.008 |
| Age |
0.96 |
0.96, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.79 |
0.71, 0.88 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.45 |
1.19, 1.77 |
<0.001 |
| Â Â Â Â Asian or Pacific Islander |
0.89 |
0.63, 1.23 |
0.5 |
| Â Â Â Â American Indian or Alaska Native |
0.85 |
0.33, 1.91 |
0.7 |
| Â Â Â Â Other |
1.19 |
0.89, 1.60 |
0.2 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.82 |
0.57, 1.17 |
0.3 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.14 |
0.63, 1.98 |
0.7 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.97 |
0.83, 1.14 |
0.7 |
| Charlson Comorbidity Index |
1.02 |
1.01, 1.03 |
0.004 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.05 |
0.91, 1.21 |
0.5 |
| Â Â Â Â Medicare |
1.04 |
0.87, 1.26 |
0.6 |
| Â Â Â Â Other Governmental |
0.36 |
0.15, 0.78 |
0.016 |
| Â Â Â Â Other |
0.93 |
0.42, 1.94 |
0.9 |
| Social Vulnerability Index |
0.58 |
0.46, 0.71 |
<0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_iv_acc)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 34.61629
degrees of freedom = 9
p-value = 6.9619e-05
# C-Statistic/AUROC
Cstat(bio_iv_acc)
[1] 0.7156007
# Model performance
model_performance(bio_iv_acc)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
8964.834 | 8964.919 | 9099.750 | 0.116 | 0.403 | 0.999 | 0.498 | -Inf | 1.578e-04 | 0.674
performance::check_model(bio_iv_acc)
Variable `Component` is not in your data frame :/

# Margins
margins(bio_iv_acc)
Average marginal effects
glm(formula = bio_iv_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(bio_iv_acc, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given SVI")

IV Biologic Rx + Subthemes
bio_iv_themes <- glm(bio_iv_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(bio_iv_themes )
Call:
glm(formula = bio_iv_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.6117 -0.9016 -0.6297 1.1109 2.4442
Coefficients:
Estimate Std. Error
(Intercept) 1.467516 0.195999
ibd_3UC -0.697266 0.048565
ibd_3IC -10.879946 136.227976
ibd_3Unknown -1.753979 0.538383
age_yrs -0.032276 0.001631
genderFemale -0.170780 0.047726
race_5Black 0.085871 0.096211
race_5Asian or Pacific Islander -0.263681 0.159901
race_5American Indian or Alaska Native -0.360019 0.401316
race_5Other 0.088959 0.141347
ethnic_3Non-Hispanic -0.151340 0.172405
lang_3Other -0.259519 0.277551
act_tobYes -0.050679 0.074031
max_ch -0.003517 0.005703
insuranceMedicaid -0.057945 0.068330
insuranceMedicare 0.069779 0.080191
insuranceOther Governmental -0.513515 0.317995
insuranceOther -0.071252 0.349009
RPL_THEME1 0.107700 0.139408
RPL_THEME2 0.055819 0.119686
RPL_THEME3 0.070638 0.087012
RPL_THEME4 -0.359292 0.100617
z value Pr(>|z|)
(Intercept) 7.487 7.03e-14 ***
ibd_3UC -14.357 < 2e-16 ***
ibd_3IC -0.080 0.936344
ibd_3Unknown -3.258 0.001123 **
age_yrs -19.784 < 2e-16 ***
genderFemale -3.578 0.000346 ***
race_5Black 0.893 0.372106
race_5Asian or Pacific Islander -1.649 0.099143 .
race_5American Indian or Alaska Native -0.897 0.369667
race_5Other 0.629 0.529107
ethnic_3Non-Hispanic -0.878 0.380044
lang_3Other -0.935 0.349771
act_tobYes -0.685 0.493622
max_ch -0.617 0.537393
insuranceMedicaid -0.848 0.396431
insuranceMedicare 0.870 0.384212
insuranceOther Governmental -1.615 0.106343
insuranceOther -0.204 0.838232
RPL_THEME1 0.773 0.439790
RPL_THEME2 0.466 0.640948
RPL_THEME3 0.812 0.416896
RPL_THEME4 -3.571 0.000356 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 11430 on 8908 degrees of freedom
Residual deviance: 10399 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 10443
Number of Fisher Scoring iterations: 10
broom::glance(bio_iv_themes )
broom::tidy(bio_iv_themes , exponentiate = TRUE)
tbl_regression(bio_iv_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.50 |
0.45, 0.55 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.17 |
0.05, 0.44 |
0.001 |
| Age |
0.97 |
0.97, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.84 |
0.77, 0.93 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.09 |
0.90, 1.31 |
0.4 |
| Â Â Â Â Asian or Pacific Islander |
0.77 |
0.56, 1.05 |
0.10 |
| Â Â Â Â American Indian or Alaska Native |
0.70 |
0.30, 1.48 |
0.4 |
| Â Â Â Â Other |
1.09 |
0.83, 1.44 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.86 |
0.61, 1.21 |
0.4 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.77 |
0.44, 1.31 |
0.3 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.95 |
0.82, 1.10 |
0.5 |
| Charlson Comorbidity Index |
1.00 |
0.99, 1.01 |
0.5 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.94 |
0.83, 1.08 |
0.4 |
| Â Â Â Â Medicare |
1.07 |
0.92, 1.25 |
0.4 |
| Â Â Â Â Other Governmental |
0.60 |
0.31, 1.09 |
0.11 |
| Â Â Â Â Other |
0.93 |
0.46, 1.82 |
0.8 |
| Socioeconomic Status |
1.11 |
0.85, 1.46 |
0.4 |
| Household Composition |
1.06 |
0.84, 1.34 |
0.6 |
| Minority and Language Status |
1.07 |
0.90, 1.27 |
0.4 |
| Housing and Transportation |
0.70 |
0.57, 0.85 |
<0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_iv_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 31.43885
degrees of freedom = 8
p-value = 0.00011735
# C-Statistic/AUROC
Cstat(bio_iv_themes)
[1] 0.6985179
# Model performance
model_performance(bio_iv_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
10443.345 | 10443.459 | 10599.431 | 0.113 | 0.446 | 1.082 | 0.584 | -Inf | 1.587e-04 | 0.601
performance::check_model(bio_iv_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(bio_iv_themes)
Average marginal effects
glm(formula = bio_iv_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(bio_iv_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given Theme1")

cplot(bio_iv_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given Theme2")

cplot(bio_iv_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given Theme3")

cplot(bio_iv_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given Theme4")

Sustained IV biologic Rx + Subthemes
bio_acc_themes <- glm(bio_iv_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(bio_acc_themes )
Call:
glm(formula = bio_iv_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5192 -0.7630 -0.5390 -0.2506 2.6761
Coefficients:
Estimate Std. Error
(Intercept) 1.263121 0.209481
ibd_3UC -0.646943 0.054285
ibd_3IC -10.312384 137.851718
ibd_3Unknown -2.702299 1.020196
age_yrs -0.038863 0.001844
genderFemale -0.231369 0.052730
race_5Black 0.279899 0.102222
race_5Asian or Pacific Islander -0.203378 0.172888
race_5American Indian or Alaska Native -0.127596 0.439657
race_5Other 0.122521 0.151847
ethnic_3Non-Hispanic -0.167544 0.183635
lang_3Other 0.065773 0.293520
act_tobYes -0.032628 0.081761
max_ch 0.019056 0.006454
insuranceMedicaid 0.045426 0.073537
insuranceMedicare 0.053043 0.095309
insuranceOther Governmental -1.006963 0.421633
insuranceOther -0.054048 0.387095
RPL_THEME1 -0.016612 0.154300
RPL_THEME2 -0.132804 0.132764
RPL_THEME3 0.258439 0.096239
RPL_THEME4 -0.601161 0.111823
z value Pr(>|z|)
(Intercept) 6.030 1.64e-09 ***
ibd_3UC -11.917 < 2e-16 ***
ibd_3IC -0.075 0.94037
ibd_3Unknown -2.649 0.00808 **
age_yrs -21.078 < 2e-16 ***
genderFemale -4.388 1.15e-05 ***
race_5Black 2.738 0.00618 **
race_5Asian or Pacific Islander -1.176 0.23945
race_5American Indian or Alaska Native -0.290 0.77165
race_5Other 0.807 0.41974
ethnic_3Non-Hispanic -0.912 0.36157
lang_3Other 0.224 0.82269
act_tobYes -0.399 0.68984
max_ch 2.953 0.00315 **
insuranceMedicaid 0.618 0.53675
insuranceMedicare 0.557 0.57784
insuranceOther Governmental -2.388 0.01693 *
insuranceOther -0.140 0.88896
RPL_THEME1 -0.108 0.91426
RPL_THEME2 -1.000 0.31717
RPL_THEME3 2.685 0.00724 **
RPL_THEME4 -5.376 7.62e-08 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 9898.7 on 8908 degrees of freedom
Residual deviance: 8854.0 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 8898
Number of Fisher Scoring iterations: 10
broom::glance(bio_acc_themes )
broom::tidy(bio_acc_themes , exponentiate = TRUE)
tbl_regression(bio_acc_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.52 |
0.47, 0.58 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.07 |
0.00, 0.32 |
0.008 |
| Age |
0.96 |
0.96, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.79 |
0.72, 0.88 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.32 |
1.08, 1.61 |
0.006 |
| Â Â Â Â Asian or Pacific Islander |
0.82 |
0.58, 1.14 |
0.2 |
| Â Â Â Â American Indian or Alaska Native |
0.88 |
0.34, 1.98 |
0.8 |
| Â Â Â Â Other |
1.13 |
0.84, 1.52 |
0.4 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.85 |
0.59, 1.22 |
0.4 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.07 |
0.59, 1.87 |
0.8 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.97 |
0.82, 1.13 |
0.7 |
| Charlson Comorbidity Index |
1.02 |
1.01, 1.03 |
0.003 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.05 |
0.91, 1.21 |
0.5 |
| Â Â Â Â Medicare |
1.05 |
0.87, 1.27 |
0.6 |
| Â Â Â Â Other Governmental |
0.37 |
0.15, 0.78 |
0.017 |
| Â Â Â Â Other |
0.95 |
0.42, 1.96 |
0.9 |
| Socioeconomic Status |
0.98 |
0.73, 1.33 |
>0.9 |
| Household Composition |
0.88 |
0.68, 1.14 |
0.3 |
| Minority and Language Status |
1.29 |
1.07, 1.56 |
0.007 |
| Housing and Transportation |
0.55 |
0.44, 0.68 |
<0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_acc_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 23.59774
degrees of freedom = 8
p-value = 0.0026759
# C-Statistic/AUROC
Cstat(bio_acc_themes)
[1] 0.7182597
# Model performance
model_performance(bio_acc_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
8897.975 | 8898.089 | 9054.061 | 0.119 | 0.403 | 0.998 | 0.497 | -Inf | 1.587e-04 | 0.675
performance::check_model(bio_acc_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(bio_acc_themes)
Average marginal effects
glm(formula = bio_iv_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(bio_acc_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given Theme1")

cplot(bio_acc_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given Theme2")

cplot(bio_acc_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given Theme3")

cplot(bio_acc_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given Theme4")

IV Biologic Rx + sub-sub themes
bio_rx_themes2 <- glm(bio_iv_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(bio_rx_themes2 )
Call:
glm(formula = bio_iv_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.6510 -0.8988 -0.6352 1.1187 2.4198
Coefficients:
Estimate Std. Error
(Intercept) 1.263068 0.560011
ibd_3UC -0.551686 0.103920
ibd_3Unknown -13.700582 294.236308
age_yrs -0.031729 0.003575
genderFemale -0.387445 0.101519
race_5Black 0.357256 0.208816
race_5Asian or Pacific Islander 0.065904 0.471979
race_5American Indian or Alaska Native 0.506158 0.555758
race_5Other 0.152951 0.354952
ethnic_3Non-Hispanic -0.097280 0.406375
lang_3Other -1.658581 1.114891
act_tobYes -0.027268 0.142670
max_ch -0.003725 0.011681
insuranceMedicaid 0.080271 0.134474
insuranceMedicare 0.053220 0.163026
insuranceOther Governmental -0.221874 0.586857
insuranceOther 0.529956 0.764419
EPL_MUNIT -0.067749 0.295592
EPL_MOBILE 0.393370 0.322681
EPL_CROWD -0.257951 0.244732
EPL_NOVEH 0.205066 0.258690
EPL_GROUPQ -0.332238 0.228774
z value Pr(>|z|)
(Intercept) 2.255 0.024106 *
ibd_3UC -5.309 1.1e-07 ***
ibd_3Unknown -0.047 0.962861
age_yrs -8.876 < 2e-16 ***
genderFemale -3.816 0.000135 ***
race_5Black 1.711 0.087106 .
race_5Asian or Pacific Islander 0.140 0.888949
race_5American Indian or Alaska Native 0.911 0.362426
race_5Other 0.431 0.666536
ethnic_3Non-Hispanic -0.239 0.810807
lang_3Other -1.488 0.136840
act_tobYes -0.191 0.848429
max_ch -0.319 0.749824
insuranceMedicaid 0.597 0.550554
insuranceMedicare 0.326 0.744083
insuranceOther Governmental -0.378 0.705378
insuranceOther 0.693 0.488134
EPL_MUNIT -0.229 0.818714
EPL_MOBILE 1.219 0.222819
EPL_CROWD -1.054 0.291877
EPL_NOVEH 0.793 0.427946
EPL_GROUPQ -1.452 0.146431
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2545.6 on 2012 degrees of freedom
Residual deviance: 2313.0 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 2357
Number of Fisher Scoring iterations: 13
broom::glance(bio_rx_themes2 )
broom::tidy(bio_rx_themes2 , exponentiate = TRUE)
tbl_regression(bio_rx_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.58 |
0.47, 0.71 |
<0.001 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
0.97 |
0.96, 0.98 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.68 |
0.56, 0.83 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.43 |
0.95, 2.15 |
0.087 |
| Â Â Â Â Asian or Pacific Islander |
1.07 |
0.41, 2.65 |
0.9 |
| Â Â Â Â American Indian or Alaska Native |
1.66 |
0.53, 4.86 |
0.4 |
| Â Â Â Â Other |
1.17 |
0.57, 2.32 |
0.7 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.91 |
0.41, 2.05 |
0.8 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.19 |
0.01, 1.19 |
0.14 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.97 |
0.73, 1.28 |
0.8 |
| Charlson Comorbidity Index |
1.00 |
0.97, 1.02 |
0.7 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.08 |
0.83, 1.41 |
0.6 |
| Â Â Â Â Medicare |
1.05 |
0.76, 1.45 |
0.7 |
| Â Â Â Â Other Governmental |
0.80 |
0.23, 2.43 |
0.7 |
| Â Â Â Â Other |
1.70 |
0.36, 7.93 |
0.5 |
| % Housing with 10 or more units |
0.93 |
0.52, 1.67 |
0.8 |
| % Mobile Homes |
1.48 |
0.79, 2.79 |
0.2 |
| % Homes with more people than rooms |
0.77 |
0.48, 1.25 |
0.3 |
| % Homes with no vehicle |
1.23 |
0.74, 2.04 |
0.4 |
| % People in group quarters |
0.72 |
0.46, 1.12 |
0.15 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_rx_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 14.03006
degrees of freedom = 9
p-value = 0.12126
# C-Statistic/AUROC
Cstat(bio_rx_themes2)
[1] 0.6980105
# Model performance
model_performance(bio_rx_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
2357.032 | 2357.540 | 2480.394 | 0.112 | 0.442 | 1.078 | 0.575 | -Inf | 0.001 | 0.609
performance::check_model(bio_rx_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(bio_rx_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given MUNIT")

cplot(bio_rx_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given MOBILE")

cplot(bio_rx_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given CROWD")

cplot(bio_rx_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given NOVEH")

cplot(bio_rx_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given GROUPQ")

Sustained IV Biologic Rx + sub-sub themes
bio_acc_themes2 <- glm(bio_iv_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(bio_acc_themes2 )
Call:
glm(formula = bio_iv_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.6329 -0.7001 -0.4668 -0.2676 2.6594
Coefficients:
Estimate Std. Error
(Intercept) 1.639432 0.662373
ibd_3UC -0.610926 0.125015
ibd_3Unknown -14.055141 486.384753
age_yrs -0.041861 0.004384
genderFemale -0.478516 0.119928
race_5Black 0.563558 0.226562
race_5Asian or Pacific Islander 0.612872 0.492348
race_5American Indian or Alaska Native 0.982692 0.584176
race_5Other 0.308890 0.409378
ethnic_3Non-Hispanic 0.056313 0.478004
lang_3Other -14.281918 395.657941
act_tobYes -0.114984 0.169031
max_ch 0.026763 0.014158
insuranceMedicaid 0.293018 0.150385
insuranceMedicare -0.065678 0.214747
insuranceOther Governmental -1.637965 1.066829
insuranceOther 0.702736 0.821428
EPL_MUNIT -0.154303 0.354035
EPL_MOBILE -0.337425 0.379971
EPL_CROWD -0.512101 0.289249
EPL_NOVEH 0.250061 0.305900
EPL_GROUPQ -0.686300 0.270281
z value Pr(>|z|)
(Intercept) 2.475 0.0133 *
ibd_3UC -4.887 1.02e-06 ***
ibd_3Unknown -0.029 0.9769
age_yrs -9.549 < 2e-16 ***
genderFemale -3.990 6.61e-05 ***
race_5Black 2.487 0.0129 *
race_5Asian or Pacific Islander 1.245 0.2132
race_5American Indian or Alaska Native 1.682 0.0925 .
race_5Other 0.755 0.4505
ethnic_3Non-Hispanic 0.118 0.9062
lang_3Other -0.036 0.9712
act_tobYes -0.680 0.4963
max_ch 1.890 0.0587 .
insuranceMedicaid 1.948 0.0514 .
insuranceMedicare -0.306 0.7597
insuranceOther Governmental -1.535 0.1247
insuranceOther 0.856 0.3923
EPL_MUNIT -0.436 0.6630
EPL_MOBILE -0.888 0.3745
EPL_CROWD -1.770 0.0767 .
EPL_NOVEH 0.817 0.4137
EPL_GROUPQ -2.539 0.0111 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2035.0 on 2012 degrees of freedom
Residual deviance: 1769.5 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 1813.5
Number of Fisher Scoring iterations: 14
broom::glance(bio_acc_themes2 )
broom::tidy(bio_acc_themes2 , exponentiate = TRUE)
tbl_regression(bio_acc_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.54 |
0.42, 0.69 |
<0.001 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
0.96 |
0.95, 0.97 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.62 |
0.49, 0.78 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.76 |
1.12, 2.72 |
0.013 |
| Â Â Â Â Asian or Pacific Islander |
1.85 |
0.67, 4.72 |
0.2 |
| Â Â Â Â American Indian or Alaska Native |
2.67 |
0.78, 8.09 |
0.093 |
| Â Â Â Â Other |
1.36 |
0.59, 2.97 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.06 |
0.43, 2.83 |
>0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.00 |
|
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.89 |
0.64, 1.24 |
0.5 |
| Charlson Comorbidity Index |
1.03 |
1.00, 1.06 |
0.059 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.34 |
1.00, 1.80 |
0.051 |
| Â Â Â Â Medicare |
0.94 |
0.61, 1.42 |
0.8 |
| Â Â Â Â Other Governmental |
0.19 |
0.01, 1.06 |
0.12 |
| Â Â Â Â Other |
2.02 |
0.36, 9.82 |
0.4 |
| % Housing with 10 or more units |
0.86 |
0.43, 1.72 |
0.7 |
| % Mobile Homes |
0.71 |
0.34, 1.50 |
0.4 |
| % Homes with more people than rooms |
0.60 |
0.34, 1.05 |
0.077 |
| % Homes with no vehicle |
1.28 |
0.71, 2.35 |
0.4 |
| % People in group quarters |
0.50 |
0.30, 0.85 |
0.011 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_acc_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 13.28709
degrees of freedom = 9
p-value = 0.15004
# C-Statistic/AUROC
Cstat(bio_acc_themes2)
[1] 0.7423398
# Model performance
model_performance(bio_acc_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
1813.523 | 1814.032 | 1936.885 | 0.138 | 0.373 | 0.943 | 0.440 | -100.913 | 0.002 | 0.720
performance::check_model(bio_acc_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(bio_acc_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given MUNIT")

cplot(bio_acc_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given MOBILE")

cplot(bio_acc_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given CROWD")

cplot(bio_acc_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given NOVEH")

cplot(bio_acc_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given GROUPQ")

SubQ Biologics
SubQ Biologic rx + Total SVI
med_data_ALL$bio_subq_2 <- as.numeric(med_data_ALL$bio_subq_2)
bio_sub_rx <- glm(bio_subq_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(bio_sub_rx )
Call:
glm(formula = bio_subq_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.2860 -0.8722 -0.6198 1.1943 2.3462
Coefficients:
Estimate Std. Error
(Intercept) -0.247583 0.203497
ibd_3UC -1.289276 0.051466
ibd_3IC -11.071878 139.155837
ibd_3Unknown -1.341163 0.448353
age_yrs -0.003720 0.001617
genderFemale 0.047517 0.049045
race_5Black -0.052700 0.097732
race_5Asian or Pacific Islander -0.238262 0.169198
race_5American Indian or Alaska Native -0.712901 0.462656
race_5Other 0.020437 0.149056
ethnic_3Non-Hispanic 0.199606 0.189507
lang_3Other -0.334533 0.293055
act_tobYes 0.066088 0.074253
max_ch -0.036600 0.005961
insuranceMedicaid -0.089643 0.070096
insuranceMedicare -0.407241 0.080662
insuranceOther Governmental -0.224813 0.302074
insuranceOther -0.237177 0.368935
RPL_THEMES 0.328944 0.100316
z value Pr(>|z|)
(Intercept) -1.217 0.22374
ibd_3UC -25.051 < 2e-16 ***
ibd_3IC -0.080 0.93658
ibd_3Unknown -2.991 0.00278 **
age_yrs -2.300 0.02146 *
genderFemale 0.969 0.33262
race_5Black -0.539 0.58973
race_5Asian or Pacific Islander -1.408 0.15908
race_5American Indian or Alaska Native -1.541 0.12334
race_5Other 0.137 0.89094
ethnic_3Non-Hispanic 1.053 0.29221
lang_3Other -1.142 0.25365
act_tobYes 0.890 0.37345
max_ch -6.140 8.26e-10 ***
insuranceMedicaid -1.279 0.20095
insuranceMedicare -5.049 4.45e-07 ***
insuranceOther Governmental -0.744 0.45674
insuranceOther -0.643 0.52031
RPL_THEMES 3.279 0.00104 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 10976 on 8962 degrees of freedom
Residual deviance: 10031 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 10069
Number of Fisher Scoring iterations: 10
broom::glance(bio_sub_rx )
broom::tidy(bio_sub_rx , exponentiate = TRUE)
tbl_regression(bio_sub_rx, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: collapsing to unique 'x' values
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.28 |
0.25, 0.30 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.26 |
0.10, 0.59 |
0.003 |
| Age |
1.00 |
0.99, 1.00 |
0.021 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.05 |
0.95, 1.15 |
0.3 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.95 |
0.78, 1.15 |
0.6 |
| Â Â Â Â Asian or Pacific Islander |
0.79 |
0.56, 1.09 |
0.2 |
| Â Â Â Â American Indian or Alaska Native |
0.49 |
0.18, 1.14 |
0.12 |
| Â Â Â Â Other |
1.02 |
0.76, 1.36 |
0.9 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.22 |
0.85, 1.78 |
0.3 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.72 |
0.39, 1.25 |
0.3 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.07 |
0.92, 1.23 |
0.4 |
| Charlson Comorbidity Index |
0.96 |
0.95, 0.98 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.91 |
0.80, 1.05 |
0.2 |
| Â Â Â Â Medicare |
0.67 |
0.57, 0.78 |
<0.001 |
| Â Â Â Â Other Governmental |
0.80 |
0.43, 1.42 |
0.5 |
| Â Â Â Â Other |
0.79 |
0.37, 1.58 |
0.5 |
| Social Vulnerability Index |
1.39 |
1.14, 1.69 |
0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_sub_rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 15.94286
degrees of freedom = 9
p-value = 0.068084
# C-Statistic/AUROC
Cstat(bio_sub_rx)
[1] 0.6921746
# Model performance
model_performance(bio_sub_rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
10069.066 | 10069.151 | 10203.983 | 0.101 | 0.435 | 1.059 | 0.560 | -Inf | 1.578e-04 | 0.621
performance::check_model(bio_sub_rx)
Variable `Component` is not in your data frame :/

# Margins
margins(bio_sub_rx)
Average marginal effects
glm(formula = bio_subq_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(bio_sub_rx, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given SVI")

Sustained subq biologic access + SVI
med_data_ALL$bio_subq_3 <- as.numeric(med_data_ALL$bio_subq_3)
bio_sub_acc <- glm(bio_subq_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial",
data = med_data_ALL)
summary(bio_sub_acc )
Call:
glm(formula = bio_subq_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES,
family = "binomial", data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.1068 -0.8063 -0.5332 -0.3378 2.4784
Coefficients:
Estimate Std. Error
(Intercept) -0.402785 0.218677
ibd_3UC -1.280565 0.057702
ibd_3IC -10.618227 139.268038
ibd_3Unknown -1.367955 0.531771
age_yrs -0.006289 0.001758
genderFemale 0.016104 0.053222
race_5Black 0.072334 0.103525
race_5Asian or Pacific Islander -0.114120 0.180888
race_5American Indian or Alaska Native -0.267314 0.462557
race_5Other -0.121823 0.166357
ethnic_3Non-Hispanic 0.072177 0.203993
lang_3Other 0.053381 0.300709
act_tobYes 0.081077 0.079574
max_ch -0.028514 0.006622
insuranceMedicaid -0.132640 0.075423
insuranceMedicare -0.441874 0.090553
insuranceOther Governmental -0.551971 0.358970
insuranceOther -0.099912 0.392654
RPL_THEMES 0.215047 0.108792
z value Pr(>|z|)
(Intercept) -1.842 0.065487 .
ibd_3UC -22.193 < 2e-16 ***
ibd_3IC -0.076 0.939226
ibd_3Unknown -2.572 0.010098 *
age_yrs -3.577 0.000347 ***
genderFemale 0.303 0.762205
race_5Black 0.699 0.484733
race_5Asian or Pacific Islander -0.631 0.528114
race_5American Indian or Alaska Native -0.578 0.563329
race_5Other -0.732 0.463986
ethnic_3Non-Hispanic 0.354 0.723474
lang_3Other 0.178 0.859103
act_tobYes 1.019 0.308251
max_ch -4.306 1.66e-05 ***
insuranceMedicaid -1.759 0.078642 .
insuranceMedicare -4.880 1.06e-06 ***
insuranceOther Governmental -1.538 0.124134
insuranceOther -0.254 0.799146
RPL_THEMES 1.977 0.048077 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 9590.3 on 8962 degrees of freedom
Residual deviance: 8817.7 on 8944 degrees of freedom
(310 observations deleted due to missingness)
AIC: 8855.7
Number of Fisher Scoring iterations: 10
broom::glance(bio_sub_acc )
broom::tidy(bio_sub_acc , exponentiate = TRUE)
tbl_regression(bio_sub_acc, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.28 |
0.25, 0.31 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.25 |
0.08, 0.64 |
0.010 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.02 |
0.92, 1.13 |
0.8 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.08 |
0.88, 1.31 |
0.5 |
| Â Â Â Â Asian or Pacific Islander |
0.89 |
0.62, 1.26 |
0.5 |
| Â Â Â Â American Indian or Alaska Native |
0.77 |
0.28, 1.77 |
0.6 |
| Â Â Â Â Other |
0.89 |
0.63, 1.22 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.07 |
0.73, 1.62 |
0.7 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.05 |
0.57, 1.86 |
0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.08 |
0.93, 1.27 |
0.3 |
| Charlson Comorbidity Index |
0.97 |
0.96, 0.98 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.88 |
0.75, 1.01 |
0.079 |
| Â Â Â Â Medicare |
0.64 |
0.54, 0.77 |
<0.001 |
| Â Â Â Â Other Governmental |
0.58 |
0.27, 1.12 |
0.12 |
| Â Â Â Â Other |
0.90 |
0.40, 1.88 |
0.8 |
| Social Vulnerability Index |
1.24 |
1.00, 1.53 |
0.048 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_sub_acc)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 20.93409
degrees of freedom = 9
p-value = 0.012946
# C-Statistic/AUROC
Cstat(bio_sub_acc)
[1] 0.691075
# Model performance
model_performance(bio_sub_acc)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
8855.687 | 8855.772 | 8990.604 | 0.083 | 0.401 | 0.993 | 0.492 | -Inf | 1.578e-04 | 0.679
performance::check_model(bio_sub_acc)
Variable `Component` is not in your data frame :/

# Margins
margins(bio_sub_acc)
Average marginal effects
glm(formula = bio_subq_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEMES, family = "binomial", data = med_data_ALL)
cplot(bio_sub_acc, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given SVI")

SubQ Biologic Rx + Subthemes
bio_sub_themes <- glm(bio_subq_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(bio_sub_themes )
Call:
glm(formula = bio_subq_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.3428 -0.8666 -0.6147 1.1896 2.3712
Coefficients:
Estimate Std. Error
(Intercept) -0.260118 0.211959
ibd_3UC -1.284685 0.051640
ibd_3IC -11.154832 138.435567
ibd_3Unknown -1.349996 0.448390
age_yrs -0.003768 0.001624
genderFemale 0.053224 0.049207
race_5Black -0.066003 0.099608
race_5Asian or Pacific Islander -0.189430 0.171360
race_5American Indian or Alaska Native -0.708839 0.464173
race_5Other 0.035820 0.150157
ethnic_3Non-Hispanic 0.206531 0.190782
lang_3Other -0.326461 0.294840
act_tobYes 0.051386 0.074539
max_ch -0.036374 0.005984
insuranceMedicaid -0.111401 0.070559
insuranceMedicare -0.412833 0.080842
insuranceOther Governmental -0.236108 0.301937
insuranceOther -0.243532 0.368288
RPL_THEME1 0.436035 0.142739
RPL_THEME2 0.185908 0.122819
RPL_THEME3 0.001556 0.089410
RPL_THEME4 -0.219617 0.103301
z value Pr(>|z|)
(Intercept) -1.227 0.21974
ibd_3UC -24.878 < 2e-16 ***
ibd_3IC -0.081 0.93578
ibd_3Unknown -3.011 0.00261 **
age_yrs -2.321 0.02029 *
genderFemale 1.082 0.27941
race_5Black -0.663 0.50757
race_5Asian or Pacific Islander -1.105 0.26896
race_5American Indian or Alaska Native -1.527 0.12674
race_5Other 0.239 0.81145
ethnic_3Non-Hispanic 1.083 0.27901
lang_3Other -1.107 0.26819
act_tobYes 0.689 0.49058
max_ch -6.078 1.22e-09 ***
insuranceMedicaid -1.579 0.11437
insuranceMedicare -5.107 3.28e-07 ***
insuranceOther Governmental -0.782 0.43423
insuranceOther -0.661 0.50845
RPL_THEME1 3.055 0.00225 **
RPL_THEME2 1.514 0.13011
RPL_THEME3 0.017 0.98611
RPL_THEME4 -2.126 0.03350 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 10915.2 on 8908 degrees of freedom
Residual deviance: 9967.8 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 10012
Number of Fisher Scoring iterations: 10
broom::glance(bio_sub_themes )
broom::tidy(bio_sub_themes , exponentiate = TRUE)
tbl_regression(bio_sub_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.28 |
0.25, 0.31 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.26 |
0.10, 0.58 |
0.003 |
| Age |
1.00 |
0.99, 1.00 |
0.020 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.05 |
0.96, 1.16 |
0.3 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.94 |
0.77, 1.14 |
0.5 |
| Â Â Â Â Asian or Pacific Islander |
0.83 |
0.59, 1.15 |
0.3 |
| Â Â Â Â American Indian or Alaska Native |
0.49 |
0.18, 1.15 |
0.13 |
| Â Â Â Â Other |
1.04 |
0.77, 1.39 |
0.8 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.23 |
0.85, 1.80 |
0.3 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.72 |
0.39, 1.26 |
0.3 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.05 |
0.91, 1.22 |
0.5 |
| Charlson Comorbidity Index |
0.96 |
0.95, 0.98 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.89 |
0.78, 1.03 |
0.11 |
| Â Â Â Â Medicare |
0.66 |
0.56, 0.77 |
<0.001 |
| Â Â Â Â Other Governmental |
0.79 |
0.43, 1.40 |
0.4 |
| Â Â Â Â Other |
0.78 |
0.37, 1.57 |
0.5 |
| Socioeconomic Status |
1.55 |
1.17, 2.05 |
0.002 |
| Household Composition |
1.20 |
0.95, 1.53 |
0.13 |
| Minority and Language Status |
1.00 |
0.84, 1.19 |
>0.9 |
| Housing and Transportation |
0.80 |
0.66, 0.98 |
0.034 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_sub_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 13.37873
degrees of freedom = 8
p-value = 0.099466
# C-Statistic/AUROC
Cstat(bio_sub_themes)
[1] 0.6944085
# Model performance
model_performance(bio_sub_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
10011.823 | 10011.937 | 10167.909 | 0.102 | 0.435 | 1.059 | 0.559 | -Inf | 1.587e-04 | 0.621
performance::check_model(bio_sub_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(bio_sub_themes)
Average marginal effects
glm(formula = bio_subq_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(bio_sub_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given Theme1")

cplot(bio_sub_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given Theme2")

cplot(bio_sub_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given Theme3")

cplot(bio_sub_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given Theme4")

Sustained Sub biologic Rx + Subthemes
bio_sub_acc_themes <- glm(bio_subq_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance + RPL_THEME1
+ RPL_THEME2 + RPL_THEME3 + RPL_THEME4,
family = "binomial",
data = med_data_ALL)
summary(bio_sub_acc_themes )
Call:
glm(formula = bio_subq_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 +
RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.1480 -0.8084 -0.5328 -0.3383 2.4778
Coefficients:
Estimate Std. Error
(Intercept) -0.474850 0.228451
ibd_3UC -1.280172 0.057883
ibd_3IC -10.714424 139.067600
ibd_3Unknown -1.378215 0.531953
age_yrs -0.006129 0.001764
genderFemale 0.018914 0.053367
race_5Black 0.035297 0.105355
race_5Asian or Pacific Islander -0.133782 0.183045
race_5American Indian or Alaska Native -0.260528 0.463499
race_5Other -0.138567 0.167687
ethnic_3Non-Hispanic 0.097489 0.205865
lang_3Other 0.025952 0.302149
act_tobYes 0.072002 0.079869
max_ch -0.028529 0.006646
insuranceMedicaid -0.138929 0.075892
insuranceMedicare -0.440590 0.090721
insuranceOther Governmental -0.552211 0.358966
insuranceOther -0.097413 0.392151
RPL_THEME1 0.314562 0.154428
RPL_THEME2 0.032445 0.132987
RPL_THEME3 0.150409 0.096980
RPL_THEME4 -0.162797 0.111963
z value Pr(>|z|)
(Intercept) -2.079 0.037658 *
ibd_3UC -22.117 < 2e-16 ***
ibd_3IC -0.077 0.938588
ibd_3Unknown -2.591 0.009574 **
age_yrs -3.475 0.000511 ***
genderFemale 0.354 0.723026
race_5Black 0.335 0.737606
race_5Asian or Pacific Islander -0.731 0.464859
race_5American Indian or Alaska Native -0.562 0.574055
race_5Other -0.826 0.408608
ethnic_3Non-Hispanic 0.474 0.635813
lang_3Other 0.086 0.931552
act_tobYes 0.901 0.367324
max_ch -4.293 1.77e-05 ***
insuranceMedicaid -1.831 0.067156 .
insuranceMedicare -4.857 1.19e-06 ***
insuranceOther Governmental -1.538 0.123966
insuranceOther -0.248 0.803820
RPL_THEME1 2.037 0.041654 *
RPL_THEME2 0.244 0.807252
RPL_THEME3 1.551 0.120920
RPL_THEME4 -1.454 0.145938
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 9542.9 on 8908 degrees of freedom
Residual deviance: 8770.5 on 8887 degrees of freedom
(364 observations deleted due to missingness)
AIC: 8814.5
Number of Fisher Scoring iterations: 10
broom::glance(bio_sub_acc_themes )
broom::tidy(bio_sub_acc_themes , exponentiate = TRUE)
tbl_regression(bio_sub_acc_themes, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.28 |
0.25, 0.31 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.25 |
0.07, 0.64 |
0.010 |
| Age |
0.99 |
0.99, 1.00 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.02 |
0.92, 1.13 |
0.7 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.04 |
0.84, 1.27 |
0.7 |
| Â Â Â Â Asian or Pacific Islander |
0.87 |
0.60, 1.24 |
0.5 |
| Â Â Â Â American Indian or Alaska Native |
0.77 |
0.28, 1.79 |
0.6 |
| Â Â Â Â Other |
0.87 |
0.62, 1.20 |
0.4 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.10 |
0.74, 1.67 |
0.6 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.03 |
0.55, 1.82 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.07 |
0.92, 1.26 |
0.4 |
| Charlson Comorbidity Index |
0.97 |
0.96, 0.98 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.87 |
0.75, 1.01 |
0.067 |
| Â Â Â Â Medicare |
0.64 |
0.54, 0.77 |
<0.001 |
| Â Â Â Â Other Governmental |
0.58 |
0.27, 1.12 |
0.12 |
| Â Â Â Â Other |
0.91 |
0.40, 1.88 |
0.8 |
| Socioeconomic Status |
1.37 |
1.01, 1.85 |
0.042 |
| Household Composition |
1.03 |
0.80, 1.34 |
0.8 |
| Minority and Language Status |
1.16 |
0.96, 1.41 |
0.12 |
| Housing and Transportation |
0.85 |
0.68, 1.06 |
0.15 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_sub_acc_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 14.64295
degrees of freedom = 8
p-value = 0.066471
# C-Statistic/AUROC
Cstat(bio_sub_acc_themes)
[1] 0.6920568
# Model performance
model_performance(bio_sub_acc_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
8814.512 | 8814.626 | 8970.598 | 0.083 | 0.401 | 0.993 | 0.492 | -Inf | 1.587e-04 | 0.678
performance::check_model(bio_sub_acc_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(bio_sub_acc_themes)
Average marginal effects
glm(formula = bio_subq_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 + +lang_3 + act_tob + max_ch + insurance + RPL_THEME1 + RPL_THEME2 + RPL_THEME3 + RPL_THEME4, family = "binomial", data = med_data_ALL)
cplot(bio_sub_acc_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given Theme1")

cplot(bio_sub_acc_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given Theme2")

cplot(bio_sub_acc_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given Theme3")

cplot(bio_sub_acc_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given Theme4")

SubQ Biologic Rx + sub-sub themes
bio_sub_themes2 <- glm(bio_subq_2 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(bio_sub_themes2 )
Call:
glm(formula = bio_subq_2 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.4511 -0.8779 -0.6241 1.1911 2.3010
Coefficients:
Estimate Std. Error
(Intercept) -0.275200 0.559123
ibd_3UC -1.224644 0.108832
ibd_3Unknown -1.355970 1.075542
age_yrs -0.002555 0.003507
genderFemale 0.195118 0.103669
race_5Black -0.096339 0.216981
race_5Asian or Pacific Islander -0.271875 0.532058
race_5American Indian or Alaska Native -1.772844 1.049884
race_5Other -0.164777 0.360371
ethnic_3Non-Hispanic -0.468720 0.406215
lang_3Other -0.497058 0.848880
act_tobYes 0.173087 0.140793
max_ch -0.032499 0.011989
insuranceMedicaid -0.032146 0.136749
insuranceMedicare -0.469900 0.160546
insuranceOther Governmental -0.344637 0.559167
insuranceOther -0.747943 0.839287
EPL_MUNIT 0.246847 0.296412
EPL_MOBILE 0.253670 0.324488
EPL_CROWD 0.257997 0.246566
EPL_NOVEH -0.197632 0.259998
EPL_GROUPQ 0.436937 0.231149
z value Pr(>|z|)
(Intercept) -0.492 0.62258
ibd_3UC -11.253 < 2e-16 ***
ibd_3Unknown -1.261 0.20741
age_yrs -0.729 0.46623
genderFemale 1.882 0.05982 .
race_5Black -0.444 0.65704
race_5Asian or Pacific Islander -0.511 0.60936
race_5American Indian or Alaska Native -1.689 0.09129 .
race_5Other -0.457 0.64750
ethnic_3Non-Hispanic -1.154 0.24855
lang_3Other -0.586 0.55818
act_tobYes 1.229 0.21893
max_ch -2.711 0.00671 **
insuranceMedicaid -0.235 0.81415
insuranceMedicare -2.927 0.00342 **
insuranceOther Governmental -0.616 0.53767
insuranceOther -0.891 0.37284
EPL_MUNIT 0.833 0.40497
EPL_MOBILE 0.782 0.43436
EPL_CROWD 1.046 0.29539
EPL_NOVEH -0.760 0.44718
EPL_GROUPQ 1.890 0.05872 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2489.2 on 2012 degrees of freedom
Residual deviance: 2282.3 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 2326.3
Number of Fisher Scoring iterations: 5
broom::glance(bio_sub_themes2 )
broom::tidy(bio_sub_themes2 , exponentiate = TRUE)
tbl_regression(bio_sub_themes2, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.29 |
0.24, 0.36 |
<0.001 |
| Â Â Â Â Unknown |
0.26 |
0.01, 1.47 |
0.2 |
| Age |
1.00 |
0.99, 1.00 |
0.5 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.22 |
0.99, 1.49 |
0.060 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.91 |
0.59, 1.38 |
0.7 |
| Â Â Â Â Asian or Pacific Islander |
0.76 |
0.24, 2.03 |
0.6 |
| Â Â Â Â American Indian or Alaska Native |
0.17 |
0.01, 0.88 |
0.091 |
| Â Â Â Â Other |
0.85 |
0.41, 1.70 |
0.6 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.63 |
0.28, 1.40 |
0.2 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.61 |
0.08, 2.77 |
0.6 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.19 |
0.90, 1.56 |
0.2 |
| Charlson Comorbidity Index |
0.97 |
0.95, 0.99 |
0.007 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.97 |
0.74, 1.26 |
0.8 |
| Â Â Â Â Medicare |
0.63 |
0.46, 0.85 |
0.003 |
| Â Â Â Â Other Governmental |
0.71 |
0.22, 2.03 |
0.5 |
| Â Â Â Â Other |
0.47 |
0.07, 2.18 |
0.4 |
| % Housing with 10 or more units |
1.28 |
0.72, 2.29 |
0.4 |
| % Mobile Homes |
1.29 |
0.68, 2.44 |
0.4 |
| % Homes with more people than rooms |
1.29 |
0.80, 2.10 |
0.3 |
| % Homes with no vehicle |
0.82 |
0.49, 1.37 |
0.4 |
| % People in group quarters |
1.55 |
0.98, 2.44 |
0.059 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_sub_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 2.42127
degrees of freedom = 9
p-value = 0.98293
# C-Statistic/AUROC
Cstat(bio_sub_themes2)
[1] 0.6926186
# Model performance
model_performance(bio_sub_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
2326.278 | 2326.786 | 2449.640 | 0.098 | 0.439 | 1.071 | 0.567 | -242.542 | 4.968e-04 | 0.615
performance::check_model(bio_sub_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(bio_sub_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given MUNIT")

cplot(bio_sub_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given MOBILE")

cplot(bio_sub_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given CROWD")

cplot(bio_sub_themes2, "EPL_NOVEH", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given NOVEH")

cplot(bio_rx_themes2, "EPL_GROUPQ", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given GROUPQ")

Sustained SubQ Biologic Rx + sub-sub themes
bio_subq_themes2 <- glm(bio_subq_3 ~ ibd_3 + age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + act_tob + max_ch + insurance
+ EPL_MUNIT + EPL_MOBILE + EPL_CROWD + EPL_NOVEH
+ EPL_GROUPQ,
family = "binomial",
data = med_data_ALL)
summary(bio_subq_themes2 )
Call:
glm(formula = bio_subq_3 ~ ibd_3 + age_yrs + gender + race_5 +
ethnic_3 + +lang_3 + act_tob + max_ch + insurance + EPL_MUNIT +
EPL_MOBILE + EPL_CROWD + EPL_NOVEH + EPL_GROUPQ, family = "binomial",
data = med_data_ALL)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.2834 -0.7851 -0.5430 -0.2968 2.4752
Coefficients:
Estimate Std. Error
(Intercept) -0.585290 0.608876
ibd_3UC -1.260821 0.124178
ibd_3Unknown -13.487776 309.360022
age_yrs -0.003701 0.003861
genderFemale 0.071637 0.113677
race_5Black -0.058946 0.233290
race_5Asian or Pacific Islander 0.132816 0.533880
race_5American Indian or Alaska Native -1.265941 1.051841
race_5Other -0.393632 0.403738
ethnic_3Non-Hispanic -0.451008 0.439197
lang_3Other 0.158848 0.858353
act_tobYes 0.088703 0.153931
max_ch -0.037783 0.013939
insuranceMedicaid -0.027486 0.147997
insuranceMedicare -0.536694 0.183904
insuranceOther Governmental -1.879047 1.043699
insuranceOther -0.262935 0.840871
EPL_MUNIT 0.653700 0.328104
EPL_MOBILE 0.101208 0.356039
EPL_CROWD 0.215384 0.270169
EPL_NOVEH -0.202512 0.284560
EPL_GROUPQ 0.250249 0.253650
z value Pr(>|z|)
(Intercept) -0.961 0.33642
ibd_3UC -10.153 < 2e-16 ***
ibd_3Unknown -0.044 0.96522
age_yrs -0.959 0.33780
genderFemale 0.630 0.52858
race_5Black -0.253 0.80052
race_5Asian or Pacific Islander 0.249 0.80353
race_5American Indian or Alaska Native -1.204 0.22876
race_5Other -0.975 0.32958
ethnic_3Non-Hispanic -1.027 0.30447
lang_3Other 0.185 0.85318
act_tobYes 0.576 0.56444
max_ch -2.711 0.00671 **
insuranceMedicaid -0.186 0.85266
insuranceMedicare -2.918 0.00352 **
insuranceOther Governmental -1.800 0.07180 .
insuranceOther -0.313 0.75451
EPL_MUNIT 1.992 0.04633 *
EPL_MOBILE 0.284 0.77621
EPL_CROWD 0.797 0.42532
EPL_NOVEH -0.712 0.47667
EPL_GROUPQ 0.987 0.32384
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2151.6 on 2012 degrees of freedom
Residual deviance: 1965.1 on 1991 degrees of freedom
(7260 observations deleted due to missingness)
AIC: 2009.1
Number of Fisher Scoring iterations: 13
broom::glance(bio_subq_themes2 )
broom::tidy(bio_subq_themes2 , exponentiate = TRUE)
tbl_regression(bio_subq_themes2, exponentiate = TRUE)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurred
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.28 |
0.22, 0.36 |
<0.001 |
| Â Â Â Â Unknown |
0.00 |
|
>0.9 |
| Age |
1.00 |
0.99, 1.00 |
0.3 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.07 |
0.86, 1.34 |
0.5 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.94 |
0.59, 1.47 |
0.8 |
| Â Â Â Â Asian or Pacific Islander |
1.14 |
0.36, 3.05 |
0.8 |
| Â Â Â Â American Indian or Alaska Native |
0.28 |
0.02, 1.47 |
0.2 |
| Â Â Â Â Other |
0.67 |
0.29, 1.45 |
0.3 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.64 |
0.27, 1.54 |
0.3 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.17 |
0.16, 5.49 |
0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.09 |
0.80, 1.47 |
0.6 |
| Charlson Comorbidity Index |
0.96 |
0.94, 0.99 |
0.007 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.97 |
0.73, 1.30 |
0.9 |
| Â Â Â Â Medicare |
0.58 |
0.41, 0.83 |
0.004 |
| Â Â Â Â Other Governmental |
0.15 |
0.01, 0.78 |
0.072 |
| Â Â Â Â Other |
0.77 |
0.11, 3.55 |
0.8 |
| % Housing with 10 or more units |
1.92 |
1.01, 3.66 |
0.046 |
| % Mobile Homes |
1.11 |
0.55, 2.23 |
0.8 |
| % Homes with more people than rooms |
1.24 |
0.73, 2.11 |
0.4 |
| % Homes with no vehicle |
0.82 |
0.47, 1.43 |
0.5 |
| % People in group quarters |
1.28 |
0.78, 2.11 |
0.3 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(bio_subq_themes2)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 7.16061
degrees of freedom = 9
p-value = 0.6204
# C-Statistic/AUROC
Cstat(bio_subq_themes2)
[1] 0.7003414
# Model performance
model_performance(bio_subq_themes2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
2009.090 | 2009.599 | 2132.453 | 0.089 | 0.399 | 0.993 | 0.488 | -121.601 | 0.001 | 0.681
performance::check_model(bio_subq_themes2)
Variable `Component` is not in your data frame :/

# Margins
cplot(bio_subq_themes2, "EPL_MUNIT", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given MUNIT")

cplot(bio_subq_themes2, "EPL_MOBILE", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given MOBILE")

cplot(bio_subq_themes2, "EPL_CROWD", what = "prediction", main = "Predicted Likelihood of SubQ Biologic Rx Given CROWD")

cplot(bio_subq_themes2, "SubQ", what = "prediction", main = "Predicted Likelihood of IV Biologic Rx Given NOVEH")
Warning: no non-missing arguments to min; returning InfWarning: no non-missing arguments to max; returning -InfError in seq.default(min(x, na.rm = TRUE), max(x, na.rm = TRUE), length.out = n) :
'from' must be a finite number
LS0tCnRpdGxlOiAiQmlvbG9naWMgTW9kZWxzIgpvdXRwdXQ6IAogIGh0bWxfbm90ZWJvb2s6CiAgIHRoZW1lczogcGFwZXIKICAgdG9jOiB5ZXMKICAgdG9jX2Zsb2F0OiB5ZXMKZWRpdG9yX29wdGlvbnM6IAogIGNodW5rX291dHB1dF90eXBlOiBpbmxpbmUKZGF0ZTogIjIwMjMtMDEtMDgiCi0tLQoKCiMgTG9hZCBQYWNrYWdlcyAKYGBge3J9CmxpYnJhcnkodGlkeXZlcnNlKQpsaWJyYXJ5KGNvZGVib29rcikKbGlicmFyeShzdW1tYXJ5dG9vbHMpCmxpYnJhcnkoYnJvb20pIApsaWJyYXJ5KHBlcmZvcm1hbmNlKQpsaWJyYXJ5KGd0KQpsaWJyYXJ5KGd0c3VtbWFyeSkKbGlicmFyeShqYW5pdG9yKQpsaWJyYXJ5KGZvcmNhdHMpCmxpYnJhcnkobWFyZ2lucykKbGlicmFyeShnZ3Bsb3QyKQpsaWJyYXJ5KGV4cHNzKQpsaWJyYXJ5KGdsbXRvb2xib3gpCmxpYnJhcnkoRGVzY1Rvb2xzKQpgYGAKCiMgSW1wb3J0IERhdGEgCmBgYHtyfQpsb2FkKCJ+L0Rlc2t0b3AvUi1Db2RlL1NET0hfTWVkcy9tZWRfZGF0YV9BTEwucmRhIikKbG9hZCgifi9EZXNrdG9wL1ItQ29kZS9TRE9IX01lZHMvbWVkX2RhdGFfVUMucmRhIikKYGBgCgojIEJhc2VsaW5lIGNoYXJhY3RlcmlzdGljcyB7LnRhYnNldH0gCgojIyBNZWRpY2F0aW9uIFByZXNjcmliZWQgCmBgYHtyfQptZWRfZGF0YV9BTEwgJT4lICAKICBkcGx5c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