Mesalamine (UC only)
Mesalamine Rx + SVI
med_data_UC$ASA_2 <- as.factor(med_data_UC$ASA_2)
ASA_rx <- glm(ASA_2 ~ age_yrs + gender + race_5 + ethnic_3
+ lang_3 + max_ch + act_tob + insurance + RPL_THEMES,
family = "binomial",
data = med_data_UC)
summary(ASA_rx )
Call:
glm(formula = ASA_2 ~ age_yrs + gender + race_5 + ethnic_3 +
lang_3 + max_ch + act_tob + insurance + RPL_THEMES, family = "binomial",
data = med_data_UC)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.2259 -1.2743 0.7518 0.8703 1.7247
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.386306 0.247866 5.593 2.23e-08 ***
age_yrs 0.001314 0.002215 0.593 0.552999
genderFemale -0.101035 0.065452 -1.544 0.122673
race_5Black 0.228241 0.146537 1.558 0.119336
race_5Asian or Pacific Islander 0.821041 0.237077 3.463 0.000534 ***
race_5American Indian or Alaska Native -0.397419 0.474824 -0.837 0.402603
race_5Other -0.107475 0.180002 -0.597 0.550455
ethnic_3Non-Hispanic -0.125822 0.221021 -0.569 0.569169
lang_3Other 0.367150 0.353981 1.037 0.299641
max_ch -0.067191 0.006618 -10.152 < 2e-16 ***
act_tobYes -0.324482 0.113393 -2.862 0.004216 **
insuranceMedicaid -0.316700 0.101938 -3.107 0.001891 **
insuranceMedicare -0.304569 0.097878 -3.112 0.001860 **
insuranceOther Governmental -0.040649 0.381941 -0.106 0.915243
insuranceOther 0.258400 0.517975 0.499 0.617875
RPL_THEMES -0.524245 0.137133 -3.823 0.000132 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 5781.2 on 4559 degrees of freedom
Residual deviance: 5541.8 on 4544 degrees of freedom
(242 observations deleted due to missingness)
AIC: 5573.8
Number of Fisher Scoring iterations: 4
broom::glance(ASA_rx )
broom::tidy(ASA_rx , exponentiate = TRUE)
tbl_regression(ASA_rx, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
1.00 |
1.00, 1.01 |
0.6 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.90 |
0.79, 1.03 |
0.12 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.26 |
0.95, 1.68 |
0.12 |
| Â Â Â Â Asian or Pacific Islander |
2.27 |
1.46, 3.71 |
<0.001 |
| Â Â Â Â American Indian or Alaska Native |
0.67 |
0.27, 1.77 |
0.4 |
| Â Â Â Â Other |
0.90 |
0.63, 1.28 |
0.6 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.88 |
0.57, 1.35 |
0.6 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.44 |
0.74, 2.98 |
0.3 |
| Charlson Comorbidity Index |
0.94 |
0.92, 0.95 |
<0.001 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.72 |
0.58, 0.90 |
0.004 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.73 |
0.60, 0.89 |
0.002 |
| Â Â Â Â Medicare |
0.74 |
0.61, 0.89 |
0.002 |
| Â Â Â Â Other Governmental |
0.96 |
0.46, 2.10 |
>0.9 |
| Â Â Â Â Other |
1.29 |
0.50, 4.00 |
0.6 |
| Social Vulnerability Index |
0.59 |
0.45, 0.77 |
<0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(ASA_rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 12.95482
degrees of freedom = 8
p-value = 0.11341
# C-Statistic/AUROC
Cstat(ASA_rx)
[1] 0.6390181
# Model performance
model_performance(ASA_rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | PCP
-----------------------------------------------------------------------------------------
5573.779 | 5573.899 | 5676.581 | 0.053 | 0.458 | 1.104 | 0.608 | -Inf | 0.581
performance::check_model(ASA_rx)
Variable `Component` is not in your data frame :/

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

Mesalamine Rx + All themes
ASA_Rx_themes <- glm(ASA_2 ~ 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_UC)
summary(ASA_Rx_themes )
Call:
glm(formula = ASA_2 ~ 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_UC)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.1420 -1.2675 0.7463 0.8737 1.7780
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.314900 0.257924 5.098 3.43e-07 ***
age_yrs 0.001609 0.002225 0.723 0.46958
genderFemale -0.098106 0.065734 -1.492 0.13557
race_5Black 0.165467 0.150037 1.103 0.27010
race_5Asian or Pacific Islander 0.697389 0.239934 2.907 0.00365 **
race_5American Indian or Alaska Native -0.409663 0.475486 -0.862 0.38893
race_5Other -0.155211 0.180932 -0.858 0.39098
ethnic_3Non-Hispanic -0.111695 0.221334 -0.505 0.61381
lang_3Other 0.256472 0.356137 0.720 0.47143
act_tobYes -0.323305 0.113966 -2.837 0.00456 **
max_ch -0.067416 0.006656 -10.128 < 2e-16 ***
insuranceMedicaid -0.296540 0.102465 -2.894 0.00380 **
insuranceMedicare -0.290513 0.098371 -2.953 0.00314 **
insuranceOther Governmental 0.003182 0.382884 0.008 0.99337
insuranceOther 0.301596 0.518763 0.581 0.56099
RPL_THEME1 -0.317486 0.190438 -1.667 0.09549 .
RPL_THEME2 -0.398194 0.163522 -2.435 0.01489 *
RPL_THEME3 0.192739 0.120683 1.597 0.11025
RPL_THEME4 0.039974 0.136973 0.292 0.77041
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 5746.8 on 4525 degrees of freedom
Residual deviance: 5496.3 on 4507 degrees of freedom
(276 observations deleted due to missingness)
AIC: 5534.3
Number of Fisher Scoring iterations: 4
broom::glance(ASA_Rx_themes )
broom::tidy(ASA_Rx_themes , exponentiate = TRUE)
tbl_regression(ASA_Rx_themes, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
1.00 |
1.00, 1.01 |
0.5 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.91 |
0.80, 1.03 |
0.14 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.18 |
0.88, 1.59 |
0.3 |
| Â Â Â Â Asian or Pacific Islander |
2.01 |
1.28, 3.29 |
0.004 |
| Â Â Â Â American Indian or Alaska Native |
0.66 |
0.26, 1.75 |
0.4 |
| Â Â Â Â Other |
0.86 |
0.60, 1.23 |
0.4 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.89 |
0.57, 1.37 |
0.6 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.29 |
0.66, 2.68 |
0.5 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.72 |
0.58, 0.91 |
0.005 |
| Charlson Comorbidity Index |
0.93 |
0.92, 0.95 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.74 |
0.61, 0.91 |
0.004 |
| Â Â Â Â Medicare |
0.75 |
0.62, 0.91 |
0.003 |
| Â Â Â Â Other Governmental |
1.00 |
0.48, 2.20 |
>0.9 |
| Â Â Â Â Other |
1.35 |
0.52, 4.18 |
0.6 |
| Socioeconomic Status |
0.73 |
0.50, 1.06 |
0.10 |
| Household Composition |
0.67 |
0.49, 0.92 |
0.015 |
| Minority and Language Status |
1.21 |
0.96, 1.54 |
0.11 |
| Housing and Transportation |
1.04 |
0.80, 1.36 |
0.8 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(ASA_Rx_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 11.20884
degrees of freedom = 8
p-value = 0.19014
# C-Statistic/AUROC
Cstat(ASA_Rx_themes)
[1] 0.6427255
# Model performance
model_performance(ASA_Rx_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | PCP
-----------------------------------------------------------------------------------------
5534.333 | 5534.502 | 5656.268 | 0.055 | 0.457 | 1.104 | 0.607 | -Inf | 0.582
performance::check_model(ASA_Rx_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(ASA_Rx_themes)
Average marginal effects
glm(formula = ASA_2 ~ 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_UC)
cplot(ASA_Rx_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of ASA Rx Given Theme1")

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

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

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

Sustained Mesalamine Access + SVI
med_data_UC$ASA_3 <- as.numeric(med_data_UC$ASA_3)
ASA_access <- glm(ASA_3 ~ age_yrs + gender + race_5 + ethnic_3 +
+ lang_3 + max_ch + act_tob + insurance +
RPL_THEMES,
family = "binomial",
data = med_data_UC)
summary(ASA_access )
Call:
glm(formula = ASA_3 ~ age_yrs + gender + race_5 + ethnic_3 +
+lang_3 + max_ch + act_tob + insurance + RPL_THEMES, family = "binomial",
data = med_data_UC)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.9191 -1.0777 -0.8256 1.2155 1.9748
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.259372 0.226997 1.143 0.253197
age_yrs -0.001918 0.002061 -0.930 0.352205
genderFemale 0.094187 0.061728 1.526 0.127052
race_5Black 0.244579 0.137414 1.780 0.075098 .
race_5Asian or Pacific Islander 0.706490 0.177598 3.978 6.95e-05 ***
race_5American Indian or Alaska Native -0.488446 0.500428 -0.976 0.329037
race_5Other 0.013702 0.170724 0.080 0.936034
ethnic_3Non-Hispanic -0.135729 0.202811 -0.669 0.503341
lang_3Other 0.865830 0.321104 2.696 0.007009 **
max_ch -0.038364 0.006781 -5.657 1.54e-08 ***
act_tobYes -0.300752 0.115376 -2.607 0.009142 **
insuranceMedicaid -0.169786 0.098712 -1.720 0.085429 .
insuranceMedicare -0.446751 0.098777 -4.523 6.10e-06 ***
insuranceOther Governmental -0.470591 0.374869 -1.255 0.209353
insuranceOther -0.118670 0.438042 -0.271 0.786460
RPL_THEMES -0.469132 0.131711 -3.562 0.000368 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 6217.3 on 4559 degrees of freedom
Residual deviance: 6033.3 on 4544 degrees of freedom
(242 observations deleted due to missingness)
AIC: 6065.3
Number of Fisher Scoring iterations: 4
broom::glance(ASA_access )
broom::tidy(ASA_access , exponentiate = TRUE)
tbl_regression(ASA_access, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
1.00 |
0.99, 1.00 |
0.4 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.10 |
0.97, 1.24 |
0.13 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.28 |
0.97, 1.67 |
0.075 |
| Â Â Â Â Asian or Pacific Islander |
2.03 |
1.44, 2.89 |
<0.001 |
| Â Â Â Â American Indian or Alaska Native |
0.61 |
0.21, 1.58 |
0.3 |
| Â Â Â Â Other |
1.01 |
0.72, 1.41 |
>0.9 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.87 |
0.59, 1.30 |
0.5 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
2.38 |
1.28, 4.54 |
0.007 |
| Charlson Comorbidity Index |
0.96 |
0.95, 0.98 |
<0.001 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.74 |
0.59, 0.93 |
0.009 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.84 |
0.69, 1.02 |
0.085 |
| Â Â Â Â Medicare |
0.64 |
0.53, 0.78 |
<0.001 |
| Â Â Â Â Other Governmental |
0.62 |
0.29, 1.28 |
0.2 |
| Â Â Â Â Other |
0.89 |
0.37, 2.10 |
0.8 |
| Social Vulnerability Index |
0.63 |
0.48, 0.81 |
<0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(ASA_access)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 9.07005
degrees of freedom = 8
p-value = 0.33642
# C-Statistic/AUROC
Cstat(ASA_access)
[1] 0.6176656
# Model performance
model_performance(ASA_access)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
6065.349 | 6065.469 | 6168.150 | 0.040 | 0.484 | 1.152 | 0.662 | -Inf | 2.285e-04 | 0.531
performance::check_model(ASA_access)
Variable `Component` is not in your data frame :/

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

Sustained Mesalamine Access + All Themes
ASA_acc_themes <- glm(ASA_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_UC)
summary(ASA_acc_themes )
Call:
glm(formula = ASA_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_UC)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7999 -1.0565 -0.8084 1.2082 2.1063
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.112381 0.238138 0.472 0.63699
age_yrs -0.001448 0.002080 -0.696 0.48637
genderFemale 0.088157 0.062225 1.417 0.15655
race_5Black 0.159587 0.141074 1.131 0.25796
race_5Asian or Pacific Islander 0.518317 0.181086 2.862 0.00421 **
race_5American Indian or Alaska Native -0.506819 0.502259 -1.009 0.31294
race_5Other -0.061392 0.172046 -0.357 0.72121
ethnic_3Non-Hispanic -0.111515 0.204036 -0.547 0.58469
lang_3Other 0.720286 0.323931 2.224 0.02618 *
act_tobYes -0.281125 0.116367 -2.416 0.01570 *
max_ch -0.037556 0.006842 -5.489 4.03e-08 ***
insuranceMedicaid -0.140188 0.099501 -1.409 0.15886
insuranceMedicare -0.448704 0.099883 -4.492 7.05e-06 ***
insuranceOther Governmental -0.415049 0.377289 -1.100 0.27130
insuranceOther -0.061736 0.439861 -0.140 0.88838
RPL_THEME1 -0.403264 0.182197 -2.213 0.02687 *
RPL_THEME2 -0.485771 0.155463 -3.125 0.00178 **
RPL_THEME3 0.362998 0.114355 3.174 0.00150 **
RPL_THEME4 0.173322 0.130050 1.333 0.18262
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 6168.1 on 4525 degrees of freedom
Residual deviance: 5952.0 on 4507 degrees of freedom
(276 observations deleted due to missingness)
AIC: 5990
Number of Fisher Scoring iterations: 4
broom::glance(ASA_acc_themes )
broom::tidy(ASA_acc_themes , exponentiate = TRUE)
tbl_regression(ASA_acc_themes, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
1.00 |
0.99, 1.00 |
0.5 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.09 |
0.97, 1.23 |
0.2 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.17 |
0.89, 1.55 |
0.3 |
| Â Â Â Â Asian or Pacific Islander |
1.68 |
1.18, 2.41 |
0.004 |
| Â Â Â Â American Indian or Alaska Native |
0.60 |
0.21, 1.55 |
0.3 |
| Â Â Â Â Other |
0.94 |
0.67, 1.32 |
0.7 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.89 |
0.60, 1.34 |
0.6 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
2.06 |
1.10, 3.94 |
0.026 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.75 |
0.60, 0.95 |
0.016 |
| Charlson Comorbidity Index |
0.96 |
0.95, 0.98 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.87 |
0.71, 1.06 |
0.2 |
| Â Â Â Â Medicare |
0.64 |
0.52, 0.78 |
<0.001 |
| Â Â Â Â Other Governmental |
0.66 |
0.31, 1.36 |
0.3 |
| Â Â Â Â Other |
0.94 |
0.39, 2.23 |
0.9 |
| Socioeconomic Status |
0.67 |
0.47, 0.95 |
0.027 |
| Household Composition |
0.62 |
0.45, 0.83 |
0.002 |
| Minority and Language Status |
1.44 |
1.15, 1.80 |
0.002 |
| Housing and Transportation |
1.19 |
0.92, 1.53 |
0.2 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(ASA_acc_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 14.25546
degrees of freedom = 8
p-value = 0.075345
# C-Statistic/AUROC
Cstat(ASA_acc_themes)
[1] 0.628247
# Model performance
model_performance(ASA_acc_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
5989.960 | 5990.128 | 6111.894 | 0.047 | 0.482 | 1.149 | 0.658 | -Inf | 2.209e-04 | 0.535
performance::check_model(ASA_acc_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(ASA_acc_themes)
Average marginal effects
glm(formula = ASA_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_UC)
cplot(ASA_acc_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of ASA Access Given Theme1")

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

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

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

Small Molecules (UC Only)
Small Molecules Rx + SVI
med_data_UC$small_2 <- as.factor(med_data_UC$small_2)
small_rx <- glm(small_2 ~ age_yrs + gender + race_5 + ethnic_3
+ lang_3 + max_ch + act_tob + insurance + RPL_THEMES,
family = "binomial",
data = med_data_UC)
summary(small_rx )
Call:
glm(formula = small_2 ~ age_yrs + gender + race_5 + ethnic_3 +
lang_3 + max_ch + act_tob + insurance + RPL_THEMES, family = "binomial",
data = med_data_UC)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.5695 -0.3687 -0.3302 -0.2547 2.9283
Coefficients:
Estimate Std. Error z value
(Intercept) -2.439e+00 5.003e-01 -4.875
age_yrs -5.213e-03 4.401e-03 -1.185
genderFemale -3.595e-01 1.337e-01 -2.688
race_5Black 1.338e-01 2.858e-01 0.468
race_5Asian or Pacific Islander -5.359e-01 4.299e-01 -1.247
race_5American Indian or Alaska Native -5.894e-02 1.035e+00 -0.057
race_5Other -5.576e-02 3.627e-01 -0.154
ethnic_3Non-Hispanic 2.227e-01 4.552e-01 0.489
lang_3Other 2.815e-01 6.403e-01 0.440
max_ch -2.948e-02 1.662e-02 -1.774
act_tobYes -4.330e-01 2.780e-01 -1.558
insuranceMedicaid 8.837e-02 1.989e-01 0.444
insuranceMedicare -7.846e-01 2.717e-01 -2.888
insuranceOther Governmental 4.937e-02 7.422e-01 0.067
insuranceOther -1.277e+01 3.090e+02 -0.041
RPL_THEMES -7.025e-04 2.834e-01 -0.002
Pr(>|z|)
(Intercept) 1.09e-06 ***
age_yrs 0.23619
genderFemale 0.00719 **
race_5Black 0.63968
race_5Asian or Pacific Islander 0.21256
race_5American Indian or Alaska Native 0.95460
race_5Other 0.87780
ethnic_3Non-Hispanic 0.62477
lang_3Other 0.66016
max_ch 0.07604 .
act_tobYes 0.11926
insuranceMedicaid 0.65681
insuranceMedicare 0.00388 **
insuranceOther Governmental 0.94697
insuranceOther 0.96703
RPL_THEMES 0.99802
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1886.2 on 4559 degrees of freedom
Residual deviance: 1839.9 on 4544 degrees of freedom
(242 observations deleted due to missingness)
AIC: 1871.9
Number of Fisher Scoring iterations: 14
broom::glance(small_rx )
broom::tidy(small_rx , exponentiate = TRUE)
tbl_regression(small_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 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: 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 |
| Age |
1.0 |
0.99, 1.00 |
0.2 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.70 |
0.54, 0.91 |
0.007 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.14 |
0.63, 1.94 |
0.6 |
| Â Â Â Â Asian or Pacific Islander |
0.59 |
0.22, 1.25 |
0.2 |
| Â Â Â Â American Indian or Alaska Native |
0.94 |
0.05, 4.67 |
>0.9 |
| Â Â Â Â Other |
0.95 |
0.44, 1.83 |
0.9 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.25 |
0.55, 3.39 |
0.6 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.33 |
0.30, 4.04 |
0.7 |
| Charlson Comorbidity Index |
0.97 |
0.94, 1.00 |
0.076 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.65 |
0.36, 1.08 |
0.12 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.09 |
0.73, 1.60 |
0.7 |
| Â Â Â Â Medicare |
0.46 |
0.26, 0.76 |
0.004 |
| Â Â Â Â Other Governmental |
1.05 |
0.17, 3.58 |
>0.9 |
| Â Â Â Â Other |
0.00 |
|
>0.9 |
| Social Vulnerability Index |
1.00 |
0.57, 1.73 |
>0.9 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(small_rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 5.65275
degrees of freedom = 8
p-value = 0.68606
# C-Statistic/AUROC
Cstat(small_rx)
[1] 0.6229735
# Model performance
model_performance(small_rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
1871.854 | 1871.973 | 1974.655 | 0.009 | 0.223 | 0.636 | 0.202 | -13.006 | 0.002 | 0.901
performance::check_model(small_rx)
Variable `Component` is not in your data frame :/

# Margins
margins(small_rx)
Average marginal effects
glm(formula = small_2 ~ age_yrs + gender + race_5 + ethnic_3 + lang_3 + max_ch + act_tob + insurance + RPL_THEMES, family = "binomial", data = med_data_UC)
cplot(small_rx, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Small Molecule Rx Given SVI")

Small Molecules Rx + All themes
small_Rx_themes <- glm(small_2 ~ 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_UC)
summary(small_Rx_themes )
Call:
glm(formula = small_2 ~ 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_UC)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.5885 -0.3701 -0.3260 -0.2509 2.9280
Coefficients:
Estimate Std. Error z value
(Intercept) -2.641664 0.553268 -4.775
age_yrs -0.005200 0.004436 -1.172
genderFemale -0.356670 0.134574 -2.650
race_5Black 0.137079 0.292435 0.469
race_5Asian or Pacific Islander -0.508217 0.437037 -1.163
race_5American Indian or Alaska Native -0.002653 1.036513 -0.003
race_5Other -0.131186 0.378533 -0.347
ethnic_3Non-Hispanic 0.375945 0.490993 0.766
lang_3Other 0.432290 0.644621 0.671
act_tobYes -0.507097 0.286859 -1.768
max_ch -0.031698 0.016844 -1.882
insuranceMedicaid 0.111792 0.200213 0.558
insuranceMedicare -0.780028 0.272184 -2.866
insuranceOther Governmental 0.096381 0.742247 0.130
insuranceOther -12.776429 308.671809 -0.041
RPL_THEME1 -0.229600 0.398317 -0.576
RPL_THEME2 0.481430 0.338822 1.421
RPL_THEME3 0.044365 0.248036 0.179
RPL_THEME4 -0.180081 0.283431 -0.635
Pr(>|z|)
(Intercept) 1.8e-06 ***
age_yrs 0.24102
genderFemale 0.00804 **
race_5Black 0.63925
race_5Asian or Pacific Islander 0.24488
race_5American Indian or Alaska Native 0.99796
race_5Other 0.72892
ethnic_3Non-Hispanic 0.44387
lang_3Other 0.50247
act_tobYes 0.07710 .
max_ch 0.05986 .
insuranceMedicaid 0.57660
insuranceMedicare 0.00416 **
insuranceOther Governmental 0.89669
insuranceOther 0.96698
RPL_THEME1 0.56433
RPL_THEME2 0.15535
RPL_THEME3 0.85804
RPL_THEME4 0.52519
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1865.2 on 4525 degrees of freedom
Residual deviance: 1816.0 on 4507 degrees of freedom
(276 observations deleted due to missingness)
AIC: 1854
Number of Fisher Scoring iterations: 14
broom::glance(small_Rx_themes )
broom::tidy(small_Rx_themes , exponentiate = TRUE)
tbl_regression(small_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 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: 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 |
| Age |
1.0 |
0.99, 1.00 |
0.2 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.70 |
0.54, 0.91 |
0.008 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.15 |
0.62, 1.98 |
0.6 |
| Â Â Â Â Asian or Pacific Islander |
0.60 |
0.23, 1.31 |
0.2 |
| Â Â Â Â American Indian or Alaska Native |
1.00 |
0.05, 4.97 |
>0.9 |
| Â Â Â Â Other |
0.88 |
0.39, 1.74 |
0.7 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.46 |
0.61, 4.35 |
0.4 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.54 |
0.35, 4.76 |
0.5 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.60 |
0.33, 1.02 |
0.077 |
| Charlson Comorbidity Index |
0.97 |
0.94, 1.00 |
0.060 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.12 |
0.75, 1.64 |
0.6 |
| Â Â Â Â Medicare |
0.46 |
0.26, 0.77 |
0.004 |
| Â Â Â Â Other Governmental |
1.10 |
0.18, 3.76 |
0.9 |
| Â Â Â Â Other |
0.00 |
|
>0.9 |
| Socioeconomic Status |
0.79 |
0.36, 1.72 |
0.6 |
| Household Composition |
1.62 |
0.83, 3.15 |
0.2 |
| Minority and Language Status |
1.05 |
0.64, 1.70 |
0.9 |
| Housing and Transportation |
0.84 |
0.48, 1.45 |
0.5 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(small_Rx_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 15.74704
degrees of freedom = 8
p-value = 0.046147
# C-Statistic/AUROC
Cstat(small_Rx_themes)
[1] 0.6277554
# Model performance
model_performance(small_Rx_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
1854.018 | 1854.187 | 1975.952 | 0.010 | 0.222 | 0.635 | 0.201 | -12.781 | 0.002 | 0.901
performance::check_model(small_Rx_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(small_Rx_themes)
Average marginal effects
glm(formula = small_2 ~ 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_UC)
cplot(small_Rx_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Small Molecule Rx Given Theme1")

cplot(small_Rx_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Small Molecule Rx Given Theme2")

cplot(small_Rx_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Small Molecule Rx Given Theme3")

cplot(small_Rx_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Small Molecule Rx Given Theme4")

Sustained Small Molecules Access + SVI
med_data_UC$small_3 <- as.factor(med_data_UC$small_3)
small_access <- glm(small_3 ~ age_yrs + gender + race_5 + ethnic_3
+ lang_3 + max_ch + act_tob + insurance + RPL_THEMES,
family = "binomial",
data = med_data_UC)
summary(small_access )
Call:
glm(formula = small_3 ~ age_yrs + gender + race_5 + ethnic_3 +
lang_3 + max_ch + act_tob + insurance + RPL_THEMES, family = "binomial",
data = med_data_UC)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.4668 -0.2763 -0.2370 -0.1730 3.3521
Coefficients:
Estimate Std. Error z value
(Intercept) -3.045236 0.798562 -3.813
age_yrs -0.007233 0.005966 -1.212
genderFemale -0.395803 0.182128 -2.173
race_5Black 0.487485 0.366021 1.332
race_5Asian or Pacific Islander -0.294768 0.527159 -0.559
race_5American Indian or Alaska Native -12.947216 541.071423 -0.024
race_5Other -0.141718 0.543152 -0.261
ethnic_3Non-Hispanic 0.544445 0.751847 0.724
lang_3Other 0.105616 1.057779 0.100
max_ch -0.026046 0.023343 -1.116
act_tobYes 0.063428 0.328441 0.193
insuranceMedicaid -0.250946 0.296065 -0.848
insuranceMedicare -1.489704 0.487175 -3.058
insuranceOther Governmental -0.006069 1.027407 -0.006
insuranceOther -13.159830 508.332990 -0.026
RPL_THEMES -0.805891 0.408671 -1.972
Pr(>|z|)
(Intercept) 0.000137 ***
age_yrs 0.225355
genderFemale 0.029764 *
race_5Black 0.182910
race_5Asian or Pacific Islander 0.576050
race_5American Indian or Alaska Native 0.980909
race_5Other 0.794156
ethnic_3Non-Hispanic 0.468977
lang_3Other 0.920466
max_ch 0.264494
act_tobYes 0.846866
insuranceMedicaid 0.396658
insuranceMedicare 0.002229 **
insuranceOther Governmental 0.995287
insuranceOther 0.979347
RPL_THEMES 0.048612 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1160.0 on 4559 degrees of freedom
Residual deviance: 1114.6 on 4544 degrees of freedom
(242 observations deleted due to missingness)
AIC: 1146.6
Number of Fisher Scoring iterations: 15
broom::glance(small_access )
broom::tidy(small_access , exponentiate = TRUE)
tbl_regression(small_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 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 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 occurred
| Characteristic |
OR |
95% CI |
p-value |
| Age |
0.99 |
0.98, 1.00 |
0.2 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.67 |
0.47, 0.96 |
0.030 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.63 |
0.74, 3.17 |
0.2 |
| Â Â Â Â Asian or Pacific Islander |
0.74 |
0.22, 1.85 |
0.6 |
| Â Â Â Â American Indian or Alaska Native |
0.00 |
0.00, 54.9 |
>0.9 |
| Â Â Â Â Other |
0.87 |
0.25, 2.23 |
0.8 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.72 |
0.50, 11.0 |
0.5 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.11 |
0.06, 5.88 |
>0.9 |
| Charlson Comorbidity Index |
0.97 |
0.93, 1.02 |
0.3 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.07 |
0.53, 1.94 |
0.8 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.78 |
0.42, 1.35 |
0.4 |
| Â Â Â Â Medicare |
0.23 |
0.08, 0.54 |
0.002 |
| Â Â Â Â Other Governmental |
0.99 |
0.06, 4.79 |
>0.9 |
| Â Â Â Â Other |
0.00 |
|
>0.9 |
| Social Vulnerability Index |
0.45 |
0.20, 0.98 |
0.049 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(small_access)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 5.15591
degrees of freedom = 8
p-value = 0.74079
# C-Statistic/AUROC
Cstat(small_access)
[1] 0.6670941
# Model performance
model_performance(small_access)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
1146.560 | 1146.679 | 1249.361 | 0.009 | 0.164 | 0.495 | 0.122 | -3.562 | 0.008 | 0.946
performance::check_model(small_access)
Variable `Component` is not in your data frame :/

# Margins
margins(small_access)
Average marginal effects
glm(formula = small_3 ~ age_yrs + gender + race_5 + ethnic_3 + lang_3 + max_ch + act_tob + insurance + RPL_THEMES, family = "binomial", data = med_data_UC)
cplot(small_access, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Small Molecule Rx Given SVI")

Sustained Small Molecules Access + All Themes
small_acc_themes <- glm(small_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_UC)
summary(small_acc_themes )
Call:
glm(formula = small_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_UC)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.4708 -0.2758 -0.2362 -0.1713 3.3227
Coefficients:
Estimate Std. Error z value
(Intercept) -2.994975 0.821950 -3.644
age_yrs -0.006816 0.005996 -1.137
genderFemale -0.385696 0.182730 -2.111
race_5Black 0.475128 0.374764 1.268
race_5Asian or Pacific Islander -0.306878 0.536530 -0.572
race_5American Indian or Alaska Native -12.910108 541.206537 -0.024
race_5Other -0.152759 0.543384 -0.281
ethnic_3Non-Hispanic 0.524482 0.750000 0.699
lang_3Other 0.133475 1.062098 0.126
act_tobYes -0.034368 0.342475 -0.100
max_ch -0.026963 0.023498 -1.147
insuranceMedicaid -0.225921 0.297435 -0.760
insuranceMedicare -1.496990 0.487372 -3.072
insuranceOther Governmental 0.030702 1.029203 0.030
insuranceOther -13.169805 508.472532 -0.026
RPL_THEME1 -0.639453 0.562499 -1.137
RPL_THEME2 0.150422 0.474619 0.317
RPL_THEME3 -0.025589 0.337020 -0.076
RPL_THEME4 -0.384550 0.391819 -0.981
Pr(>|z|)
(Intercept) 0.000269 ***
age_yrs 0.255634
genderFemale 0.034794 *
race_5Black 0.204867
race_5Asian or Pacific Islander 0.567344
race_5American Indian or Alaska Native 0.980969
race_5Other 0.778614
ethnic_3Non-Hispanic 0.484358
lang_3Other 0.899993
act_tobYes 0.920065
max_ch 0.251192
insuranceMedicaid 0.447516
insuranceMedicare 0.002129 **
insuranceOther Governmental 0.976202
insuranceOther 0.979337
RPL_THEME1 0.255619
RPL_THEME2 0.751296
RPL_THEME3 0.939478
RPL_THEME4 0.326372
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1150.9 on 4525 degrees of freedom
Residual deviance: 1105.7 on 4507 degrees of freedom
(276 observations deleted due to missingness)
AIC: 1143.7
Number of Fisher Scoring iterations: 15
broom::glance(small_acc_themes )
broom::tidy(small_acc_themes , exponentiate = TRUE)
tbl_regression(small_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: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 0 or 1 occurredWarning: glm.fit: fitted probabilities numerically 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 |
| Age |
0.99 |
0.98, 1.00 |
0.3 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.68 |
0.47, 0.97 |
0.035 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.61 |
0.72, 3.19 |
0.2 |
| Â Â Â Â Asian or Pacific Islander |
0.74 |
0.22, 1.87 |
0.6 |
| Â Â Â Â American Indian or Alaska Native |
0.00 |
0.00, 65.0 |
>0.9 |
| Â Â Â Â Other |
0.86 |
0.25, 2.21 |
0.8 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.69 |
0.49, 10.7 |
0.5 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.14 |
0.06, 6.13 |
0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
0.97 |
0.46, 1.80 |
>0.9 |
| Charlson Comorbidity Index |
0.97 |
0.93, 1.02 |
0.3 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.80 |
0.43, 1.39 |
0.4 |
| Â Â Â Â Medicare |
0.22 |
0.08, 0.53 |
0.002 |
| Â Â Â Â Other Governmental |
1.03 |
0.06, 5.00 |
>0.9 |
| Â Â Â Â Other |
0.00 |
|
>0.9 |
| Socioeconomic Status |
0.53 |
0.17, 1.56 |
0.3 |
| Household Composition |
1.16 |
0.46, 2.95 |
0.8 |
| Minority and Language Status |
0.97 |
0.50, 1.89 |
>0.9 |
| Housing and Transportation |
0.68 |
0.31, 1.46 |
0.3 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(small_acc_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 2.86557
degrees of freedom = 8
p-value = 0.94251
# C-Statistic/AUROC
Cstat(small_acc_themes)
[1] 0.6683856
# Model performance
model_performance(small_acc_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
-----------------------------------------------------------------------------------------------------------
1143.718 | 1143.887 | 1265.652 | 0.009 | 0.164 | 0.495 | 0.122 | -3.533 | 0.008 | 0.946
performance::check_model(small_acc_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(small_acc_themes)
Average marginal effects
glm(formula = small_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_UC)
cplot(small_acc_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Small Molecule Rx Given Theme1")

cplot(small_acc_themes, "RPL_THEME2", what = "prediction", main = "Predicted Likelihood of Small Molecule Rx Given Theme2")

cplot(small_acc_themes, "RPL_THEME3", what = "prediction", main = "Predicted Likelihood of Small Molecule Rx Given Theme3")

cplot(small_acc_themes, "RPL_THEME4", what = "prediction", main = "Predicted Likelihood of Small Molecule Rx Given Theme4")

Immunomodulators
Immunomodulators Rx + SVI
med_data_ALL$immuno_2 <- as.numeric(med_data_ALL$immuno_2)
imm_rx <- glm(immuno_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(imm_rx )
Call:
glm(formula = immuno_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
-1.5038 -0.9751 -0.7445 1.2011 2.0624
Coefficients:
Estimate Std. Error z value
(Intercept) 0.622252 0.176882 3.518
ibd_3UC -0.686004 0.044917 -15.273
ibd_3IC -11.220139 112.814667 -0.099
ibd_3Unknown -1.231920 0.398982 -3.088
age_yrs -0.015201 0.001479 -10.278
genderFemale -0.129326 0.044302 -2.919
race_5Black -0.260499 0.091546 -2.846
race_5Asian or Pacific Islander -0.143407 0.144107 -0.995
race_5American Indian or Alaska Native 0.323836 0.347522 0.932
race_5Other -0.265926 0.136886 -1.943
ethnic_3Non-Hispanic -0.021648 0.162705 -0.133
lang_3Other -0.236288 0.253835 -0.931
max_ch -0.019532 0.005179 -3.771
act_tobYes 0.024085 0.069265 0.348
insuranceMedicaid -0.032363 0.064914 -0.499
insuranceMedicare 0.020273 0.071383 0.284
insuranceOther Governmental -0.285794 0.274650 -1.041
insuranceOther -0.031590 0.326542 -0.097
RPL_THEMES 0.345150 0.091358 3.778
Pr(>|z|)
(Intercept) 0.000435 ***
ibd_3UC < 2e-16 ***
ibd_3IC 0.920776
ibd_3Unknown 0.002017 **
age_yrs < 2e-16 ***
genderFemale 0.003510 **
race_5Black 0.004434 **
race_5Asian or Pacific Islander 0.319669
race_5American Indian or Alaska Native 0.351418
race_5Other 0.052054 .
ethnic_3Non-Hispanic 0.894152
lang_3Other 0.351920
max_ch 0.000162 ***
act_tobYes 0.728050
insuranceMedicaid 0.618096
insuranceMedicare 0.776407
insuranceOther Governmental 0.298073
insuranceOther 0.922933
RPL_THEMES 0.000158 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12423 on 9335 degrees of freedom
Residual deviance: 11820 on 9317 degrees of freedom
(458 observations deleted due to missingness)
AIC: 11858
Number of Fisher Scoring iterations: 10
broom::glance(imm_rx )
broom::tidy(imm_rx , exponentiate = TRUE)
tbl_regression(imm_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.50 |
0.46, 0.55 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.29 |
0.12, 0.61 |
0.002 |
| Age |
0.98 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.88 |
0.81, 0.96 |
0.004 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.77 |
0.64, 0.92 |
0.004 |
| Â Â Â Â Asian or Pacific Islander |
0.87 |
0.65, 1.15 |
0.3 |
| Â Â Â Â American Indian or Alaska Native |
1.38 |
0.69, 2.73 |
0.4 |
| Â Â Â Â Other |
0.77 |
0.58, 1.00 |
0.052 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.98 |
0.71, 1.35 |
0.9 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.79 |
0.47, 1.28 |
0.4 |
| Charlson Comorbidity Index |
0.98 |
0.97, 0.99 |
<0.001 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.02 |
0.89, 1.17 |
0.7 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.97 |
0.85, 1.10 |
0.6 |
| Â Â Â Â Medicare |
1.02 |
0.89, 1.17 |
0.8 |
| Â Â Â Â Other Governmental |
0.75 |
0.43, 1.27 |
0.3 |
| Â Â Â Â Other |
0.97 |
0.50, 1.82 |
>0.9 |
| Social Vulnerability Index |
1.41 |
1.18, 1.69 |
<0.001 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(imm_rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 15.20716
degrees of freedom = 8
p-value = 0.05524
# C-Statistic/AUROC
Cstat(imm_rx)
[1] 0.649999
# Model performance
model_performance(imm_rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
11858.092 | 11858.173 | 11993.783 | 0.063 | 0.470 | 1.126 | 0.633 | -Inf | 1.855e-04 | 0.557
performance::check_model(imm_rx)
Variable `Component` is not in your data frame :/

# Margins
margins(imm_rx)
Average marginal effects
glm(formula = immuno_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(imm_rx, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Immunomodulator Rx Given SVI")

Immunomodulators Rx + All themes
imm_Rx_themes <- glm(immuno_2 ~ 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(imm_Rx_themes )
Call:
glm(formula = immuno_2 ~ 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.4687 -0.9960 -0.8045 1.2586 2.0038
Coefficients:
Estimate Std. Error z value
(Intercept) 0.323889 0.180765 1.792
age_yrs -0.017596 0.001462 -12.034
genderFemale -0.129986 0.043864 -2.963
race_5Black -0.242459 0.092240 -2.629
race_5Asian or Pacific Islander -0.174085 0.144182 -1.207
race_5American Indian or Alaska Native 0.288297 0.347504 0.830
race_5Other -0.315721 0.136292 -2.317
ethnic_3Non-Hispanic 0.045657 0.161240 0.283
lang_3Other -0.234306 0.252404 -0.928
act_tobYes 0.082955 0.068554 1.210
max_ch -0.020409 0.005131 -3.978
insuranceMedicaid -0.037799 0.064507 -0.586
insuranceMedicare 0.063899 0.070710 0.904
insuranceOther Governmental -0.279131 0.271038 -1.030
insuranceOther -0.101370 0.320826 -0.316
RPL_THEME1 0.528763 0.127303 4.154
RPL_THEME2 0.194410 0.109439 1.776
RPL_THEME3 -0.045491 0.080476 -0.565
RPL_THEME4 -0.217720 0.091936 -2.368
Pr(>|z|)
(Intercept) 0.07317 .
age_yrs < 2e-16 ***
genderFemale 0.00304 **
race_5Black 0.00857 **
race_5Asian or Pacific Islander 0.22728
race_5American Indian or Alaska Native 0.40675
race_5Other 0.02053 *
ethnic_3Non-Hispanic 0.77706
lang_3Other 0.35325
act_tobYes 0.22625
max_ch 6.96e-05 ***
insuranceMedicaid 0.55789
insuranceMedicare 0.36616
insuranceOther Governmental 0.30308
insuranceOther 0.75203
RPL_THEME1 3.27e-05 ***
RPL_THEME2 0.07566 .
RPL_THEME3 0.57189
RPL_THEME4 0.01788 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12357 on 9280 degrees of freedom
Residual deviance: 11983 on 9262 degrees of freedom
(513 observations deleted due to missingness)
AIC: 12021
Number of Fisher Scoring iterations: 4
broom::glance(imm_Rx_themes )
broom::tidy(imm_Rx_themes , exponentiate = TRUE)
tbl_regression(imm_Rx_themes, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
0.98 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.88 |
0.81, 0.96 |
0.003 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.78 |
0.65, 0.94 |
0.009 |
| Â Â Â Â Asian or Pacific Islander |
0.84 |
0.63, 1.11 |
0.2 |
| Â Â Â Â American Indian or Alaska Native |
1.33 |
0.67, 2.64 |
0.4 |
| Â Â Â Â Other |
0.73 |
0.56, 0.95 |
0.021 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
1.05 |
0.76, 1.44 |
0.8 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.79 |
0.48, 1.28 |
0.4 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.09 |
0.95, 1.24 |
0.2 |
| Charlson Comorbidity Index |
0.98 |
0.97, 0.99 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.96 |
0.85, 1.09 |
0.6 |
| Â Â Â Â Medicare |
1.07 |
0.93, 1.22 |
0.4 |
| Â Â Â Â Other Governmental |
0.76 |
0.44, 1.27 |
0.3 |
| Â Â Â Â Other |
0.90 |
0.47, 1.68 |
0.8 |
| Socioeconomic Status |
1.70 |
1.32, 2.18 |
<0.001 |
| Household Composition |
1.21 |
0.98, 1.51 |
0.076 |
| Minority and Language Status |
0.96 |
0.82, 1.12 |
0.6 |
| Housing and Transportation |
0.80 |
0.67, 0.96 |
0.018 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(imm_Rx_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 12.78579
degrees of freedom = 8
p-value = 0.11944
# C-Statistic/AUROC
Cstat(imm_Rx_themes)
[1] 0.6192247
# Model performance
model_performance(imm_Rx_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | PCP
--------------------------------------------------------------------------------------------
12021.429 | 12021.511 | 12157.008 | 0.040 | 0.477 | 1.137 | 0.646 | -Inf | 0.546
performance::check_model(imm_Rx_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(imm_Rx_themes)
Average marginal effects
glm(formula = immuno_2 ~ 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(imm_Rx_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Immuno Rx Given Theme1")

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

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

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

Sustained Immunomodulator Access + SVI
med_data_ALL$immuno_3 <- as.numeric(med_data_ALL$immuno_3)
imm_access <- glm(immuno_3 ~ 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(imm_access )
Call:
glm(formula = immuno_3 ~ 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
-1.2550 -0.8073 -0.6435 1.2354 2.3766
Coefficients:
Estimate Std. Error z value
(Intercept) 0.341096 0.189588 1.799
ibd_3UC -0.652533 0.050151 -13.011
ibd_3IC -10.557553 113.335798 -0.093
ibd_3Unknown -1.416679 0.530679 -2.670
age_yrs -0.017993 0.001638 -10.984
genderFemale -0.175137 0.048738 -3.593
race_5Black -0.131025 0.099993 -1.310
race_5Asian or Pacific Islander -0.220143 0.162591 -1.354
race_5American Indian or Alaska Native 0.312780 0.372431 0.840
race_5Other -0.291422 0.154173 -1.890
ethnic_3Non-Hispanic -0.156306 0.174555 -0.895
lang_3Other 0.047834 0.277195 0.173
max_ch -0.009533 0.005898 -1.616
act_tobYes 0.039279 0.075411 0.521
insuranceMedicaid -0.131306 0.070890 -1.852
insuranceMedicare -0.041462 0.081956 -0.506
insuranceOther Governmental -0.404233 0.319441 -1.265
insuranceOther -0.032835 0.360455 -0.091
RPL_THEMES 0.161587 0.100494 1.608
Pr(>|z|)
(Intercept) 0.071995 .
ibd_3UC < 2e-16 ***
ibd_3IC 0.925782
ibd_3Unknown 0.007595 **
age_yrs < 2e-16 ***
genderFemale 0.000326 ***
race_5Black 0.190079
race_5Asian or Pacific Islander 0.175747
race_5American Indian or Alaska Native 0.401002
race_5Other 0.058728 .
ethnic_3Non-Hispanic 0.370546
lang_3Other 0.862994
max_ch 0.106054
act_tobYes 0.602461
insuranceMedicaid 0.063989 .
insuranceMedicare 0.612922
insuranceOther Governmental 0.205714
insuranceOther 0.927419
RPL_THEMES 0.107851
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 10704 on 9335 degrees of freedom
Residual deviance: 10201 on 9317 degrees of freedom
(458 observations deleted due to missingness)
AIC: 10239
Number of Fisher Scoring iterations: 10
broom::glance(imm_access )
broom::tidy(imm_access , exponentiate = TRUE)
tbl_regression(imm_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.52 |
0.47, 0.57 |
<0.001 |
| Â Â Â Â IC |
0.00 |
|
>0.9 |
| Â Â Â Â Unknown |
0.24 |
0.07, 0.61 |
0.008 |
| Age |
0.98 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.84 |
0.76, 0.92 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.88 |
0.72, 1.06 |
0.2 |
| Â Â Â Â Asian or Pacific Islander |
0.80 |
0.58, 1.10 |
0.2 |
| Â Â Â Â American Indian or Alaska Native |
1.37 |
0.63, 2.77 |
0.4 |
| Â Â Â Â Other |
0.75 |
0.55, 1.00 |
0.059 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.86 |
0.61, 1.21 |
0.4 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
1.05 |
0.59, 1.77 |
0.9 |
| Charlson Comorbidity Index |
0.99 |
0.98, 1.00 |
0.11 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.04 |
0.90, 1.20 |
0.6 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.88 |
0.76, 1.01 |
0.064 |
| Â Â Â Â Medicare |
0.96 |
0.82, 1.13 |
0.6 |
| Â Â Â Â Other Governmental |
0.67 |
0.34, 1.21 |
0.2 |
| Â Â Â Â Other |
0.97 |
0.46, 1.90 |
>0.9 |
| Social Vulnerability Index |
1.18 |
0.96, 1.43 |
0.11 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(imm_access)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 13.51309
degrees of freedom = 8
p-value = 0.095373
# C-Statistic/AUROC
Cstat(imm_access)
[1] 0.6515668
# Model performance
model_performance(imm_access)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
10239.379 | 10239.460 | 10375.070 | 0.053 | 0.427 | 1.046 | 0.546 | -Inf | 1.855e-04 | 0.635
performance::check_model(imm_access)
Variable `Component` is not in your data frame :/

# Margins
margins(imm_access)
Average marginal effects
glm(formula = immuno_3 ~ 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(imm_access, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Immunomodulator Rx Given SVI")

Sustained Immunomodulator Access + All Themes
imm_acc_themes <- glm(immuno_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(imm_acc_themes )
Call:
glm(formula = immuno_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.2313 -0.8192 -0.6702 1.3197 2.2277
Coefficients:
Estimate Std. Error z value
(Intercept) 0.031676 0.194915 0.163
age_yrs -0.020169 0.001624 -12.416
genderFemale -0.177378 0.048378 -3.667
race_5Black -0.143287 0.100835 -1.421
race_5Asian or Pacific Islander -0.312114 0.162656 -1.919
race_5American Indian or Alaska Native 0.260625 0.372783 0.699
race_5Other -0.376291 0.154049 -2.443
ethnic_3Non-Hispanic -0.071914 0.173521 -0.414
lang_3Other -0.009983 0.275997 -0.036
act_tobYes 0.097525 0.074931 1.302
max_ch -0.010346 0.005853 -1.767
insuranceMedicaid -0.122367 0.070672 -1.731
insuranceMedicare 0.012200 0.081582 0.150
insuranceOther Governmental -0.388749 0.316493 -1.228
insuranceOther -0.089657 0.354900 -0.253
RPL_THEME1 0.465946 0.140077 3.326
RPL_THEME2 -0.114051 0.120432 -0.947
RPL_THEME3 0.061279 0.088785 0.690
RPL_THEME4 -0.139485 0.101241 -1.378
Pr(>|z|)
(Intercept) 0.870903
age_yrs < 2e-16 ***
genderFemale 0.000246 ***
race_5Black 0.155315
race_5Asian or Pacific Islander 0.055002 .
race_5American Indian or Alaska Native 0.484468
race_5Other 0.014579 *
ethnic_3Non-Hispanic 0.678554
lang_3Other 0.971146
act_tobYes 0.193078
max_ch 0.077158 .
insuranceMedicaid 0.083367 .
insuranceMedicare 0.881123
insuranceOther Governmental 0.219334
insuranceOther 0.800557
RPL_THEME1 0.000880 ***
RPL_THEME2 0.343628
RPL_THEME3 0.490072
RPL_THEME4 0.168279
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 10649 on 9280 degrees of freedom
Residual deviance: 10323 on 9262 degrees of freedom
(513 observations deleted due to missingness)
AIC: 10361
Number of Fisher Scoring iterations: 4
broom::glance(imm_acc_themes )
broom::tidy(imm_acc_themes , exponentiate = TRUE)
tbl_regression(imm_acc_themes, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
0.98 |
0.98, 0.98 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
0.84 |
0.76, 0.92 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
0.87 |
0.71, 1.05 |
0.2 |
| Â Â Â Â Asian or Pacific Islander |
0.73 |
0.53, 1.00 |
0.055 |
| Â Â Â Â American Indian or Alaska Native |
1.30 |
0.60, 2.63 |
0.5 |
| Â Â Â Â Other |
0.69 |
0.50, 0.92 |
0.015 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.93 |
0.67, 1.32 |
0.7 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.99 |
0.56, 1.67 |
>0.9 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.10 |
0.95, 1.28 |
0.2 |
| Charlson Comorbidity Index |
0.99 |
0.98, 1.00 |
0.077 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
0.88 |
0.77, 1.02 |
0.083 |
| Â Â Â Â Medicare |
1.01 |
0.86, 1.19 |
0.9 |
| Â Â Â Â Other Governmental |
0.68 |
0.35, 1.22 |
0.2 |
| Â Â Â Â Other |
0.91 |
0.44, 1.78 |
0.8 |
| Socioeconomic Status |
1.59 |
1.21, 2.10 |
<0.001 |
| Household Composition |
0.89 |
0.70, 1.13 |
0.3 |
| Minority and Language Status |
1.06 |
0.89, 1.27 |
0.5 |
| Housing and Transportation |
0.87 |
0.71, 1.06 |
0.2 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(imm_acc_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 7.03143
degrees of freedom = 8
p-value = 0.53325
# C-Statistic/AUROC
Cstat(imm_acc_themes)
[1] 0.6231022
# Model performance
model_performance(imm_acc_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------------
10360.925 | 10361.007 | 10496.504 | 0.035 | 0.431 | 1.056 | 0.556 | -Inf | 1.077e-04 | 0.628
performance::check_model(imm_acc_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(imm_acc_themes)
Average marginal effects
glm(formula = immuno_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(imm_acc_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Immuno Rx Given Theme1")

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

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

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

Steroids
Steroid Rx + SVI
med_data_ALL$steroids_2 <- as.numeric(med_data_ALL$steroids_2)
steroids_rx <- glm(steroids_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(steroids_rx )
Call:
glm(formula = steroids_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.5702 0.0039 0.6768 0.8192 1.3076
Coefficients:
Estimate Std. Error z value
(Intercept) 1.363517 0.209617 6.505
ibd_3UC -0.043459 0.049882 -0.871
ibd_3IC 10.278755 111.897210 0.092
ibd_3Unknown -0.584840 0.341821 -1.711
age_yrs -0.009190 0.001626 -5.653
genderFemale 0.276797 0.049026 5.646
race_5Black 0.215652 0.110612 1.950
race_5Asian or Pacific Islander -0.282657 0.143709 -1.967
race_5American Indian or Alaska Native -0.028393 0.410156 -0.069
race_5Other -0.090848 0.147308 -0.617
ethnic_3Non-Hispanic -0.449006 0.194932 -2.303
lang_3Other -0.503671 0.248193 -2.029
max_ch 0.100004 0.006778 14.753
act_tobYes 0.049008 0.080355 0.610
insuranceMedicaid 0.376059 0.078008 4.821
insuranceMedicare 0.155231 0.079623 1.950
insuranceOther Governmental 0.140844 0.294474 0.478
insuranceOther 0.596577 0.397838 1.500
RPL_THEMES 0.291374 0.103123 2.825
Pr(>|z|)
(Intercept) 7.78e-11 ***
ibd_3UC 0.38362
ibd_3IC 0.92681
ibd_3Unknown 0.08709 .
age_yrs 1.58e-08 ***
genderFemale 1.64e-08 ***
race_5Black 0.05122 .
race_5Asian or Pacific Islander 0.04920 *
race_5American Indian or Alaska Native 0.94481
race_5Other 0.53742
ethnic_3Non-Hispanic 0.02126 *
lang_3Other 0.04242 *
max_ch < 2e-16 ***
act_tobYes 0.54194
insuranceMedicaid 1.43e-06 ***
insuranceMedicare 0.05123 .
insuranceOther Governmental 0.63244
insuranceOther 0.13373
RPL_THEMES 0.00472 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 10498 on 9335 degrees of freedom
Residual deviance: 10107 on 9317 degrees of freedom
(458 observations deleted due to missingness)
AIC: 10145
Number of Fisher Scoring iterations: 10
broom::glance(steroids_rx )
broom::tidy(steroids_rx , exponentiate = TRUE)
tbl_regression(steroids_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.96 |
0.87, 1.06 |
0.4 |
| Â Â Â Â IC |
29,108 |
0.01, NA |
>0.9 |
| Â Â Â Â Unknown |
0.56 |
0.29, 1.12 |
0.087 |
| Age |
0.99 |
0.99, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.32 |
1.20, 1.45 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.24 |
1.00, 1.55 |
0.051 |
| Â Â Â Â Asian or Pacific Islander |
0.75 |
0.57, 1.00 |
0.049 |
| Â Â Â Â American Indian or Alaska Native |
0.97 |
0.45, 2.32 |
>0.9 |
| Â Â Â Â Other |
0.91 |
0.69, 1.22 |
0.5 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.64 |
0.43, 0.93 |
0.021 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.60 |
0.37, 0.99 |
0.042 |
| Charlson Comorbidity Index |
1.11 |
1.09, 1.12 |
<0.001 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.05 |
0.90, 1.23 |
0.5 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.46 |
1.25, 1.70 |
<0.001 |
| Â Â Â Â Medicare |
1.17 |
1.00, 1.37 |
0.051 |
| Â Â Â Â Other Governmental |
1.15 |
0.66, 2.11 |
0.6 |
| Â Â Â Â Other |
1.82 |
0.88, 4.25 |
0.13 |
| Social Vulnerability Index |
1.34 |
1.09, 1.64 |
0.005 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(steroids_rx)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 2.43806
degrees of freedom = 8
p-value = 0.96456
# C-Statistic/AUROC
Cstat(steroids_rx)
[1] 0.630084
# Model performance
model_performance(steroids_rx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | PCP
--------------------------------------------------------------------------------------------
10144.550 | 10144.632 | 10280.241 | 0.039 | 0.424 | 1.042 | 0.541 | -Inf | 0.640
performance::check_model(steroids_rx)
Variable `Component` is not in your data frame :/

# Margins
margins(steroids_rx)
Average marginal effects
glm(formula = steroids_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(steroids_rx, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Steroid Rx Given SVI")

Steroid Rx + All themes
steroid_Rx_themes <- glm(steroids_2 ~ 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(steroid_Rx_themes )
Call:
glm(formula = steroids_2 ~ 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
-2.5604 0.2462 0.6745 0.8181 1.2786
Coefficients:
Estimate Std. Error z value
(Intercept) 1.426204 0.217167 6.567
age_yrs -0.009453 0.001620 -5.836
genderFemale 0.280741 0.049197 5.706
race_5Black 0.255688 0.112534 2.272
race_5Asian or Pacific Islander -0.223495 0.146191 -1.529
race_5American Indian or Alaska Native -0.038545 0.409886 -0.094
race_5Other -0.074422 0.148186 -0.502
ethnic_3Non-Hispanic -0.470197 0.196633 -2.391
lang_3Other -0.458184 0.251347 -1.823
act_tobYes 0.045738 0.080254 0.570
max_ch 0.099681 0.006811 14.636
insuranceMedicaid 0.362223 0.078343 4.624
insuranceMedicare 0.155798 0.079803 1.952
insuranceOther Governmental 0.124321 0.294893 0.422
insuranceOther 0.548517 0.396946 1.382
RPL_THEME1 0.309085 0.144488 2.139
RPL_THEME2 0.033209 0.123948 0.268
RPL_THEME3 -0.138499 0.090489 -1.531
RPL_THEME4 0.002152 0.103901 0.021
Pr(>|z|)
(Intercept) 5.12e-11 ***
age_yrs 5.36e-09 ***
genderFemale 1.15e-08 ***
race_5Black 0.0231 *
race_5Asian or Pacific Islander 0.1263
race_5American Indian or Alaska Native 0.9251
race_5Other 0.6155
ethnic_3Non-Hispanic 0.0168 *
lang_3Other 0.0683 .
act_tobYes 0.5687
max_ch < 2e-16 ***
insuranceMedicaid 3.77e-06 ***
insuranceMedicare 0.0509 .
insuranceOther Governmental 0.6733
insuranceOther 0.1670
RPL_THEME1 0.0324 *
RPL_THEME2 0.7888
RPL_THEME3 0.1259
RPL_THEME4 0.9835
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 10427 on 9280 degrees of freedom
Residual deviance: 10040 on 9262 degrees of freedom
(513 observations deleted due to missingness)
AIC: 10078
Number of Fisher Scoring iterations: 4
broom::glance(steroid_Rx_themes )
broom::tidy(steroid_Rx_themes , exponentiate = TRUE)
tbl_regression(steroid_Rx_themes, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
0.99 |
0.99, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.32 |
1.20, 1.46 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.29 |
1.04, 1.62 |
0.023 |
| Â Â Â Â Asian or Pacific Islander |
0.80 |
0.60, 1.07 |
0.13 |
| Â Â Â Â American Indian or Alaska Native |
0.96 |
0.45, 2.30 |
>0.9 |
| Â Â Â Â Other |
0.93 |
0.70, 1.25 |
0.6 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.62 |
0.42, 0.91 |
0.017 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.63 |
0.39, 1.05 |
0.068 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.05 |
0.90, 1.23 |
0.6 |
| Charlson Comorbidity Index |
1.10 |
1.09, 1.12 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.44 |
1.23, 1.68 |
<0.001 |
| Â Â Â Â Medicare |
1.17 |
1.00, 1.37 |
0.051 |
| Â Â Â Â Other Governmental |
1.13 |
0.65, 2.08 |
0.7 |
| Â Â Â Â Other |
1.73 |
0.84, 4.05 |
0.2 |
| Socioeconomic Status |
1.36 |
1.03, 1.81 |
0.032 |
| Household Composition |
1.03 |
0.81, 1.32 |
0.8 |
| Minority and Language Status |
0.87 |
0.73, 1.04 |
0.13 |
| Housing and Transportation |
1.00 |
0.82, 1.23 |
>0.9 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(steroid_Rx_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 4.9307
degrees of freedom = 8
p-value = 0.76496
# C-Statistic/AUROC
Cstat(steroid_Rx_themes)
[1] 0.6300198
# Model performance
model_performance(steroid_Rx_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | PCP
--------------------------------------------------------------------------------------------
10077.635 | 10077.717 | 10213.214 | 0.039 | 0.424 | 1.041 | 0.541 | -Inf | 0.640
performance::check_model(steroid_Rx_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(steroid_Rx_themes)
Average marginal effects
glm(formula = steroids_2 ~ 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(steroid_Rx_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Immuno Rx Given Theme1")

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

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

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

Prolonged steroid exposure + SVI
med_data_ALL$steroids_3 <- as.numeric(med_data_ALL$steroids_3)
steroids_pro <- glm(steroids_3 ~ 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(steroids_pro )
Call:
glm(formula = steroids_3 ~ 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
-1.9369 -1.0421 -0.8544 1.2365 1.7875
Coefficients:
Estimate Std. Error z value
(Intercept) 0.239940 0.170258 1.409
ibd_3UC -0.074268 0.043717 -1.699
ibd_3IC 0.918753 1.248266 0.736
ibd_3Unknown -0.969655 0.362417 -2.676
age_yrs -0.015347 0.001454 -10.556
genderFemale 0.147959 0.043179 3.427
race_5Black 0.261621 0.087920 2.976
race_5Asian or Pacific Islander -0.221225 0.141924 -1.559
race_5American Indian or Alaska Native 0.139994 0.345306 0.405
race_5Other -0.033188 0.130096 -0.255
ethnic_3Non-Hispanic -0.231251 0.155923 -1.483
lang_3Other -0.064292 0.238280 -0.270
max_ch 0.092529 0.004996 18.521
act_tobYes 0.072290 0.068153 1.061
insuranceMedicaid 0.202608 0.063651 3.183
insuranceMedicare 0.061106 0.067832 0.901
insuranceOther Governmental -0.237464 0.261190 -0.909
insuranceOther 0.477639 0.312965 1.526
RPL_THEMES 0.081950 0.089130 0.919
Pr(>|z|)
(Intercept) 0.158755
ibd_3UC 0.089351 .
ibd_3IC 0.461717
ibd_3Unknown 0.007461 **
age_yrs < 2e-16 ***
genderFemale 0.000611 ***
race_5Black 0.002924 **
race_5Asian or Pacific Islander 0.119054
race_5American Indian or Alaska Native 0.685168
race_5Other 0.798641
ethnic_3Non-Hispanic 0.138046
lang_3Other 0.787301
max_ch < 2e-16 ***
act_tobYes 0.288826
insuranceMedicaid 0.001457 **
insuranceMedicare 0.367671
insuranceOther Governmental 0.363263
insuranceOther 0.126966
RPL_THEMES 0.357864
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12797 on 9335 degrees of freedom
Residual deviance: 12343 on 9317 degrees of freedom
(458 observations deleted due to missingness)
AIC: 12381
Number of Fisher Scoring iterations: 4
broom::glance(steroids_pro )
broom::tidy(steroids_pro , exponentiate = TRUE)
tbl_regression(steroids_pro, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| IBD Diagnosis |
|
|
|
| Â Â Â Â CD |
— |
— |
|
| Â Â Â Â UC |
0.93 |
0.85, 1.01 |
0.089 |
| Â Â Â Â IC |
2.51 |
0.23, 55.4 |
0.5 |
| Â Â Â Â Unknown |
0.38 |
0.18, 0.75 |
0.007 |
| Age |
0.98 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.16 |
1.07, 1.26 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.30 |
1.09, 1.54 |
0.003 |
| Â Â Â Â Asian or Pacific Islander |
0.80 |
0.60, 1.06 |
0.12 |
| Â Â Â Â American Indian or Alaska Native |
1.15 |
0.58, 2.27 |
0.7 |
| Â Â Â Â Other |
0.97 |
0.75, 1.25 |
0.8 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.79 |
0.58, 1.08 |
0.14 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.94 |
0.58, 1.49 |
0.8 |
| Charlson Comorbidity Index |
1.10 |
1.09, 1.11 |
<0.001 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.07 |
0.94, 1.23 |
0.3 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.22 |
1.08, 1.39 |
0.001 |
| Â Â Â Â Medicare |
1.06 |
0.93, 1.21 |
0.4 |
| Â Â Â Â Other Governmental |
0.79 |
0.47, 1.31 |
0.4 |
| Â Â Â Â Other |
1.61 |
0.87, 2.99 |
0.13 |
| Social Vulnerability Index |
1.09 |
0.91, 1.29 |
0.4 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(steroids_pro)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 1.90749
degrees of freedom = 8
p-value = 0.98372
# C-Statistic/AUROC
Cstat(steroids_pro)
[1] 0.6206749
# Model performance
model_performance(steroids_pro)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | PCP
--------------------------------------------------------------------------------------------
12381.068 | 12381.149 | 12516.759 | 0.048 | 0.484 | 1.151 | 0.661 | -Inf | 0.531
performance::check_model(steroids_pro)
Variable `Component` is not in your data frame :/

# Margins
margins(steroids_pro)
Average marginal effects
glm(formula = steroids_3 ~ 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(steroids_pro, "RPL_THEMES", what = "prediction", main = "Predicted Likelihood of Steroid Rx Given SVI")

Prolonged steroid exposure + All Themes
steroids_themes <- glm(steroids_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(steroids_themes )
Call:
glm(formula = steroids_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.9594 -1.0423 -0.8561 1.2370 1.7749
Coefficients:
Estimate Std. Error z value
(Intercept) 0.232447 0.176152 1.320
age_yrs -0.015656 0.001449 -10.801
genderFemale 0.147092 0.043285 3.398
race_5Black 0.253589 0.089509 2.833
race_5Asian or Pacific Islander -0.217140 0.143667 -1.511
race_5American Indian or Alaska Native 0.143838 0.345091 0.417
race_5Other -0.036890 0.130789 -0.282
ethnic_3Non-Hispanic -0.222072 0.156398 -1.420
lang_3Other -0.073606 0.239577 -0.307
act_tobYes 0.079906 0.068057 1.174
max_ch 0.092450 0.005013 18.440
insuranceMedicaid 0.189254 0.063902 2.962
insuranceMedicare 0.062149 0.067938 0.915
insuranceOther Governmental -0.246211 0.261335 -0.942
insuranceOther 0.423720 0.311462 1.360
RPL_THEME1 0.271643 0.125406 2.166
RPL_THEME2 -0.064718 0.107984 -0.599
RPL_THEME3 -0.003624 0.079144 -0.046
RPL_THEME4 -0.134175 0.090473 -1.483
Pr(>|z|)
(Intercept) 0.186974
age_yrs < 2e-16 ***
genderFemale 0.000678 ***
race_5Black 0.004610 **
race_5Asian or Pacific Islander 0.130683
race_5American Indian or Alaska Native 0.676816
race_5Other 0.777900
ethnic_3Non-Hispanic 0.155631
lang_3Other 0.758665
act_tobYes 0.240356
max_ch < 2e-16 ***
insuranceMedicaid 0.003060 **
insuranceMedicare 0.360303
insuranceOther Governmental 0.346127
insuranceOther 0.173697
RPL_THEME1 0.030303 *
RPL_THEME2 0.548952
RPL_THEME3 0.963482
RPL_THEME4 0.138066
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 12725 on 9280 degrees of freedom
Residual deviance: 12279 on 9262 degrees of freedom
(513 observations deleted due to missingness)
AIC: 12317
Number of Fisher Scoring iterations: 4
broom::glance(steroids_themes )
broom::tidy(steroids_themes , exponentiate = TRUE)
tbl_regression(steroids_themes, exponentiate = TRUE)
| Characteristic |
OR |
95% CI |
p-value |
| Age |
0.98 |
0.98, 0.99 |
<0.001 |
| Gender |
|
|
|
| Â Â Â Â Male |
— |
— |
|
| Â Â Â Â Female |
1.16 |
1.06, 1.26 |
<0.001 |
| Race |
|
|
|
| Â Â Â Â White |
— |
— |
|
| Â Â Â Â Black |
1.29 |
1.08, 1.54 |
0.005 |
| Â Â Â Â Asian or Pacific Islander |
0.80 |
0.61, 1.06 |
0.13 |
| Â Â Â Â American Indian or Alaska Native |
1.15 |
0.58, 2.28 |
0.7 |
| Â Â Â Â Other |
0.96 |
0.74, 1.24 |
0.8 |
| Ethnicity |
|
|
|
| Â Â Â Â Hispanic |
— |
— |
|
| Â Â Â Â Non-Hispanic |
0.80 |
0.59, 1.09 |
0.2 |
| Preferred Language |
|
|
|
| Â Â Â Â English |
— |
— |
|
| Â Â Â Â Other |
0.93 |
0.58, 1.48 |
0.8 |
| Active Tobacco Use |
|
|
|
| Â Â Â Â No |
— |
— |
|
| Â Â Â Â Yes |
1.08 |
0.95, 1.24 |
0.2 |
| Charlson Comorbidity Index |
1.10 |
1.09, 1.11 |
<0.001 |
| Insurance Type |
|
|
|
| Â Â Â Â Private Insurance |
— |
— |
|
| Â Â Â Â Medicaid |
1.21 |
1.07, 1.37 |
0.003 |
| Â Â Â Â Medicare |
1.06 |
0.93, 1.22 |
0.4 |
| Â Â Â Â Other Governmental |
0.78 |
0.46, 1.29 |
0.3 |
| Â Â Â Â Other |
1.53 |
0.83, 2.83 |
0.2 |
| Socioeconomic Status |
1.31 |
1.03, 1.68 |
0.030 |
| Household Composition |
0.94 |
0.76, 1.16 |
0.5 |
| Minority and Language Status |
1.00 |
0.85, 1.16 |
>0.9 |
| Housing and Transportation |
0.87 |
0.73, 1.04 |
0.14 |
# Hosmer-Lemeshow Goodness-of-Fit Test
hltest(steroids_themes)
The Hosmer-Lemeshow goodness-of-fit test
Statistic = 1.7856
degrees of freedom = 8
p-value = 0.98689
# C-Statistic/AUROC
Cstat(steroids_themes)
[1] 0.6200942
# Model performance
model_performance(steroids_themes)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | PCP
--------------------------------------------------------------------------------------------
12317.125 | 12317.207 | 12452.704 | 0.047 | 0.484 | 1.151 | 0.662 | -Inf | 0.531
performance::check_model(steroids_themes)
Variable `Component` is not in your data frame :/

# Margins
margins(steroids_themes)
Average marginal effects
glm(formula = steroids_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(steroids_themes, "RPL_THEME1", what = "prediction", main = "Predicted Likelihood of Steroid Rx Given Theme1")

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

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

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

LS0tCnRpdGxlOiAiTWVkX0FjY2Vzc19zZWNvbmRhcnkiCm91dHB1dDogCiAgaHRtbF9ub3RlYm9vazoKICAgdGhlbWVzOiBwYXBlcgogICB0b2M6IHllcwogICB0b2NfZmxvYXQ6IHllcwplZGl0b3Jfb3B0aW9uczogCiAgY2h1bmtfb3V0cHV0X3R5cGU6IGlubGluZQpkYXRlOiAiMjAyMy0wMS0wOCIKLS0tCgojIExvYWQgUGFja2FnZXMgCmBgYHtyfQpsaWJyYXJ5KHRpZHl2ZXJzZSkKbGlicmFyeShjb2RlYm9va3IpCmxpYnJhcnkoc3VtbWFyeXRvb2xzKQpsaWJyYXJ5KGJyb29tKSAKbGlicmFyeShwZXJmb3JtYW5jZSkKbGlicmFyeShndCkKbGlicmFyeShndHN1bW1hcnkpCmxpYnJhcnkoamFuaXRvcikKbGlicmFyeShmb3JjYXRzKQpsaWJyYXJ5KG1hcmdpb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