library(tidyverse)
library(gtsummary)
library(ggplot2)
library(broom)
library(performance)
library(glmtoolbox)
library(DescTools)
library(here)
library(corrplot)
library(broom)
library(pROC)
library(expss)
load("~/University of Michigan Dropbox/Jessica Sheehan/R-Code/Fatigue Survey/cd_final.rda")
load("~/University of Michigan Dropbox/Jessica Sheehan/R-Code/Fatigue Survey/uc_final.rda")
rbind(cd_final, uc_final) -> ibd_all
ibd_all %>% filter(gender != "Other") %>%
filter(gender != "Diclose") -> ibd_pts
ibd_pts %>%
mutate(ibd_f_fatigue = case_when(ibd_f_total >= 12 ~ '1', TRUE ~ "0")) ->ibd_pts
ibd_pts$ibd_f_fatigue <- as.numeric(ibd_pts$ibd_f_fatigue)
ibd_pts = apply_labels(ibd_pts,
sbj_id = "Subject ID",
ibd_dx = "IBD Diagnosis",
age = "Age",
gender = "Sex",
race_6 = "Race",
ethnicity = "Ethnicity",
severe_dx = "Moderate-to-Severe IBD",
active_steroids = "Active Corticosteroid Use",
prednisone_last_year = "Prednisone in the Last year",
steroid_months_yr = "Total Months of Steroids in the Last Year",
steroid_month_life = "Total Months of Steroids in Lifetime",
meds_class = "IBD Medications",
anxiety = "Self-Reported Anxiety Diagnosis",
depression = "Self-Reported Depression Diagnosis",
osa = "Obstructive Sleep Apnea",
pro_fatigue = "Fatigue PRO Score",
pro_sleep = "Sleep PRO Score",
pro_concentrate = "Concentration PRO Score",
facit_total = "FACIT-F Score",
facit_fatigue = "FACIT-F < 30",
ibd_f_total = "IBD-F Score",
ibd_f_fatigue = "IBD-F > 12",
stop_bang_total = "STOPBANG Score",
osa_mod_high = "Intermediate to High Risk for OSA",
osa_high = "High Risk of OSA")
ibd_pts %>% dplyr::select(ibd_dx, age, gender, race_6, ethnicity, BMI, severe_dx, active_steroids, prednisone_last_year, steroid_months_yr, steroid_month_life, meds_class, anxiety, depression, osa, pro_fatigue, pro_sleep, pro_concentrate, facit_total, facit_fatigue, ibd_f_total, ibd_f_fatigue, bmi_sb, stop_bang_total, osa_mod_high, osa_high, pro_concentrate) -> ibd_demo
na.omit(ibd_demo) -> ibd_demo_all
ibd_demo_all$severe_dx <- as.numeric(ibd_demo_all$severe_dx)
ibd_demo_all$osa_mod_high <- as.numeric(ibd_demo_all$osa_mod_high)
ibd_demo_all$osa_high <- as.numeric(ibd_demo_all$osa_high)
ibd_demo_all$facit_fatigue <- as.numeric(ibd_demo_all$facit_fatigue)
ibd_demo_all$steroid_months_yr <- as.numeric(ibd_demo_all$steroid_months_yr)
ibd_demo_all$steroids_month_life <- as.numeric(ibd_demo_all$steroid_month_life)
ibd_demo_all$pro_fatigue <- as.numeric(ibd_demo_all$pro_fatigue)
ibd_demo_all$pro_sleep <- as.numeric(ibd_demo_all$pro_sleep)
ibd_demo_all$pro_concentrate <- as.numeric(ibd_demo_all$pro_concentrate)
ibd_demo_all$BMI <- as.numeric(ibd_demo_all$BMI)
ibd_demo_all %>% tbl_summary(
statistic = list(all_continuous() ~ "{mean} ({sd})"),
type = list(steroid_months_yr ~ "continuous"),
missing_text = "(Missing)")
| Characteristic | N = 2561 |
|---|---|
| IBD Diagnosis | |
| Â Â Â Â Crohn's disease | 150 (59%) |
| Â Â Â Â Ulcerative colitis | 106 (41%) |
| Â Â Â Â Indeterminant colitis | 0 (0%) |
| Age | 48 (16) |
| Sex | |
| Â Â Â Â Male | 119 (46%) |
| Â Â Â Â Female | 137 (54%) |
| Â Â Â Â Other | 0 (0%) |
| Â Â Â Â Diclose | 0 (0%) |
| Race | |
| Â Â Â Â American Indian or Alaska Native | 2 (0.8%) |
| Â Â Â Â Asian | 6 (2.3%) |
| Â Â Â Â Black or African American | 7 (2.7%) |
| Â Â Â Â Native Hawaiian or other Pacific Islander | 0 (0%) |
| Â Â Â Â Unknown | 2 (0.8%) |
| Â Â Â Â White | 229 (89%) |
| Â Â Â Â Other | 6 (2.3%) |
| Â Â Â Â Multiracial | 4 (1.6%) |
| Ethnicity | |
| Â Â Â Â Hispanic or Latino | 5 (2.0%) |
| Â Â Â Â Not Hispanic or Latino | 235 (92%) |
| Â Â Â Â Choose not to disclose | 8 (3.1%) |
| Â Â Â Â Unknown | 8 (3.1%) |
| BMI | 28 (6) |
| Moderate-to-Severe IBD | 188 (73%) |
| Active Corticosteroid Use | 15 (5.9%) |
| Prednisone in the Last year | 38 (15%) |
| Total Months of Steroids in the Last Year | 0.58 (1.80) |
| Total Months of Steroids in Lifetime | 22 (44) |
| IBD Medications | |
| Â Â Â Â Biologic | 111 (43%) |
| Â Â Â Â ASA | 33 (13%) |
| Â Â Â Â Immunomodulator | 12 (4.7%) |
| Â Â Â Â Small | 13 (5.1%) |
| Â Â Â Â none | 31 (12%) |
| Â Â Â Â Dual | 56 (22%) |
| Self-Reported Anxiety Diagnosis | 81 (32%) |
| Self-Reported Depression Diagnosis | 63 (25%) |
| Obstructive Sleep Apnea | 32 (13%) |
| Fatigue PRO Score | |
| Â Â Â Â 0 | 54 (21%) |
| Â Â Â Â 1 | 77 (30%) |
| Â Â Â Â 2 | 74 (29%) |
| Â Â Â Â 3 | 41 (16%) |
| Â Â Â Â 4 | 10 (3.9%) |
| Sleep PRO Score | |
| Â Â Â Â 0 | 150 (59%) |
| Â Â Â Â 1 | 49 (19%) |
| Â Â Â Â 2 | 25 (9.8%) |
| Â Â Â Â 3 | 23 (9.0%) |
| Â Â Â Â 4 | 9 (3.5%) |
| Concentration PRO Score | |
| Â Â Â Â 0 | 154 (60%) |
| Â Â Â Â 1 | 57 (22%) |
| Â Â Â Â 2 | 24 (9.4%) |
| Â Â Â Â 3 | 15 (5.9%) |
| Â Â Â Â 4 | 6 (2.3%) |
| FACIT-F Score | 35 (12) |
| FACIT-F < 30 | 84 (33%) |
| IBD-F Score | 8 (5) |
| IBD-F > 12 | 64 (25%) |
| bmi_sb | 30 (12%) |
| STOPBANG Score | |
| Â Â Â Â 0 | 33 (13%) |
| Â Â Â Â 1 | 73 (29%) |
| Â Â Â Â 2 | 62 (24%) |
| Â Â Â Â 3 | 39 (15%) |
| Â Â Â Â 4 | 28 (11%) |
| Â Â Â Â 5 | 12 (4.7%) |
| Â Â Â Â 6 | 5 (2.0%) |
| Â Â Â Â 8 | 4 (1.6%) |
| Intermediate to High Risk for OSA | 88 (34%) |
| High Risk of OSA | 21 (8.2%) |
| Total Months of Steroids in Lifetime | 22 (44) |
| 1 n (%); Mean (SD) | |
# high risk
ibd_demo_all %>% filter(osa_high != "0") %>%
dplyr::select(ibd_dx, age, gender, race_6, ethnicity, BMI, severe_dx, active_steroids, steroid_months_yr, steroid_month_life, meds_class, anxiety, depression, osa, pro_fatigue, facit_total, facit_fatigue, ibd_f_total, stop_bang_total, osa_mod_high, osa_high) -> osa_high_risk
osa_high_risk %>% tbl_summary(
statistic = list(all_continuous() ~ "{mean} ({sd})"),
missing_text = "(Missing)")
| Characteristic | N = 211 |
|---|---|
| IBD Diagnosis | |
| Â Â Â Â Crohn's disease | 10 (48%) |
| Â Â Â Â Ulcerative colitis | 11 (52%) |
| Â Â Â Â Indeterminant colitis | 0 (0%) |
| Age | 60 (10) |
| Sex | |
| Â Â Â Â Male | 19 (90%) |
| Â Â Â Â Female | 2 (9.5%) |
| Â Â Â Â Other | 0 (0%) |
| Â Â Â Â Diclose | 0 (0%) |
| Race | |
| Â Â Â Â American Indian or Alaska Native | 0 (0%) |
| Â Â Â Â Asian | 1 (4.8%) |
| Â Â Â Â Black or African American | 0 (0%) |
| Â Â Â Â Native Hawaiian or other Pacific Islander | 0 (0%) |
| Â Â Â Â Unknown | 0 (0%) |
| Â Â Â Â White | 20 (95%) |
| Â Â Â Â Other | 0 (0%) |
| Â Â Â Â Multiracial | 0 (0%) |
| Ethnicity | |
| Â Â Â Â Hispanic or Latino | 0 (0%) |
| Â Â Â Â Not Hispanic or Latino | 18 (86%) |
| Â Â Â Â Choose not to disclose | 1 (4.8%) |
| Â Â Â Â Unknown | 2 (9.5%) |
| BMI | 34 (8) |
| Moderate-to-Severe IBD | 16 (76%) |
| Active Corticosteroid Use | 2 (9.5%) |
| Total Months of Steroids in the Last Year | |
| Â Â Â Â 0 | 13 (62%) |
| Â Â Â Â 1 | 3 (14%) |
| Â Â Â Â 2 | 1 (4.8%) |
| Â Â Â Â 4 | 1 (4.8%) |
| Â Â Â Â 5 | 1 (4.8%) |
| Â Â Â Â 12 | 2 (9.5%) |
| Total Months of Steroids in Lifetime | 18 (33) |
| IBD Medications | |
| Â Â Â Â Biologic | 10 (48%) |
| Â Â Â Â ASA | 3 (14%) |
| Â Â Â Â Immunomodulator | 1 (4.8%) |
| Â Â Â Â Small | 1 (4.8%) |
| Â Â Â Â none | 1 (4.8%) |
| Â Â Â Â Dual | 5 (24%) |
| Self-Reported Anxiety Diagnosis | 3 (14%) |
| Self-Reported Depression Diagnosis | 4 (19%) |
| Obstructive Sleep Apnea | 12 (57%) |
| Fatigue PRO Score | |
| Â Â Â Â 0 | 3 (14%) |
| Â Â Â Â 1 | 9 (43%) |
| Â Â Â Â 2 | 4 (19%) |
| Â Â Â Â 3 | 4 (19%) |
| Â Â Â Â 4 | 1 (4.8%) |
| FACIT-F Score | 33 (14) |
| FACIT-F < 30 | 7 (33%) |
| IBD-F Score | 8 (4) |
| STOPBANG Score | |
| Â Â Â Â 5 | 12 (57%) |
| Â Â Â Â 6 | 5 (24%) |
| Â Â Â Â 8 | 4 (19%) |
| Intermediate to High Risk for OSA | 21 (100%) |
| High Risk of OSA | 21 (100%) |
| 1 n (%); Mean (SD) | |
# moderate risk
ibd_demo_all$mod_osa <- 0; ibd_demo_all[ibd_demo_all$stop_bang_total > 2 & ibd_demo_all$stop_bang_total < 5, "mod_osa"] <- 1
ibd_demo_all %>% filter(mod_osa != "0") %>%
dplyr::select(ibd_dx, age, gender, race_6, ethnicity, BMI, severe_dx, active_steroids, steroid_months_yr, steroid_month_life, meds_class, anxiety, depression, osa, pro_fatigue, facit_total, facit_fatigue, ibd_f_total, stop_bang_total, osa_mod_high, osa_high) -> osa_mod_high_risk
osa_mod_high_risk %>% tbl_summary(
statistic = list(all_continuous() ~ "{mean} ({sd})"),
missing_text = "(Missing)")
| Characteristic | N = 671 |
|---|---|
| IBD Diagnosis | |
| Â Â Â Â Crohn's disease | 39 (58%) |
| Â Â Â Â Ulcerative colitis | 28 (42%) |
| Â Â Â Â Indeterminant colitis | 0 (0%) |
| Age | 57 (15) |
| Sex | |
| Â Â Â Â Male | 51 (76%) |
| Â Â Â Â Female | 16 (24%) |
| Â Â Â Â Other | 0 (0%) |
| Â Â Â Â Diclose | 0 (0%) |
| Race | |
| Â Â Â Â American Indian or Alaska Native | 1 (1.5%) |
| Â Â Â Â Asian | 1 (1.5%) |
| Â Â Â Â Black or African American | 3 (4.5%) |
| Â Â Â Â Native Hawaiian or other Pacific Islander | 0 (0%) |
| Â Â Â Â Unknown | 2 (3.0%) |
| Â Â Â Â White | 58 (87%) |
| Â Â Â Â Other | 1 (1.5%) |
| Â Â Â Â Multiracial | 1 (1.5%) |
| Ethnicity | |
| Â Â Â Â Hispanic or Latino | 2 (3.0%) |
| Â Â Â Â Not Hispanic or Latino | 59 (88%) |
| Â Â Â Â Choose not to disclose | 3 (4.5%) |
| Â Â Â Â Unknown | 3 (4.5%) |
| BMI | 30 (8) |
| Moderate-to-Severe IBD | 47 (70%) |
| Active Corticosteroid Use | 6 (9.0%) |
| Total Months of Steroids in the Last Year | |
| Â Â Â Â 0 | 50 (75%) |
| Â Â Â Â 0.5 | 1 (1.5%) |
| Â Â Â Â 1 | 6 (9.0%) |
| Â Â Â Â 2 | 5 (7.5%) |
| Â Â Â Â 3 | 3 (4.5%) |
| Â Â Â Â 6 | 1 (1.5%) |
| Â Â Â Â 10 | 1 (1.5%) |
| Total Months of Steroids in Lifetime | 26 (55) |
| IBD Medications | |
| Â Â Â Â Biologic | 24 (36%) |
| Â Â Â Â ASA | 13 (19%) |
| Â Â Â Â Immunomodulator | 6 (9.0%) |
| Â Â Â Â Small | 4 (6.0%) |
| Â Â Â Â none | 7 (10%) |
| Â Â Â Â Dual | 13 (19%) |
| Self-Reported Anxiety Diagnosis | 22 (33%) |
| Self-Reported Depression Diagnosis | 20 (30%) |
| Obstructive Sleep Apnea | 13 (19%) |
| Fatigue PRO Score | |
| Â Â Â Â 0 | 15 (22%) |
| Â Â Â Â 1 | 23 (34%) |
| Â Â Â Â 2 | 19 (28%) |
| Â Â Â Â 3 | 9 (13%) |
| Â Â Â Â 4 | 1 (1.5%) |
| FACIT-F Score | 36 (12) |
| FACIT-F < 30 | 19 (28%) |
| IBD-F Score | 7 (5) |
| STOPBANG Score | |
| Â Â Â Â 3 | 39 (58%) |
| Â Â Â Â 4 | 28 (42%) |
| Intermediate to High Risk for OSA | 67 (100%) |
| High Risk of OSA | 0 (0%) |
| 1 n (%); Mean (SD) | |
## Look at what proportion of these people actually got sleep studies
# low risk
ibd_demo_all %>% filter(osa_mod_high != "1") %>%
dplyr::select(ibd_dx, age, gender, race_6, ethnicity, BMI, severe_dx, active_steroids, steroid_months_yr, steroid_month_life, meds_class, anxiety, depression, osa, pro_fatigue, facit_total, facit_fatigue, ibd_f_total, stop_bang_total, osa_mod_high, osa_high) -> osa_low_risk
osa_low_risk %>% tbl_summary(
statistic = list(all_continuous() ~ "{mean} ({sd})"),
missing_text = "(Missing)")
| Characteristic | N = 1681 |
|---|---|
| IBD Diagnosis | |
| Â Â Â Â Crohn's disease | 101 (60%) |
| Â Â Â Â Ulcerative colitis | 67 (40%) |
| Â Â Â Â Indeterminant colitis | 0 (0%) |
| Age | 43 (15) |
| Sex | |
| Â Â Â Â Male | 49 (29%) |
| Â Â Â Â Female | 119 (71%) |
| Â Â Â Â Other | 0 (0%) |
| Â Â Â Â Diclose | 0 (0%) |
| Race | |
| Â Â Â Â American Indian or Alaska Native | 1 (0.6%) |
| Â Â Â Â Asian | 4 (2.4%) |
| Â Â Â Â Black or African American | 4 (2.4%) |
| Â Â Â Â Native Hawaiian or other Pacific Islander | 0 (0%) |
| Â Â Â Â Unknown | 0 (0%) |
| Â Â Â Â White | 151 (90%) |
| Â Â Â Â Other | 5 (3.0%) |
| Â Â Â Â Multiracial | 3 (1.8%) |
| Ethnicity | |
| Â Â Â Â Hispanic or Latino | 3 (1.8%) |
| Â Â Â Â Not Hispanic or Latino | 158 (94%) |
| Â Â Â Â Choose not to disclose | 4 (2.4%) |
| Â Â Â Â Unknown | 3 (1.8%) |
| BMI | 26.7 (5.0) |
| Moderate-to-Severe IBD | 125 (74%) |
| Active Corticosteroid Use | 7 (4.2%) |
| Total Months of Steroids in the Last Year | |
| Â Â Â Â 0 | 139 (83%) |
| Â Â Â Â 0.5 | 1 (0.6%) |
| Â Â Â Â 1 | 14 (8.3%) |
| Â Â Â Â 2 | 7 (4.2%) |
| Â Â Â Â 3 | 3 (1.8%) |
| Â Â Â Â 4 | 2 (1.2%) |
| Â Â Â Â 12 | 2 (1.2%) |
| Total Months of Steroids in Lifetime | 21 (40) |
| IBD Medications | |
| Â Â Â Â Biologic | 77 (46%) |
| Â Â Â Â ASA | 17 (10%) |
| Â Â Â Â Immunomodulator | 5 (3.0%) |
| Â Â Â Â Small | 8 (4.8%) |
| Â Â Â Â none | 23 (14%) |
| Â Â Â Â Dual | 38 (23%) |
| Self-Reported Anxiety Diagnosis | 56 (33%) |
| Self-Reported Depression Diagnosis | 39 (23%) |
| Obstructive Sleep Apnea | 7 (4.2%) |
| Fatigue PRO Score | |
| Â Â Â Â 0 | 36 (21%) |
| Â Â Â Â 1 | 45 (27%) |
| Â Â Â Â 2 | 51 (30%) |
| Â Â Â Â 3 | 28 (17%) |
| Â Â Â Â 4 | 8 (4.8%) |
| FACIT-F Score | 35 (13) |
| FACIT-F < 30 | 58 (35%) |
| IBD-F Score | 8 (5) |
| STOPBANG Score | |
| Â Â Â Â 0 | 33 (20%) |
| Â Â Â Â 1 | 73 (43%) |
| Â Â Â Â 2 | 62 (37%) |
| Intermediate to High Risk for OSA | 0 (0%) |
| High Risk of OSA | 0 (0%) |
| 1 n (%); Mean (SD) | |
NA
ibd_demo_all$osa_mod_high <- as.numeric(ibd_demo_all$osa_mod_high )
# make variable for OSA risk without a diagnosis
ibd_demo_all$mod_osa_no_dx <- 0; ibd_demo_all[ibd_demo_all$osa_mod_high >= 1 & ibd_demo_all$osa < 1, "mod_osa_no_dx"] <- 1
ibd_demo_all %>% dplyr::select(osa, osa_mod_high, mod_osa_no_dx) -> osa_variables
ibd_demo_all$mod_osa_no_dx <- as.numeric(ibd_demo_all$mod_osa_no_dx)
ibd_demo_all %>%
mutate(pro_fatigue_2 = case_when(pro_fatigue > 1 ~ '1', TRUE ~ "0")) ->ibd_demo_all
ibd_demo_all$pro_fatigue_2 <- as.numeric(ibd_demo_all$pro_fatigue_2)
# Demographics
ibd_demo_all %>% filter(mod_osa_no_dx != "0") %>%
dplyr::select(ibd_dx, age, gender, race_6, ethnicity, severe_dx, active_steroids, steroid_months_yr, steroid_month_life, meds_class, anxiety, depression, osa, facit_total, facit_fatigue, ibd_f_total, pro_fatigue, pro_fatigue_2, pro_sleep, pro_concentrate, stop_bang_total) -> osa_mod_high_risk
osa_mod_high_risk %>% tbl_summary(
statistic = list(all_continuous() ~ "{mean} ({sd})"),
missing_text = "(Missing)")
| Characteristic | N = 631 |
|---|---|
| IBD Diagnosis | |
| Â Â Â Â Crohn's disease | 35 (56%) |
| Â Â Â Â Ulcerative colitis | 28 (44%) |
| Â Â Â Â Indeterminant colitis | 0 (0%) |
| Age | 57 (14) |
| Sex | |
| Â Â Â Â Male | 52 (83%) |
| Â Â Â Â Female | 11 (17%) |
| Â Â Â Â Other | 0 (0%) |
| Â Â Â Â Diclose | 0 (0%) |
| Race | |
| Â Â Â Â American Indian or Alaska Native | 1 (1.6%) |
| Â Â Â Â Asian | 1 (1.6%) |
| Â Â Â Â Black or African American | 3 (4.8%) |
| Â Â Â Â Native Hawaiian or other Pacific Islander | 0 (0%) |
| Â Â Â Â Unknown | 2 (3.2%) |
| Â Â Â Â White | 54 (86%) |
| Â Â Â Â Other | 1 (1.6%) |
| Â Â Â Â Multiracial | 1 (1.6%) |
| Ethnicity | |
| Â Â Â Â Hispanic or Latino | 2 (3.2%) |
| Â Â Â Â Not Hispanic or Latino | 54 (86%) |
| Â Â Â Â Choose not to disclose | 3 (4.8%) |
| Â Â Â Â Unknown | 4 (6.3%) |
| Moderate-to-Severe IBD | 47 (75%) |
| Active Corticosteroid Use | 7 (11%) |
| Total Months of Steroids in the Last Year | |
| Â Â Â Â 0 | 43 (68%) |
| Â Â Â Â 0.5 | 1 (1.6%) |
| Â Â Â Â 1 | 7 (11%) |
| Â Â Â Â 2 | 5 (7.9%) |
| Â Â Â Â 3 | 3 (4.8%) |
| Â Â Â Â 5 | 1 (1.6%) |
| Â Â Â Â 6 | 1 (1.6%) |
| Â Â Â Â 10 | 1 (1.6%) |
| Â Â Â Â 12 | 1 (1.6%) |
| Total Months of Steroids in Lifetime | 27 (56) |
| IBD Medications | |
| Â Â Â Â Biologic | 25 (40%) |
| Â Â Â Â ASA | 11 (17%) |
| Â Â Â Â Immunomodulator | 4 (6.3%) |
| Â Â Â Â Small | 5 (7.9%) |
| Â Â Â Â none | 5 (7.9%) |
| Â Â Â Â Dual | 13 (21%) |
| Self-Reported Anxiety Diagnosis | 15 (24%) |
| Self-Reported Depression Diagnosis | 15 (24%) |
| Obstructive Sleep Apnea | 0 (0%) |
| FACIT-F Score | 38 (11) |
| FACIT-F < 30 | 13 (21%) |
| IBD-F Score | 7 (4) |
| Fatigue PRO Score | |
| Â Â Â Â 0 | 14 (22%) |
| Â Â Â Â 1 | 26 (41%) |
| Â Â Â Â 2 | 16 (25%) |
| Â Â Â Â 3 | 6 (9.5%) |
| Â Â Â Â 4 | 1 (1.6%) |
| pro_fatigue_2 | 23 (37%) |
| Sleep PRO Score | |
| Â Â Â Â 0 | 39 (62%) |
| Â Â Â Â 1 | 13 (21%) |
| Â Â Â Â 2 | 6 (9.5%) |
| Â Â Â Â 3 | 3 (4.8%) |
| Â Â Â Â 4 | 2 (3.2%) |
| Concentration PRO Score | |
| Â Â Â Â 0 | 40 (63%) |
| Â Â Â Â 1 | 15 (24%) |
| Â Â Â Â 2 | 4 (6.3%) |
| Â Â Â Â 3 | 2 (3.2%) |
| Â Â Â Â 4 | 2 (3.2%) |
| STOPBANG Score | |
| Â Â Â Â 3 | 36 (57%) |
| Â Â Â Â 4 | 18 (29%) |
| Â Â Â Â 5 | 5 (7.9%) |
| Â Â Â Â 6 | 3 (4.8%) |
| Â Â Â Â 8 | 1 (1.6%) |
| 1 n (%); Mean (SD) | |
ibd_demo_all %>% filter(osa == "0") %>% tbl_summary(
by = "mod_osa_no_dx",
statistic = list(all_continuous() ~ "{mean} ({sd})"),
type = list(steroid_months_yr ~ "continuous",
pro_fatigue ~ "continuous",
pro_concentrate ~ "continuous",
pro_sleep ~ "continuous"),
missing_text = "(Missing)") %>%
add_p()
There was an error in 'add_p()/add_difference()' for variable 'osa', p-value omitted:
Error in stats::chisq.test(x = structure(c(0L, 0L, 0L, 0L, 0L, 0L, 0L, : 'x' and 'y' must have at least 2 levels
| Characteristic | 0, N = 1611 | 1, N = 631 | p-value2 |
|---|---|---|---|
| IBD Diagnosis | 0.7 | ||
| Â Â Â Â Crohn's disease | 95 (59%) | 35 (56%) | |
| Â Â Â Â Ulcerative colitis | 66 (41%) | 28 (44%) | |
| Â Â Â Â Indeterminant colitis | 0 (0%) | 0 (0%) | |
| Age | 43 (15) | 57 (14) | <0.001 |
| Sex | <0.001 | ||
| Â Â Â Â Male | 47 (29%) | 52 (83%) | |
| Â Â Â Â Female | 114 (71%) | 11 (17%) | |
| Â Â Â Â Other | 0 (0%) | 0 (0%) | |
| Â Â Â Â Diclose | 0 (0%) | 0 (0%) | |
| Race | 0.3 | ||
| Â Â Â Â American Indian or Alaska Native | 1 (0.6%) | 1 (1.6%) | |
| Â Â Â Â Asian | 4 (2.5%) | 1 (1.6%) | |
| Â Â Â Â Black or African American | 4 (2.5%) | 3 (4.8%) | |
| Â Â Â Â Native Hawaiian or other Pacific Islander | 0 (0%) | 0 (0%) | |
| Â Â Â Â Unknown | 0 (0%) | 2 (3.2%) | |
| Â Â Â Â White | 144 (89%) | 54 (86%) | |
| Â Â Â Â Other | 5 (3.1%) | 1 (1.6%) | |
| Â Â Â Â Multiracial | 3 (1.9%) | 1 (1.6%) | |
| Ethnicity | 0.11 | ||
| Â Â Â Â Hispanic or Latino | 3 (1.9%) | 2 (3.2%) | |
| Â Â Â Â Not Hispanic or Latino | 152 (94%) | 54 (86%) | |
| Â Â Â Â Choose not to disclose | 3 (1.9%) | 3 (4.8%) | |
| Â Â Â Â Unknown | 3 (1.9%) | 4 (6.3%) | |
| BMI | 26.5 (4.9) | 29.1 (5.8) | <0.001 |
| Moderate-to-Severe IBD | 119 (74%) | 47 (75%) | >0.9 |
| Active Corticosteroid Use | 7 (4.3%) | 7 (11%) | 0.071 |
| Prednisone in the Last year | 21 (13%) | 14 (22%) | 0.089 |
| Total Months of Steroids in the Last Year | 0.42 (1.50) | 0.94 (2.21) | 0.011 |
| Total Months of Steroids in Lifetime | 21 (41) | 27 (56) | 0.8 |
| IBD Medications | 0.4 | ||
| Â Â Â Â Biologic | 72 (45%) | 25 (40%) | |
| Â Â Â Â ASA | 17 (11%) | 11 (17%) | |
| Â Â Â Â Immunomodulator | 5 (3.1%) | 4 (6.3%) | |
| Â Â Â Â Small | 8 (5.0%) | 5 (7.9%) | |
| Â Â Â Â none | 22 (14%) | 5 (7.9%) | |
| Â Â Â Â Dual | 37 (23%) | 13 (21%) | |
| Self-Reported Anxiety Diagnosis | 53 (33%) | 15 (24%) | 0.2 |
| Self-Reported Depression Diagnosis | 36 (22%) | 15 (24%) | 0.8 |
| Obstructive Sleep Apnea | 0 (0%) | 0 (0%) | |
| Fatigue PRO Score | 1.58 (1.13) | 1.27 (0.97) | 0.061 |
| Sleep PRO Score | 0.81 (1.16) | 0.67 (1.05) | 0.5 |
| Concentration PRO Score | 0.70 (1.02) | 0.59 (0.98) | 0.5 |
| FACIT-F Score | 35 (12) | 38 (11) | 0.2 |
| FACIT-F < 30 | 57 (35%) | 13 (21%) | 0.032 |
| IBD-F Score | 8 (5) | 7 (4) | 0.2 |
| IBD-F > 12 | 47 (29%) | 8 (13%) | 0.010 |
| bmi_sb | 8 (5.0%) | 10 (16%) | 0.007 |
| STOPBANG Score | <0.001 | ||
| Â Â Â Â 0 | 33 (20%) | 0 (0%) | |
| Â Â Â Â 1 | 69 (43%) | 0 (0%) | |
| Â Â Â Â 2 | 59 (37%) | 0 (0%) | |
| Â Â Â Â 3 | 0 (0%) | 36 (57%) | |
| Â Â Â Â 4 | 0 (0%) | 18 (29%) | |
| Â Â Â Â 5 | 0 (0%) | 5 (7.9%) | |
| Â Â Â Â 6 | 0 (0%) | 3 (4.8%) | |
| Â Â Â Â 8 | 0 (0%) | 1 (1.6%) | |
| Intermediate to High Risk for OSA | 0 (0%) | 63 (100%) | <0.001 |
| High Risk of OSA | 0 (0%) | 9 (14%) | <0.001 |
| Total Months of Steroids in Lifetime | 21 (41) | 27 (56) | 0.8 |
| mod_osa | 0 (0%) | 54 (86%) | <0.001 |
| pro_fatigue_2 | 84 (52%) | 23 (37%) | 0.035 |
| 1 n (%); Mean (SD) | |||
| 2 Fisher’s exact test; Wilcoxon rank sum test; Pearson’s Chi-squared test | |||
ibd_demo_all %>% filter(osa == "0") %>% tbl_uvregression(
method = glm,
y = mod_osa_no_dx,
include = c(ibd_dx, age, gender, severe_dx, active_steroids, prednisone_last_year, steroid_months_yr, steroid_month_life, meds_class, anxiety, depression, facit_fatigue, ibd_f_total, ibd_f_fatigue, pro_fatigue, pro_sleep, pro_concentrate),
method.args = list(family = binomial),
exponentiate = TRUE,
)
| Characteristic | N | OR1 | 95% CI1 | p-value |
|---|---|---|---|---|
| IBD Diagnosis | 224 | |||
|     Crohn's disease | — | — | ||
| Â Â Â Â Ulcerative colitis | 1.15 | 0.64, 2.07 | 0.6 | |
| Age | 224 | 1.06 | 1.04, 1.09 | <0.001 |
| Sex | 224 | |||
|     Male | — | — | ||
| Â Â Â Â Female | 0.09 | 0.04, 0.18 | <0.001 | |
| Moderate-to-Severe IBD | 224 | 1.04 | 0.54, 2.06 | >0.9 |
| Active Corticosteroid Use | 224 | 2.75 | 0.90, 8.37 | 0.069 |
| Prednisone in the Last year | 224 | 1.90 | 0.88, 4.01 | 0.092 |
| Total Months of Steroids in the Last Year | 224 | 1.17 | 1.00, 1.40 | 0.062 |
| Total Months of Steroids in Lifetime | 224 | 1.00 | 1.00, 1.01 | 0.4 |
| IBD Medications | 224 | |||
|     Biologic | — | — | ||
| Â Â Â Â ASA | 1.86 | 0.76, 4.49 | 0.2 | |
| Â Â Â Â Immunomodulator | 2.30 | 0.53, 9.38 | 0.2 | |
| Â Â Â Â Small | 1.80 | 0.50, 5.92 | 0.3 | |
| Â Â Â Â none | 0.65 | 0.20, 1.80 | 0.4 | |
| Â Â Â Â Dual | 1.01 | 0.46, 2.18 | >0.9 | |
| Self-Reported Anxiety Diagnosis | 224 | 0.64 | 0.32, 1.22 | 0.2 |
| Self-Reported Depression Diagnosis | 224 | 1.09 | 0.53, 2.13 | 0.8 |
| Fatigue PRO Score | 224 | 0.76 | 0.57, 1.01 | 0.059 |
| Sleep PRO Score | 224 | 0.89 | 0.67, 1.16 | 0.4 |
| Concentration PRO Score | 224 | 0.89 | 0.65, 1.20 | 0.5 |
| FACIT-F < 30 | 224 | 0.47 | 0.23, 0.92 | 0.034 |
| IBD-F Score | 224 | 0.96 | 0.90, 1.02 | 0.2 |
| IBD-F > 12 | 224 | 0.35 | 0.15, 0.76 | 0.012 |
| 1 OR = Odds Ratio, CI = Confidence Interval | ||||
ibd_demo_all %>% filter(osa == "0") -> ibd_no_osa
set_label(ibd_no_osa$mod_osa_no_dx) <- "Predictors of Increased Risk for OSA"
osa_no_dx <- glm(mod_osa_no_dx ~ age + gender + BMI + active_steroids + facit_fatigue,
family = "binomial",
data = ibd_no_osa)
summary(osa_no_dx )
Call:
glm(formula = mod_osa_no_dx ~ age + gender + BMI + active_steroids +
facit_fatigue, family = "binomial", data = ibd_no_osa)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -9.20199 1.61263 -5.706 1.16e-08 ***
age 0.08466 0.01572 5.385 7.23e-08 ***
genderFemale -3.13482 0.52098 -6.017 1.77e-09 ***
BMI 0.18280 0.04294 4.257 2.07e-05 ***
active_steroids 1.88471 0.80187 2.350 0.0188 *
facit_fatigue 0.11655 0.50189 0.232 0.8164
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 266.17 on 223 degrees of freedom
Residual deviance: 151.19 on 218 degrees of freedom
AIC: 163.19
Number of Fisher Scoring iterations: 6
broom::glance(osa_no_dx )
broom::tidy(osa_no_dx , exponentiate = TRUE)
tbl_regression(osa_no_dx, exponentiate = TRUE)
| Characteristic | OR1 | 95% CI1 | p-value |
|---|---|---|---|
| Age | 1.09 | 1.06, 1.12 | <0.001 |
| Sex | |||
|     Male | — | — | |
| Â Â Â Â Female | 0.04 | 0.01, 0.11 | <0.001 |
| BMI | 1.20 | 1.11, 1.31 | <0.001 |
| Active Corticosteroid Use | 6.58 | 1.42, 34.1 | 0.019 |
| FACIT-F < 30 | 1.12 | 0.42, 3.03 | 0.8 |
| 1 OR = Odds Ratio, CI = Confidence Interval | |||
# C-Statistic/AUROC
Cstat(osa_no_dx)
[1] 0.9035788
# Model performance
model_performance(osa_no_dx)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------
163.191 | 163.578 | 183.661 | 0.478 | 0.324 | 1.000 | 0.337 | -31.542 | 0.033 | 0.789
performance::check_model(osa_no_dx)
library(sjPlot)
library(sjlabelled)
library(sjmisc)
library(ggplot2)
plot_model(osa_no_dx) + scale_y_log10(limits = c(0.01, 50))
Scale for y is already present.
Adding another scale for y, which will replace the existing scale.
correlation1 <- cor(ibd_demo_all$facit_total, ibd_demo_all$ibd_f_total, method = 'pearson')
correlation1
[1] -0.889915
correlation2 <- cor(ibd_demo_all$facit_total, ibd_demo_all$pro_fatigue, method = 'pearson')
correlation2
[1] -0.799167
correlation3 <- cor(ibd_demo_all$ibd_f_total, ibd_demo_all$pro_fatigue, method = 'pearson')
correlation3
[1] 0.8087237
correlation4 <- cor(ibd_demo_all$facit_fatigue, ibd_demo_all$pro_fatigue, method = 'pearson')
correlation4
[1] 0.6512549
correlation5 <- cor(ibd_demo_all$ibd_f_fatigue, ibd_demo_all$pro_fatigue, method = 'pearson')
correlation5
[1] 0.6517001
correlation6 <- cor(ibd_demo_all$ibd_f_fatigue, ibd_demo_all$facit_fatigue, method = 'pearson')
correlation6
[1] 0.7300945
roc_facit_f <- roc(ibd_demo_all$facit_fatigue, ibd_demo_all$pro_fatigue)
Setting levels: control = 0, case = 1
Setting direction: controls < cases
roc_facit_f
Call:
roc.default(response = ibd_demo_all$facit_fatigue, predictor = ibd_demo_all$pro_fatigue)
Data: ibd_demo_all$pro_fatigue in 172 controls (ibd_demo_all$facit_fatigue 0) < 84 cases (ibd_demo_all$facit_fatigue 1).
Area under the curve: 0.8837
coords(roc_facit_f)
plot.roc(roc_facit_f)
coords(roc_facit_f, "best", ret=c("threshold", "sens", "spec", "ppv", "npv"))
coords(roc_facit_f, "local maximas", ret=c("threshold", "sens", "spec", "ppv", "npv"))
ci(roc_facit_f, of = "thresholds", thresholds = 1)
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 8%
|
|======= | 9%
|
|======== | 10%
|
|======== | 11%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|=========== | 15%
|
|============ | 15%
|
|============ | 16%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|=============== | 20%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 23%
|
|=================== | 24%
|
|=================== | 25%
|
|==================== | 25%
|
|==================== | 26%
|
|===================== | 26%
|
|===================== | 27%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================= | 30%
|
|======================== | 30%
|
|======================== | 31%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|========================== | 34%
|
|=========================== | 34%
|
|=========================== | 35%
|
|============================ | 35%
|
|============================ | 36%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|============================== | 39%
|
|=============================== | 39%
|
|=============================== | 40%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================= | 42%
|
|================================== | 42%
|
|================================== | 43%
|
|================================== | 44%
|
|=================================== | 44%
|
|=================================== | 45%
|
|==================================== | 45%
|
|==================================== | 46%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 48%
|
|====================================== | 49%
|
|======================================= | 49%
|
|======================================= | 50%
|
|======================================== | 50%
|
|======================================== | 51%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 53%
|
|========================================== | 54%
|
|=========================================== | 54%
|
|=========================================== | 55%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================= | 58%
|
|============================================== | 58%
|
|============================================== | 59%
|
|=============================================== | 59%
|
|=============================================== | 60%
|
|================================================ | 60%
|
|================================================ | 61%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================= | 63%
|
|================================================== | 63%
|
|================================================== | 64%
|
|=================================================== | 64%
|
|=================================================== | 65%
|
|==================================================== | 65%
|
|==================================================== | 66%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|===================================================== | 68%
|
|====================================================== | 68%
|
|====================================================== | 69%
|
|======================================================= | 69%
|
|======================================================= | 70%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|======================================================== | 72%
|
|========================================================= | 72%
|
|========================================================= | 73%
|
|========================================================== | 73%
|
|========================================================== | 74%
|
|=========================================================== | 74%
|
|=========================================================== | 75%
|
|============================================================ | 75%
|
|============================================================ | 76%
|
|============================================================ | 77%
|
|============================================================= | 77%
|
|============================================================= | 78%
|
|============================================================== | 78%
|
|============================================================== | 79%
|
|=============================================================== | 79%
|
|=============================================================== | 80%
|
|================================================================ | 80%
|
|================================================================ | 81%
|
|================================================================ | 82%
|
|================================================================= | 82%
|
|================================================================= | 83%
|
|================================================================== | 83%
|
|================================================================== | 84%
|
|=================================================================== | 84%
|
|=================================================================== | 85%
|
|==================================================================== | 85%
|
|==================================================================== | 86%
|
|==================================================================== | 87%
|
|===================================================================== | 87%
|
|===================================================================== | 88%
|
|====================================================================== | 88%
|
|====================================================================== | 89%
|
|======================================================================= | 89%
|
|======================================================================= | 90%
|
|======================================================================== | 91%
|
|======================================================================== | 92%
|
|========================================================================= | 92%
|
|========================================================================= | 93%
|
|========================================================================== | 93%
|
|========================================================================== | 94%
|
|=========================================================================== | 94%
|
|=========================================================================== | 95%
|
|=========================================================================== | 96%
|
|============================================================================ | 96%
|
|============================================================================ | 97%
|
|============================================================================= | 97%
|
|============================================================================= | 98%
|
|============================================================================== | 98%
|
|============================================================================== | 99%
|
|===============================================================================| 99%
|
|===============================================================================| 100%
95% CI (2000 stratified bootstrap replicates):
ci(roc_facit_f, of = "thresholds", thresholds = 2)
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 8%
|
|======= | 9%
|
|======== | 10%
|
|======== | 11%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|=========== | 15%
|
|============ | 15%
|
|============ | 16%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|=============== | 20%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 23%
|
|=================== | 24%
|
|=================== | 25%
|
|==================== | 25%
|
|==================== | 26%
|
|===================== | 26%
|
|===================== | 27%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================= | 30%
|
|======================== | 30%
|
|======================== | 31%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|========================== | 34%
|
|=========================== | 34%
|
|=========================== | 35%
|
|============================ | 35%
|
|============================ | 36%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|============================== | 39%
|
|=============================== | 39%
|
|=============================== | 40%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================= | 42%
|
|================================== | 42%
|
|================================== | 43%
|
|================================== | 44%
|
|=================================== | 44%
|
|=================================== | 45%
|
|==================================== | 45%
|
|==================================== | 46%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 48%
|
|====================================== | 49%
|
|======================================= | 49%
|
|======================================= | 50%
|
|======================================== | 50%
|
|======================================== | 51%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 53%
|
|========================================== | 54%
|
|=========================================== | 54%
|
|=========================================== | 55%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================= | 58%
|
|============================================== | 58%
|
|============================================== | 59%
|
|=============================================== | 59%
|
|=============================================== | 60%
|
|================================================ | 60%
|
|================================================ | 61%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================= | 63%
|
|================================================== | 63%
|
|================================================== | 64%
|
|=================================================== | 64%
|
|=================================================== | 65%
|
|==================================================== | 65%
|
|==================================================== | 66%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|===================================================== | 68%
|
|====================================================== | 68%
|
|====================================================== | 69%
|
|======================================================= | 69%
|
|======================================================= | 70%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|======================================================== | 72%
|
|========================================================= | 72%
|
|========================================================= | 73%
|
|========================================================== | 73%
|
|========================================================== | 74%
|
|=========================================================== | 74%
|
|=========================================================== | 75%
|
|============================================================ | 75%
|
|============================================================ | 76%
|
|============================================================ | 77%
|
|============================================================= | 77%
|
|============================================================= | 78%
|
|============================================================== | 78%
|
|============================================================== | 79%
|
|=============================================================== | 79%
|
|=============================================================== | 80%
|
|================================================================ | 80%
|
|================================================================ | 81%
|
|================================================================ | 82%
|
|================================================================= | 82%
|
|================================================================= | 83%
|
|================================================================== | 83%
|
|================================================================== | 84%
|
|=================================================================== | 84%
|
|=================================================================== | 85%
|
|==================================================================== | 85%
|
|==================================================================== | 86%
|
|==================================================================== | 87%
|
|===================================================================== | 87%
|
|===================================================================== | 88%
|
|====================================================================== | 88%
|
|====================================================================== | 89%
|
|======================================================================= | 89%
|
|======================================================================= | 90%
|
|======================================================================== | 91%
|
|======================================================================== | 92%
|
|========================================================================= | 92%
|
|========================================================================= | 93%
|
|========================================================================== | 93%
|
|========================================================================== | 94%
|
|=========================================================================== | 94%
|
|=========================================================================== | 95%
|
|=========================================================================== | 96%
|
|============================================================================ | 96%
|
|============================================================================ | 97%
|
|============================================================================= | 97%
|
|============================================================================= | 98%
|
|============================================================================== | 98%
|
|============================================================================== | 99%
|
|===============================================================================| 99%
|
|===============================================================================| 100%
95% CI (2000 stratified bootstrap replicates):
ci(roc_facit_f, of = "thresholds", thresholds = 3)
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 8%
|
|======= | 9%
|
|======== | 10%
|
|======== | 11%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|=========== | 15%
|
|============ | 15%
|
|============ | 16%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|=============== | 20%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 23%
|
|=================== | 24%
|
|=================== | 25%
|
|==================== | 25%
|
|==================== | 26%
|
|===================== | 26%
|
|===================== | 27%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================= | 30%
|
|======================== | 30%
|
|======================== | 31%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|========================== | 34%
|
|=========================== | 34%
|
|=========================== | 35%
|
|============================ | 35%
|
|============================ | 36%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|============================== | 39%
|
|=============================== | 39%
|
|=============================== | 40%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================= | 42%
|
|================================== | 42%
|
|================================== | 43%
|
|================================== | 44%
|
|=================================== | 44%
|
|=================================== | 45%
|
|==================================== | 45%
|
|==================================== | 46%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 48%
|
|====================================== | 49%
|
|======================================= | 49%
|
|======================================= | 50%
|
|======================================== | 50%
|
|======================================== | 51%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 53%
|
|========================================== | 54%
|
|=========================================== | 54%
|
|=========================================== | 55%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================= | 58%
|
|============================================== | 58%
|
|============================================== | 59%
|
|=============================================== | 59%
|
|=============================================== | 60%
|
|================================================ | 60%
|
|================================================ | 61%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================= | 63%
|
|================================================== | 63%
|
|================================================== | 64%
|
|=================================================== | 64%
|
|=================================================== | 65%
|
|==================================================== | 65%
|
|==================================================== | 66%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|===================================================== | 68%
|
|====================================================== | 68%
|
|====================================================== | 69%
|
|======================================================= | 69%
|
|======================================================= | 70%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|======================================================== | 72%
|
|========================================================= | 72%
|
|========================================================= | 73%
|
|========================================================== | 73%
|
|========================================================== | 74%
|
|=========================================================== | 74%
|
|=========================================================== | 75%
|
|============================================================ | 75%
|
|============================================================ | 76%
|
|============================================================ | 77%
|
|============================================================= | 77%
|
|============================================================= | 78%
|
|============================================================== | 78%
|
|============================================================== | 79%
|
|=============================================================== | 79%
|
|=============================================================== | 80%
|
|================================================================ | 80%
|
|================================================================ | 81%
|
|================================================================ | 82%
|
|================================================================= | 82%
|
|================================================================= | 83%
|
|================================================================== | 83%
|
|================================================================== | 84%
|
|=================================================================== | 84%
|
|=================================================================== | 85%
|
|==================================================================== | 85%
|
|==================================================================== | 86%
|
|==================================================================== | 87%
|
|===================================================================== | 87%
|
|===================================================================== | 88%
|
|====================================================================== | 88%
|
|====================================================================== | 89%
|
|======================================================================= | 89%
|
|======================================================================= | 90%
|
|======================================================================== | 91%
|
|======================================================================== | 92%
|
|========================================================================= | 92%
|
|========================================================================= | 93%
|
|========================================================================== | 93%
|
|========================================================================== | 94%
|
|=========================================================================== | 94%
|
|=========================================================================== | 95%
|
|=========================================================================== | 96%
|
|============================================================================ | 96%
|
|============================================================================ | 97%
|
|============================================================================= | 97%
|
|============================================================================= | 98%
|
|============================================================================== | 98%
|
|============================================================================== | 99%
|
|===============================================================================| 99%
|
|===============================================================================| 100%
95% CI (2000 stratified bootstrap replicates):
roc_facit_f_plot <- plot.roc(ibd_demo_all$facit_fatigue, ibd_demo_all$pro_fatigue,
main = "FACIT-F",
percent=TRUE,
ci = TRUE, # compute AUC (of AUC by default)
print.auc = TRUE) # print the AUC (will contain the CI)
Setting levels: control = 0, case = 1
Setting direction: controls < cases
ciobj <- ci.se(roc_facit_f_plot, # CI of sensitivity
specificities = seq(0, 100, 5)) # over a select set of specificities
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 8%
|
|======= | 9%
|
|======== | 10%
|
|======== | 11%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|=========== | 15%
|
|============ | 15%
|
|============ | 16%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|=============== | 20%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 23%
|
|=================== | 24%
|
|=================== | 25%
|
|==================== | 25%
|
|==================== | 26%
|
|===================== | 26%
|
|===================== | 27%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================= | 30%
|
|======================== | 30%
|
|======================== | 31%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|========================== | 34%
|
|=========================== | 34%
|
|=========================== | 35%
|
|============================ | 35%
|
|============================ | 36%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|============================== | 39%
|
|=============================== | 39%
|
|=============================== | 40%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================= | 42%
|
|================================== | 42%
|
|================================== | 43%
|
|================================== | 44%
|
|=================================== | 44%
|
|=================================== | 45%
|
|==================================== | 45%
|
|==================================== | 46%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 48%
|
|====================================== | 49%
|
|======================================= | 49%
|
|======================================= | 50%
|
|======================================== | 50%
|
|======================================== | 51%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 53%
|
|========================================== | 54%
|
|=========================================== | 54%
|
|=========================================== | 55%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================= | 58%
|
|============================================== | 58%
|
|============================================== | 59%
|
|=============================================== | 59%
|
|=============================================== | 60%
|
|================================================ | 60%
|
|================================================ | 61%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================= | 63%
|
|================================================== | 63%
|
|================================================== | 64%
|
|=================================================== | 64%
|
|=================================================== | 65%
|
|==================================================== | 65%
|
|==================================================== | 66%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|===================================================== | 68%
|
|====================================================== | 68%
|
|====================================================== | 69%
|
|======================================================= | 69%
|
|======================================================= | 70%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|======================================================== | 72%
|
|========================================================= | 72%
|
|========================================================= | 73%
|
|========================================================== | 73%
|
|========================================================== | 74%
|
|=========================================================== | 74%
|
|=========================================================== | 75%
|
|============================================================ | 75%
|
|============================================================ | 76%
|
|============================================================ | 77%
|
|============================================================= | 77%
|
|============================================================= | 78%
|
|============================================================== | 78%
|
|============================================================== | 79%
|
|=============================================================== | 79%
|
|=============================================================== | 80%
|
|================================================================ | 80%
|
|================================================================ | 81%
|
|================================================================ | 82%
|
|================================================================= | 82%
|
|================================================================= | 83%
|
|================================================================== | 83%
|
|================================================================== | 84%
|
|=================================================================== | 84%
|
|=================================================================== | 85%
|
|==================================================================== | 85%
|
|==================================================================== | 86%
|
|==================================================================== | 87%
|
|===================================================================== | 87%
|
|===================================================================== | 88%
|
|====================================================================== | 88%
|
|====================================================================== | 89%
|
|======================================================================= | 89%
|
|======================================================================= | 90%
|
|======================================================================== | 91%
|
|======================================================================== | 92%
|
|========================================================================= | 92%
|
|========================================================================= | 93%
|
|========================================================================== | 93%
|
|========================================================================== | 94%
|
|=========================================================================== | 94%
|
|=========================================================================== | 95%
|
|=========================================================================== | 96%
|
|============================================================================ | 96%
|
|============================================================================ | 97%
|
|============================================================================= | 97%
|
|============================================================================= | 98%
|
|============================================================================== | 98%
|
|============================================================================== | 99%
|
|===============================================================================| 99%
|
|===============================================================================| 100%
plot(ciobj, type = "shape", col = "#1c61b6AA") # plot as a blue shape
plot(ci(roc_facit_f_plot, of = "thresholds", thresholds = "best")) # add one threshold
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 8%
|
|======= | 9%
|
|======== | 10%
|
|======== | 11%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|=========== | 15%
|
|============ | 15%
|
|============ | 16%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|=============== | 20%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 23%
|
|=================== | 24%
|
|=================== | 25%
|
|==================== | 25%
|
|==================== | 26%
|
|===================== | 26%
|
|===================== | 27%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================= | 30%
|
|======================== | 30%
|
|======================== | 31%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|========================== | 34%
|
|=========================== | 34%
|
|=========================== | 35%
|
|============================ | 35%
|
|============================ | 36%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|============================== | 39%
|
|=============================== | 39%
|
|=============================== | 40%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================= | 42%
|
|================================== | 42%
|
|================================== | 43%
|
|================================== | 44%
|
|=================================== | 44%
|
|=================================== | 45%
|
|==================================== | 45%
|
|==================================== | 46%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 48%
|
|====================================== | 49%
|
|======================================= | 49%
|
|======================================= | 50%
|
|======================================== | 50%
|
|======================================== | 51%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 53%
|
|========================================== | 54%
|
|=========================================== | 54%
|
|=========================================== | 55%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================= | 58%
|
|============================================== | 58%
|
|============================================== | 59%
|
|=============================================== | 59%
|
|=============================================== | 60%
|
|================================================ | 60%
|
|================================================ | 61%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================= | 63%
|
|================================================== | 63%
|
|================================================== | 64%
|
|=================================================== | 64%
|
|=================================================== | 65%
|
|==================================================== | 65%
|
|==================================================== | 66%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|===================================================== | 68%
|
|====================================================== | 68%
|
|====================================================== | 69%
|
|======================================================= | 69%
|
|======================================================= | 70%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|======================================================== | 72%
|
|========================================================= | 72%
|
|========================================================= | 73%
|
|========================================================== | 73%
|
|========================================================== | 74%
|
|=========================================================== | 74%
|
|=========================================================== | 75%
|
|============================================================ | 75%
|
|============================================================ | 76%
|
|============================================================ | 77%
|
|============================================================= | 77%
|
|============================================================= | 78%
|
|============================================================== | 78%
|
|============================================================== | 79%
|
|=============================================================== | 79%
|
|=============================================================== | 80%
|
|================================================================ | 80%
|
|================================================================ | 81%
|
|================================================================ | 82%
|
|================================================================= | 82%
|
|================================================================= | 83%
|
|================================================================== | 83%
|
|================================================================== | 84%
|
|=================================================================== | 84%
|
|=================================================================== | 85%
|
|==================================================================== | 85%
|
|==================================================================== | 86%
|
|==================================================================== | 87%
|
|===================================================================== | 87%
|
|===================================================================== | 88%
|
|====================================================================== | 88%
|
|====================================================================== | 89%
|
|======================================================================= | 89%
|
|======================================================================= | 90%
|
|======================================================================== | 91%
|
|======================================================================== | 92%
|
|========================================================================= | 92%
|
|========================================================================= | 93%
|
|========================================================================== | 93%
|
|========================================================================== | 94%
|
|=========================================================================== | 94%
|
|=========================================================================== | 95%
|
|=========================================================================== | 96%
|
|============================================================================ | 96%
|
|============================================================================ | 97%
|
|============================================================================= | 97%
|
|============================================================================= | 98%
|
|============================================================================== | 98%
|
|============================================================================== | 99%
|
|===============================================================================| 99%
|
|===============================================================================| 100%
roc_ibd_f <- roc(ibd_demo_all$ibd_f_fatigue, ibd_demo_all$pro_fatigue)
Setting levels: control = 0, case = 1
Setting direction: controls < cases
roc_ibd_f
Call:
roc.default(response = ibd_demo_all$ibd_f_fatigue, predictor = ibd_demo_all$pro_fatigue)
Data: ibd_demo_all$pro_fatigue in 192 controls (ibd_demo_all$ibd_f_fatigue 0) < 64 cases (ibd_demo_all$ibd_f_fatigue 1).
Area under the curve: 0.9073
coords(roc_ibd_f)
plot.roc(roc_ibd_f)
coords(roc_ibd_f, "best", ret=c("threshold", "sens", "spec", "ppv", "npv"))
coords(roc_ibd_f, "local maximas", ret=c("threshold", "sens", "spec", "ppv", "npv"))
ci(roc_ibd_f, of = "thresholds", thresholds = 1)
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 8%
|
|======= | 9%
|
|======== | 10%
|
|======== | 11%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|=========== | 15%
|
|============ | 15%
|
|============ | 16%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|=============== | 20%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 23%
|
|=================== | 24%
|
|=================== | 25%
|
|==================== | 25%
|
|==================== | 26%
|
|===================== | 26%
|
|===================== | 27%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================= | 30%
|
|======================== | 30%
|
|======================== | 31%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|========================== | 34%
|
|=========================== | 34%
|
|=========================== | 35%
|
|============================ | 35%
|
|============================ | 36%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|============================== | 39%
|
|=============================== | 39%
|
|=============================== | 40%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================= | 42%
|
|================================== | 42%
|
|================================== | 43%
|
|================================== | 44%
|
|=================================== | 44%
|
|=================================== | 45%
|
|==================================== | 45%
|
|==================================== | 46%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 48%
|
|====================================== | 49%
|
|======================================= | 49%
|
|======================================= | 50%
|
|======================================== | 50%
|
|======================================== | 51%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 53%
|
|========================================== | 54%
|
|=========================================== | 54%
|
|=========================================== | 55%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================= | 58%
|
|============================================== | 58%
|
|============================================== | 59%
|
|=============================================== | 59%
|
|=============================================== | 60%
|
|================================================ | 60%
|
|================================================ | 61%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================= | 63%
|
|================================================== | 63%
|
|================================================== | 64%
|
|=================================================== | 64%
|
|=================================================== | 65%
|
|==================================================== | 65%
|
|==================================================== | 66%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|===================================================== | 68%
|
|====================================================== | 68%
|
|====================================================== | 69%
|
|======================================================= | 69%
|
|======================================================= | 70%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|======================================================== | 72%
|
|========================================================= | 72%
|
|========================================================= | 73%
|
|========================================================== | 73%
|
|========================================================== | 74%
|
|=========================================================== | 74%
|
|=========================================================== | 75%
|
|============================================================ | 75%
|
|============================================================ | 76%
|
|============================================================ | 77%
|
|============================================================= | 77%
|
|============================================================= | 78%
|
|============================================================== | 78%
|
|============================================================== | 79%
|
|=============================================================== | 79%
|
|=============================================================== | 80%
|
|================================================================ | 80%
|
|================================================================ | 81%
|
|================================================================ | 82%
|
|================================================================= | 82%
|
|================================================================= | 83%
|
|================================================================== | 83%
|
|================================================================== | 84%
|
|=================================================================== | 84%
|
|=================================================================== | 85%
|
|==================================================================== | 85%
|
|==================================================================== | 86%
|
|==================================================================== | 87%
|
|===================================================================== | 87%
|
|===================================================================== | 88%
|
|====================================================================== | 88%
|
|====================================================================== | 89%
|
|======================================================================= | 89%
|
|======================================================================= | 90%
|
|======================================================================== | 91%
|
|======================================================================== | 92%
|
|========================================================================= | 92%
|
|========================================================================= | 93%
|
|========================================================================== | 93%
|
|========================================================================== | 94%
|
|=========================================================================== | 94%
|
|=========================================================================== | 95%
|
|=========================================================================== | 96%
|
|============================================================================ | 96%
|
|============================================================================ | 97%
|
|============================================================================= | 97%
|
|============================================================================= | 98%
|
|============================================================================== | 98%
|
|============================================================================== | 99%
|
|===============================================================================| 99%
|
|===============================================================================| 100%
95% CI (2000 stratified bootstrap replicates):
ci(roc_ibd_f, of = "thresholds", thresholds = 2)
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 8%
|
|======= | 9%
|
|======== | 10%
|
|======== | 11%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|=========== | 15%
|
|============ | 15%
|
|============ | 16%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|=============== | 20%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 23%
|
|=================== | 24%
|
|=================== | 25%
|
|==================== | 25%
|
|==================== | 26%
|
|===================== | 26%
|
|===================== | 27%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================= | 30%
|
|======================== | 30%
|
|======================== | 31%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|========================== | 34%
|
|=========================== | 34%
|
|=========================== | 35%
|
|============================ | 35%
|
|============================ | 36%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|============================== | 39%
|
|=============================== | 39%
|
|=============================== | 40%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================= | 42%
|
|================================== | 42%
|
|================================== | 43%
|
|================================== | 44%
|
|=================================== | 44%
|
|=================================== | 45%
|
|==================================== | 45%
|
|==================================== | 46%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 48%
|
|====================================== | 49%
|
|======================================= | 49%
|
|======================================= | 50%
|
|======================================== | 50%
|
|======================================== | 51%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 53%
|
|========================================== | 54%
|
|=========================================== | 54%
|
|=========================================== | 55%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================= | 58%
|
|============================================== | 58%
|
|============================================== | 59%
|
|=============================================== | 59%
|
|=============================================== | 60%
|
|================================================ | 60%
|
|================================================ | 61%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================= | 63%
|
|================================================== | 63%
|
|================================================== | 64%
|
|=================================================== | 64%
|
|=================================================== | 65%
|
|==================================================== | 65%
|
|==================================================== | 66%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|===================================================== | 68%
|
|====================================================== | 68%
|
|====================================================== | 69%
|
|======================================================= | 69%
|
|======================================================= | 70%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|======================================================== | 72%
|
|========================================================= | 72%
|
|========================================================= | 73%
|
|========================================================== | 73%
|
|========================================================== | 74%
|
|=========================================================== | 74%
|
|=========================================================== | 75%
|
|============================================================ | 75%
|
|============================================================ | 76%
|
|============================================================ | 77%
|
|============================================================= | 77%
|
|============================================================= | 78%
|
|============================================================== | 78%
|
|============================================================== | 79%
|
|=============================================================== | 79%
|
|=============================================================== | 80%
|
|================================================================ | 80%
|
|================================================================ | 81%
|
|================================================================ | 82%
|
|================================================================= | 82%
|
|================================================================= | 83%
|
|================================================================== | 83%
|
|================================================================== | 84%
|
|=================================================================== | 84%
|
|=================================================================== | 85%
|
|==================================================================== | 85%
|
|==================================================================== | 86%
|
|==================================================================== | 87%
|
|===================================================================== | 87%
|
|===================================================================== | 88%
|
|====================================================================== | 88%
|
|====================================================================== | 89%
|
|======================================================================= | 89%
|
|======================================================================= | 90%
|
|======================================================================== | 91%
|
|======================================================================== | 92%
|
|========================================================================= | 92%
|
|========================================================================= | 93%
|
|========================================================================== | 93%
|
|========================================================================== | 94%
|
|=========================================================================== | 94%
|
|=========================================================================== | 95%
|
|=========================================================================== | 96%
|
|============================================================================ | 96%
|
|============================================================================ | 97%
|
|============================================================================= | 97%
|
|============================================================================= | 98%
|
|============================================================================== | 98%
|
|============================================================================== | 99%
|
|===============================================================================| 99%
|
|===============================================================================| 100%
95% CI (2000 stratified bootstrap replicates):
ci(roc_ibd_f, of = "thresholds", thresholds = 3)
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 8%
|
|======= | 9%
|
|======== | 10%
|
|======== | 11%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|=========== | 15%
|
|============ | 15%
|
|============ | 16%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|=============== | 20%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 23%
|
|=================== | 24%
|
|=================== | 25%
|
|==================== | 25%
|
|==================== | 26%
|
|===================== | 26%
|
|===================== | 27%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================= | 30%
|
|======================== | 30%
|
|======================== | 31%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|========================== | 34%
|
|=========================== | 34%
|
|=========================== | 35%
|
|============================ | 35%
|
|============================ | 36%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|============================== | 39%
|
|=============================== | 39%
|
|=============================== | 40%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================= | 42%
|
|================================== | 42%
|
|================================== | 43%
|
|================================== | 44%
|
|=================================== | 44%
|
|=================================== | 45%
|
|==================================== | 45%
|
|==================================== | 46%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 48%
|
|====================================== | 49%
|
|======================================= | 49%
|
|======================================= | 50%
|
|======================================== | 50%
|
|======================================== | 51%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 53%
|
|========================================== | 54%
|
|=========================================== | 54%
|
|=========================================== | 55%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================= | 58%
|
|============================================== | 58%
|
|============================================== | 59%
|
|=============================================== | 59%
|
|=============================================== | 60%
|
|================================================ | 60%
|
|================================================ | 61%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================= | 63%
|
|================================================== | 63%
|
|================================================== | 64%
|
|=================================================== | 64%
|
|=================================================== | 65%
|
|==================================================== | 65%
|
|==================================================== | 66%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|===================================================== | 68%
|
|====================================================== | 68%
|
|====================================================== | 69%
|
|======================================================= | 69%
|
|======================================================= | 70%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|======================================================== | 72%
|
|========================================================= | 72%
|
|========================================================= | 73%
|
|========================================================== | 73%
|
|========================================================== | 74%
|
|=========================================================== | 74%
|
|=========================================================== | 75%
|
|============================================================ | 75%
|
|============================================================ | 76%
|
|============================================================ | 77%
|
|============================================================= | 77%
|
|============================================================= | 78%
|
|============================================================== | 78%
|
|============================================================== | 79%
|
|=============================================================== | 79%
|
|=============================================================== | 80%
|
|================================================================ | 80%
|
|================================================================ | 81%
|
|================================================================ | 82%
|
|================================================================= | 82%
|
|================================================================= | 83%
|
|================================================================== | 83%
|
|================================================================== | 84%
|
|=================================================================== | 84%
|
|=================================================================== | 85%
|
|==================================================================== | 85%
|
|==================================================================== | 86%
|
|==================================================================== | 87%
|
|===================================================================== | 87%
|
|===================================================================== | 88%
|
|====================================================================== | 88%
|
|====================================================================== | 89%
|
|======================================================================= | 89%
|
|======================================================================= | 90%
|
|======================================================================== | 91%
|
|======================================================================== | 92%
|
|========================================================================= | 92%
|
|========================================================================= | 93%
|
|========================================================================== | 93%
|
|========================================================================== | 94%
|
|=========================================================================== | 94%
|
|=========================================================================== | 95%
|
|=========================================================================== | 96%
|
|============================================================================ | 96%
|
|============================================================================ | 97%
|
|============================================================================= | 97%
|
|============================================================================= | 98%
|
|============================================================================== | 98%
|
|============================================================================== | 99%
|
|===============================================================================| 99%
|
|===============================================================================| 100%
95% CI (2000 stratified bootstrap replicates):
roc_ibd_f_plot <- plot.roc(ibd_demo_all$ibd_f_fatigue, ibd_demo_all$pro_fatigue,
main = "IBD-F",
percent=TRUE,
ci = TRUE, # compute AUC (of AUC by default)
print.auc = TRUE) # print the AUC (will contain the CI)
Setting levels: control = 0, case = 1
Setting direction: controls < cases
ciobj <- ci.se(roc_facit_f_plot, # CI of sensitivity
specificities = seq(0, 100, 5)) # over a select set of specificities
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 8%
|
|======= | 9%
|
|======== | 10%
|
|======== | 11%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|=========== | 15%
|
|============ | 15%
|
|============ | 16%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|=============== | 20%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 23%
|
|=================== | 24%
|
|=================== | 25%
|
|==================== | 25%
|
|==================== | 26%
|
|===================== | 26%
|
|===================== | 27%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================= | 30%
|
|======================== | 30%
|
|======================== | 31%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|========================== | 34%
|
|=========================== | 34%
|
|=========================== | 35%
|
|============================ | 35%
|
|============================ | 36%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|============================== | 39%
|
|=============================== | 39%
|
|=============================== | 40%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================= | 42%
|
|================================== | 42%
|
|================================== | 43%
|
|================================== | 44%
|
|=================================== | 44%
|
|=================================== | 45%
|
|==================================== | 45%
|
|==================================== | 46%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 48%
|
|====================================== | 49%
|
|======================================= | 49%
|
|======================================= | 50%
|
|======================================== | 50%
|
|======================================== | 51%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 53%
|
|========================================== | 54%
|
|=========================================== | 54%
|
|=========================================== | 55%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================= | 58%
|
|============================================== | 58%
|
|============================================== | 59%
|
|=============================================== | 59%
|
|=============================================== | 60%
|
|================================================ | 60%
|
|================================================ | 61%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================= | 63%
|
|================================================== | 63%
|
|================================================== | 64%
|
|=================================================== | 64%
|
|=================================================== | 65%
|
|==================================================== | 65%
|
|==================================================== | 66%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|===================================================== | 68%
|
|====================================================== | 68%
|
|====================================================== | 69%
|
|======================================================= | 69%
|
|======================================================= | 70%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|======================================================== | 72%
|
|========================================================= | 72%
|
|========================================================= | 73%
|
|========================================================== | 73%
|
|========================================================== | 74%
|
|=========================================================== | 74%
|
|=========================================================== | 75%
|
|============================================================ | 75%
|
|============================================================ | 76%
|
|============================================================ | 77%
|
|============================================================= | 77%
|
|============================================================= | 78%
|
|============================================================== | 78%
|
|============================================================== | 79%
|
|=============================================================== | 79%
|
|=============================================================== | 80%
|
|================================================================ | 80%
|
|================================================================ | 81%
|
|================================================================ | 82%
|
|================================================================= | 82%
|
|================================================================= | 83%
|
|================================================================== | 83%
|
|================================================================== | 84%
|
|=================================================================== | 84%
|
|=================================================================== | 85%
|
|==================================================================== | 85%
|
|==================================================================== | 86%
|
|==================================================================== | 87%
|
|===================================================================== | 87%
|
|===================================================================== | 88%
|
|====================================================================== | 88%
|
|====================================================================== | 89%
|
|======================================================================= | 89%
|
|======================================================================= | 90%
|
|======================================================================== | 91%
|
|======================================================================== | 92%
|
|========================================================================= | 92%
|
|========================================================================= | 93%
|
|========================================================================== | 93%
|
|========================================================================== | 94%
|
|=========================================================================== | 94%
|
|=========================================================================== | 95%
|
|=========================================================================== | 96%
|
|============================================================================ | 96%
|
|============================================================================ | 97%
|
|============================================================================= | 97%
|
|============================================================================= | 98%
|
|============================================================================== | 98%
|
|============================================================================== | 99%
|
|===============================================================================| 99%
|
|===============================================================================| 100%
plot(ciobj, type = "shape", col = "#1c61b6AA") # plot as a blue shape
plot(ci(roc_facit_f_plot, of = "thresholds", thresholds = "best")) # add one threshold
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 8%
|
|======= | 9%
|
|======== | 10%
|
|======== | 11%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|=========== | 15%
|
|============ | 15%
|
|============ | 16%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|=============== | 20%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 23%
|
|=================== | 24%
|
|=================== | 25%
|
|==================== | 25%
|
|==================== | 26%
|
|===================== | 26%
|
|===================== | 27%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================= | 30%
|
|======================== | 30%
|
|======================== | 31%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|========================== | 34%
|
|=========================== | 34%
|
|=========================== | 35%
|
|============================ | 35%
|
|============================ | 36%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|============================== | 39%
|
|=============================== | 39%
|
|=============================== | 40%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================= | 42%
|
|================================== | 42%
|
|================================== | 43%
|
|================================== | 44%
|
|=================================== | 44%
|
|=================================== | 45%
|
|==================================== | 45%
|
|==================================== | 46%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 48%
|
|====================================== | 49%
|
|======================================= | 49%
|
|======================================= | 50%
|
|======================================== | 50%
|
|======================================== | 51%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 53%
|
|========================================== | 54%
|
|=========================================== | 54%
|
|=========================================== | 55%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================= | 58%
|
|============================================== | 58%
|
|============================================== | 59%
|
|=============================================== | 59%
|
|=============================================== | 60%
|
|================================================ | 60%
|
|================================================ | 61%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================= | 63%
|
|================================================== | 63%
|
|================================================== | 64%
|
|=================================================== | 64%
|
|=================================================== | 65%
|
|==================================================== | 65%
|
|==================================================== | 66%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|===================================================== | 68%
|
|====================================================== | 68%
|
|====================================================== | 69%
|
|======================================================= | 69%
|
|======================================================= | 70%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|======================================================== | 72%
|
|========================================================= | 72%
|
|========================================================= | 73%
|
|========================================================== | 73%
|
|========================================================== | 74%
|
|=========================================================== | 74%
|
|=========================================================== | 75%
|
|============================================================ | 75%
|
|============================================================ | 76%
|
|============================================================ | 77%
|
|============================================================= | 77%
|
|============================================================= | 78%
|
|============================================================== | 78%
|
|============================================================== | 79%
|
|=============================================================== | 79%
|
|=============================================================== | 80%
|
|================================================================ | 80%
|
|================================================================ | 81%
|
|================================================================ | 82%
|
|================================================================= | 82%
|
|================================================================= | 83%
|
|================================================================== | 83%
|
|================================================================== | 84%
|
|=================================================================== | 84%
|
|=================================================================== | 85%
|
|==================================================================== | 85%
|
|==================================================================== | 86%
|
|==================================================================== | 87%
|
|===================================================================== | 87%
|
|===================================================================== | 88%
|
|====================================================================== | 88%
|
|====================================================================== | 89%
|
|======================================================================= | 89%
|
|======================================================================= | 90%
|
|======================================================================== | 91%
|
|======================================================================== | 92%
|
|========================================================================= | 92%
|
|========================================================================= | 93%
|
|========================================================================== | 93%
|
|========================================================================== | 94%
|
|=========================================================================== | 94%
|
|=========================================================================== | 95%
|
|=========================================================================== | 96%
|
|============================================================================ | 96%
|
|============================================================================ | 97%
|
|============================================================================= | 97%
|
|============================================================================= | 98%
|
|============================================================================== | 98%
|
|============================================================================== | 99%
|
|===============================================================================| 99%
|
|===============================================================================| 100%
fatigue_1 <- glm(facit_fatigue ~ ibd_dx + age + gender + severe_dx + active_steroids + anxiety + depression,
family = "binomial",
data = ibd_demo_all)
summary(fatigue_1 )
Call:
glm(formula = facit_fatigue ~ ibd_dx + age + gender + severe_dx +
active_steroids + anxiety + depression, family = "binomial",
data = ibd_demo_all)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.3205 0.7278 -3.188 0.00143 **
ibd_dxUlcerative colitis -0.3894 0.3255 -1.196 0.23161
age 0.0028 0.0101 0.277 0.78165
genderFemale 1.0079 0.3293 3.060 0.00221 **
severe_dx 0.3880 0.3819 1.016 0.30966
active_steroids 1.3863 0.5959 2.326 0.02001 *
anxiety 0.8636 0.3865 2.234 0.02546 *
depression 1.1701 0.4031 2.902 0.00370 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 324.02 on 255 degrees of freedom
Residual deviance: 262.46 on 248 degrees of freedom
AIC: 278.46
Number of Fisher Scoring iterations: 4
broom::glance(fatigue_1 )
broom::tidy(fatigue_1 , exponentiate = TRUE)
tbl_regression(fatigue_1, exponentiate = TRUE) -> facit_f_table
print(facit_f_table)
| Characteristic | OR1 | 95% CI1 | p-value |
|---|---|---|---|
| IBD Diagnosis | |||
|     Crohn's disease | — | — | |
| Â Â Â Â Ulcerative colitis | 0.68 | 0.35, 1.28 | 0.2 |
| Age | 1.00 | 0.98, 1.02 | 0.8 |
| Sex | |||
|     Male | — | — | |
| Â Â Â Â Female | 2.74 | 1.45, 5.30 | 0.002 |
| Moderate-to-Severe IBD | 1.47 | 0.70, 3.17 | 0.3 |
| Active Corticosteroid Use | 4.00 | 1.23, 13.2 | 0.020 |
| Self-Reported Anxiety Diagnosis | 2.37 | 1.10, 5.06 | 0.025 |
| Self-Reported Depression Diagnosis | 3.22 | 1.46, 7.15 | 0.004 |
| 1 OR = Odds Ratio, CI = Confidence Interval | |||
NULL
# C-Statistic/AUROC
Cstat(fatigue_1)
[1] 0.792428
# Model performance
model_performance(fatigue_1)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------
278.458 | 279.041 | 306.820 | 0.231 | 0.413 | 1.000 | 0.513 | -39.230 | 0.015 | 0.661
performance::check_model(fatigue_1)
ibd_demo_all$ibd_f_fatigue <- as.numeric(ibd_demo_all$ibd_f_fatigue)
fatigue_2 <- glm(ibd_f_fatigue ~ ibd_dx + age + gender + severe_dx + active_steroids + anxiety + depression,
family = "binomial",
data = ibd_demo_all)
summary(fatigue_2 )
Call:
glm(formula = ibd_f_fatigue ~ ibd_dx + age + gender + severe_dx +
active_steroids + anxiety + depression, family = "binomial",
data = ibd_demo_all)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.926860 0.809549 -3.615 0.00030 ***
ibd_dxUlcerative colitis -0.009747 0.346603 -0.028 0.97757
age -0.005868 0.010927 -0.537 0.59126
genderFemale 0.970983 0.362487 2.679 0.00739 **
severe_dx 1.054037 0.455741 2.313 0.02073 *
active_steroids 1.203510 0.626871 1.920 0.05487 .
anxiety 0.442700 0.419197 1.056 0.29094
depression 1.355883 0.420178 3.227 0.00125 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 287.92 on 255 degrees of freedom
Residual deviance: 235.30 on 248 degrees of freedom
AIC: 251.3
Number of Fisher Scoring iterations: 5
broom::glance(fatigue_2 )
broom::tidy(fatigue_2 , exponentiate = TRUE)
tbl_regression(fatigue_2, exponentiate = TRUE) -> ibd_f_table
print(ibd_f_table)
| Characteristic | OR1 | 95% CI1 | p-value |
|---|---|---|---|
| IBD Diagnosis | |||
|     Crohn's disease | — | — | |
| Â Â Â Â Ulcerative colitis | 0.99 | 0.50, 1.95 | >0.9 |
| Age | 0.99 | 0.97, 1.02 | 0.6 |
| Sex | |||
|     Male | — | — | |
| Â Â Â Â Female | 2.64 | 1.31, 5.49 | 0.007 |
| Moderate-to-Severe IBD | 2.87 | 1.22, 7.44 | 0.021 |
| Active Corticosteroid Use | 3.33 | 0.93, 11.3 | 0.055 |
| Self-Reported Anxiety Diagnosis | 1.56 | 0.67, 3.51 | 0.3 |
| Self-Reported Depression Diagnosis | 3.88 | 1.71, 8.97 | 0.001 |
| 1 OR = Odds Ratio, CI = Confidence Interval | |||
NULL
# C-Statistic/AUROC
Cstat(fatigue_2)
[1] 0.7871094
# Model performance
model_performance(fatigue_2)
# Indices of model performance
AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
--------------------------------------------------------------------------------------------------------
251.304 | 251.887 | 279.665 | 0.205 | 0.387 | 1.000 | 0.460 | -20.648 | 0.019 | 0.702
performance::check_model(fatigue_2)