OSCR

Association of alcohol use with helmet use in cyclists: analysis of the National Trauma Data Bank.

Code ↔ Paper

7 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 7 matches
  1. [1] § Methods › Study outcomes ↔ 03_Statistical_Analysis.Rmd, lines 244–311 · score 0.99 · deep vein thrombosis, acute respiratory distress, acute kidney injury, cardiac arrest, alcohol withdrawal syndrome, pulmonary embolism
  2. [2] § Results ↔ 03_Statistical_Analysis.Rmd, lines 566–624 · score 0.96 · acute respiratory distress, acute kidney injury, unplanned admission, cardiac arrest, alcohol withdrawal syndrome, unplanned intubation
  3. [3] § Methods › Statistical methods ↔ 04_Feature_Selection.ipynb, lines 90–97 · score 0.85 · fold cross validation, GridSearchCV, feature selection, logistic regression, optimize, hyperparameters
  4. [4] § Methods › Data source and patient selection ↔ 03_Statistical_Analysis.Rmd, lines 325–356 · score 0.68 · BAC screening, 0.08 %, 0.02 %, ethnicity, sex, age
  5. [5] § Results ↔ 03_Statistical_Analysis.Rmd, lines 1077–1136 · score 0.61 · AIS scores, Abdominal, Chest, pelvic, neck, Extremities
  6. [6] § Methods › Data source and patient selection ↔ 04_Feature_Selection.ipynb, lines 28–35 · score 0.55 · PROTDEV_HELMET, numeric, ethnicity, sex, age, race
  7. [7] § Results ↔ 03_Statistical_Analysis.Rmd, lines 907–934 · score 0.53 · risk factors, logistic regression, tobacco, race, disorders, wearing

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R Markdown · 1,277 lines · 47 KB · no license · 5 matches

  1. ---
  2. title: "Statistical_Analysis.Rmd"
  3. author: "Daniel Brock"
  4. date: "8/2/2023"
  5. output: html_document
  6. ---
  7. # 0. Importing Packages and setting working directory
  8. ```{r setup, include=FALSE}
  9. # Packages
  10. library(plyr)
  11. library(tidyverse)
  12. library(finalfit)
  13. library(broom)
  14. library(ggfortify)
  15. library(ggthemes)
  16. library(patchwork)
  17. library(magrittr)
  18. library(forcats)
  19. library(rstatix)
  20. #library(rcompanion)
  21. library(survival)
  22. library(survminer)
  23. library(readxl)
  24. library(writexl)
  25. library(pheatmap)
  26. library(zoo)
  27. library(sjPlot)
  28. library(DHARMa)
  29. # Setting working directory
  30. cwd <- getwd()
  31. ```
  32. # 1. Importing merged trauma dataset from python export
  33. ```{r}
  34. # Importing datasets
  35. trauma <- read_csv(file = paste0(cwd, "/TQP_Processed/trauma_merged.csv"))
  36. comor <- read_csv(file = paste0(cwd, "/TQP_Processed/comorbidities_merged.csv"))
  37. adverse <- read_csv(file = paste0(cwd, "/TQP_Processed/adverse_events_merged.csv"))
  38. ais <- read_csv(file = paste0(cwd, "/TQP_Processed/ais_merged.csv"))
  39. # Calculating total NTDB cases (from python file)
  40. total_cases <- 997970 + 1043736 + 1097190 + 1133053 + 1209097 + 1232956 + 1300735
  41. print(total_cases)
  42. ```
  43. ## 1.1 Viewing the data and dropping important NA rows
  44. ```{r}
  45. # Replacing quote marks in ecodes
  46. trauma$ECODE_DESC <- gsub(pattern = "\"", replacement = "", x = trauma$ECODE_DESC)
  47. # Merging trauma with comorbidities
  48. trauma <- merge(trauma, comor, on = "INC_KEY")
  49. # Merging trauma with adverse events
  50. trauma <- merge(trauma, adverse, on = "INC_KEY")
  51. # Glimpsing
  52. trauma_glimpse <- ff_glimpse(trauma)
  53. trauma_glimpse_continuous <- trauma_glimpse$Continuous
  54. trauma_glimpse_categorical <- trauma_glimpse$Categorical
  55. ```
  56. ## 1.2 Refactoring data for table 1
  57. ```{r}
  58. # Refactoring Sex
  59. trauma <- trauma %>% filter(SEX != 3) %>% mutate(
  60. sex.factor = SEX %>%
  61. factor() %>%
  62. fct_recode("Male" = "1", "Female" = "2") %>%
  63. ff_label("Sex")
  64. )
  65. # Refactoring Age
  66. trauma <- trauma %>%
  67. mutate(
  68. age.factor =
  69. AGEYEARS %>%
  70. cut(breaks = c(0,10,20,30,40,50,60,70,100), include.lowest = TRUE, right = FALSE) %>%
  71. fct_recode(
  72. "0-9" = "[0,10)",
  73. "10-19" = "[10,20)",
  74. "20-29" = "[20,30)",
  75. "30-39" = "[30,40)",
  76. "40-49" = "[40,50)",
  77. "50-59" = "[50,60)",
  78. "60-69" = "[60,70)",
  79. "70+" = "[70,100]",
  80. ) %>%
  81. ff_label("Age (years)")
  82. )
  83. # Refactoring Race
  84. trauma <- trauma %>% mutate(
  85. race.factor = case_when(
  86. ASIAN == 1 ~ "Asian",
  87. PACIFICISLANDER == 1 ~ "Pacific Islander",
  88. RACEOTHER == 1 ~ "Other",
  89. AMERICANINDIAN == 1 ~ "Native American",
  90. BLACK == 1 ~ "Black",
  91. WHITE == 1 ~ "White",
  92. RACE_NA == 1 ~ "NA",
  93. RACE_UK == 1 ~ "NA"
  94. )
  95. )
  96. trauma <- trauma %>% mutate(
  97. race.factor = na_if(race.factor, "NA") %>%
  98. factor(levels = c("White", "Black", "Asian", "Native American", "Pacific Islander", "Other")) %>%
  99. ff_label("Race")
  100. )
  101. # Refactoring Ethnicity
  102. trauma <- trauma %>% mutate(
  103. ethnicity.factor = ETHNICITY %>%
  104. factor() %>%
  105. fct_recode("Hispanic" = "1", "Not Hispanic" = "2") %>%
  106. ff_label("Ethnicity")
  107. )
  108. # Refactoring Helmet Wearing
  109. trauma <- trauma %>% mutate(
  110. helmet.factor = case_when(
  111. PROTDEV_HELMET == 1 & PROTDEV_UK != 1 ~ "Helmet",
  112. PROTDEV_HELMET == 0 & PROTDEV_UK != 1 ~ "No Helmet",
  113. PROTDEV_UK == 1 ~ "NA"
  114. )
  115. )
  116. trauma <- trauma %>% mutate(
  117. helmet.factor = na_if(helmet.factor, "NA") %>%
  118. factor(levels = c("Helmet", "No Helmet")) %>%
  119. ff_label("Helmet Use")
  120. )
  121. # Refactoring hypotension
  122. trauma <- trauma %>% mutate(
  123. SBP = SBP %>% ff_label("SBP mmHg")
  124. )
  125. trauma <- trauma %>% mutate(
  126. sbp.hypo = case_when(
  127. SBP < 90 ~ "Hypotensive",
  128. SBP >= 90 ~ "Not Hypotensive"
  129. ) %>%
  130. ff_label("SBP mmHg <90")
  131. )
  132. # Refactoring TOTALGCS
  133. trauma <- trauma %>% mutate(
  134. TOTALGCS = TOTALGCS %>% ff_label("Total GCS")
  135. )
  136. # Multiple drug use
  137. trauma$total.drugs <- trauma$DRGSCR_AMPHETAMINE + trauma$DRGSCR_BARBITURATE + trauma$DRGSCR_BENZODIAZEPINES + trauma$DRGSCR_COCAINE + trauma$DRGSCR_METHAMPHETAMINE + trauma$DRGSCR_ECSTASY + trauma$DRGSCR_METHADONE + trauma$DRGSCR_OPIOID + trauma$DRGSCR_OXYCODONE + trauma$DRGSCR_PHENCYCLIDINE + trauma$DRGSCR_TRICYCLICDEPRESS + trauma$DRGSCR_CANNABINOID + trauma$DRGSCR_OTHER
  138. # Alcohol use categories
  139. trauma <- trauma %>% mutate(
  140. alcohol.use = case_when(
  141. is.na(ALCOHOLSCREENRESULT) ~ "Not Screened",
  142. ALCOHOLSCREENRESULT < 0.02 & total.drugs == 0 ~ "Sober",
  143. ALCOHOLSCREENRESULT >= 0.02 & ALCOHOLSCREENRESULT < 0.08 & total.drugs == 0 ~ "Impaired",
  144. ALCOHOLSCREENRESULT >= 0.08 & total.drugs == 0 ~ "Intoxicated",
  145. ALCOHOLSCREENRESULT >= 0.08 & total.drugs >= 1 ~ "Multi-Drug"
  146. ) %>%
  147. factor(levels = c("Not Screened", "Sober", "Impaired", "Intoxicated", "Multi-Drug")) %>%
  148. ff_label("Alcohol")
  149. )
  150. # Refactoring Drug use
  151. trauma <- trauma %>%
  152. mutate(
  153. drug.use = case_when(
  154. DRGSCR_NONE == 1 & total.drugs < 1 & ALCOHOLSCREENRESULT < 0.02 ~ "None",
  155. DRGSCR_AMPHETAMINE == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Amphetamine",
  156. DRGSCR_BARBITURATE == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Barbiturate",
  157. DRGSCR_BENZODIAZEPINES == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Benzodiazepines",
  158. DRGSCR_COCAINE == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Cocaine",
  159. DRGSCR_METHAMPHETAMINE == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Methamphetamine",
  160. DRGSCR_ECSTASY == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Ecstasy",
  161. DRGSCR_METHADONE == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Methadone",
  162. DRGSCR_OPIOID == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Opioids",
  163. DRGSCR_OXYCODONE == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Oxycodone",
  164. DRGSCR_PHENCYCLIDINE == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Phencyclidine",
  165. DRGSCR_TRICYCLICDEPRESS == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Tricyclic Antidepressants",
  166. DRGSCR_CANNABINOID == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Cannabis",
  167. DRGSCR_OTHER == 1 & total.drugs == 1 & ALCOHOLSCREENRESULT < 0.02 ~ "Other",
  168. total.drugs >= 2 & ALCOHOLSCREEN < 0.02 ~ "Multiple Drugs",
  169. total.drugs >= 1 & ALCOHOLSCREENRESULT >= 0.02 ~ "Drugs and Alcohol",
  170. TRUE ~ NA_character_ # Add a default value
  171. ) %>%
  172. factor(levels = c("None", "Cannabis", "Amphetamine", "Opioids", "Cocaine", "Benzodiazepines", "Methamphetamine", "Oxycodone", "Barbiturate", "Phencyclidine", "Tricyclic Antidepressants", "Methadone", "Ecstasy", "Drugs and Alcohol", "Other")) %>%
  173. ff_label("Drugs")
  174. )
  175. # Refactoring length of hospital stay
  176. trauma <- trauma %>% mutate(
  177. FINALDISCHARGEDAYS = FINALDISCHARGEDAYS %>% ff_label("Length of Hospital Stay (days)")
  178. )
  179. # Refactoring length of ICU stay
  180. trauma <- trauma %>% mutate(
  181. TOTALICULOS = TOTALICULOS %>% ff_label("Length of ICU Stay (days)")
  182. )
  183. # Refactoring ISS (injury severity score)
  184. trauma <- trauma %>% mutate(
  185. ISS = ISS %>% ff_label("Injury Severity Score")
  186. )
  187. trauma <- trauma %>% mutate(
  188. ISS.factor = ISS %>%
  189. cut(breaks = c(0,3,8,15,24,75), include.lowest = TRUE, right = TRUE) %>%
  190. fct_recode(
  191. "Minor (0-3)" = "[0,3]",
  192. "Moderate (4-8)" = "(3,8]",
  193. "Serious (9-15)" = "(8,15]",
  194. "Severe (16-24)" = "(15,24]",
  195. "Critical (>25)" = "(24,75]"
  196. ) %>%
  197. ff_label("ISS Categories")
  198. )
  199. # Refactoring Comorbidities
  200. trauma <- trauma %>% mutate(
  201. CC_ALCOHOLISM = CC_ALCOHOLISM %>% ff_label("Alcoholism"),
  202. CC_SMOKING = CC_SMOKING %>% ff_label("Smoker"),
  203. CC_SUBSTANCEABUSE = CC_SUBSTANCEABUSE %>% ff_label("Substance Abuse Disorder"),
  204. CC_CHF = CC_CHF %>% ff_label("Congestive Heart Failure"),
  205. CC_RENAL = CC_RENAL %>% ff_label("End Stage Renal Disease"),
  206. CC_DIABETES = CC_DIABETES %>% ff_label("Diabetes"),
  207. CC_HYPERTENSION = CC_HYPERTENSION %>% ff_label("Hypertension"),
  208. CC_COPD = CC_COPD %>% ff_label("COPD"),
  209. CC_BLEEDING = CC_BLEEDING %>% ff_label("Bleeding Disorder"),
  210. CC_ANTICOAGULANT = CC_ANTICOAGULANT %>% ff_label("Anticoagulant Therapy"),
  211. CC_CIRRHOSIS = CC_CIRRHOSIS %>% ff_label("Cirrosis"),
  212. CC_CVA = CC_CVA %>% ff_label("Cerebrovascular Accident"),
  213. CC_MENTALPERSONALITY = CC_MENTALPERSONALITY %>% ff_label("Mental/Personality Disorder")
  214. )
  215. # Refactoring Adverse Events
  216. trauma <- trauma %>% mutate(
  217. HC_ALCOHOLWITHDRAWAL = HC_ALCOHOLWITHDRAWAL %>% ff_label("Alcohol Withdrawal Syndrome"),
  218. HC_CARDARREST = HC_CARDARREST %>% ff_label("Cardiac Arrest"),
  219. HC_DVTHROMBOSIS = HC_DVTHROMBOSIS %>% ff_label("Deep Vein Thrombosis"),
  220. HC_EMBOLISM = HC_EMBOLISM %>% ff_label("Pulmonary Embolism"),
  221. HC_KIDNEY = HC_KIDNEY %>% ff_label("Acute Kidney Injury"),
  222. HC_RESPIRATORY = HC_RESPIRATORY %>% ff_label("Acute Respiratory Distress Syndrome"),
  223. HC_SEPSIS = HC_SEPSIS %>% ff_label("Sepsis"),
  224. HC_STROKECVA = HC_STROKECVA %>% ff_label("Stroke / CVA"),
  225. HC_VAPNEUMONIA = HC_VAPNEUMONIA %>% ff_label("Hosipital-acquired Pneumonia"),
  226. HC_INTUBATION = HC_INTUBATION %>% ff_label("Unplanned Intubation"),
  227. HC_UNPLANNEDICU = HC_UNPLANNEDICU %>% ff_label("Unplanned Admission to ICU"),
  228. HC_RETURNOR = HC_RETURNOR %>% ff_label("Unplanned Return to OR")
  229. )
  230. # Refactoring mortality using pulserate - this is not mortality!
  231. #trauma <- trauma %>% mutate(
  232. # mortality.factor = case_when(
  233. # PULSERATE == 0 ~ "Death",
  234. # PULSERATE != 0 ~ "Alive"
  235. # ) %>%
  236. # factor(levels = c("Death", "Alive")) %>%
  237. # ff_label("Mortality")
  238. #)
  239. # Correctly refactoring mortality using ED and Hospital discharge disposition
  240. alive_dispositions <- c(1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14)
  241. trauma <- trauma %>% mutate(
  242. mortality.total = case_when(
  243. EDDISCHARGEDISPOSITION == 5 | HOSPDISCHARGEDISPOSITION == 5 ~ "Deceased",
  244. EDDISCHARGEDISPOSITION %in% alive_dispositions | HOSPDISCHARGEDISPOSITION %in% alive_dispositions ~ "Alive"
  245. ) %>%
  246. factor(levels = c("Deceased", "Alive")) %>%
  247. ff_label("Total Mortality")
  248. )
  249. trauma <- trauma %>% mutate(
  250. mortality.ED = case_when(
  251. EDDISCHARGEDISPOSITION == 5 ~ "Deceased",
  252. EDDISCHARGEDISPOSITION %in% alive_dispositions ~ "Alive"
  253. ) %>%
  254. factor(levels = c("Deceased", "Alive")) %>%
  255. ff_label("ED Mortality")
  256. )
  257. trauma <- trauma %>% mutate(
  258. mortality.hospital = case_when(
  259. HOSPDISCHARGEDISPOSITION == 5 ~ "Deceased",
  260. HOSPDISCHARGEDISPOSITION %in% alive_dispositions ~ "Alive"
  261. ) %>%
  262. factor(levels = c("Deceased", "Alive")) %>%
  263. ff_label("Hospital Mortality")
  264. )
  265. # Refactoring alcohol withdrawal syndrome
  266. trauma <- trauma %>% mutate(
  267. alc.withdraw.factor = HC_ALCOHOLWITHDRAWAL %>%
  268. factor() %>%
  269. fct_recode("Positive" = "1", "None" = "0") %>%
  270. ff_label("Alcohol Withdrawal Syndrome")
  271. )
  272. # Refactoring Year
  273. trauma <- trauma %>% mutate(
  274. year.factor = Year %>%
  275. factor() %>%
  276. ff_label("Year")
  277. )
  278. ```
  279. ```{r}
  280. # Merging with annotated injury codes and place of injury codes
  281. inj_cause <- read_xlsx("tables/injury_cause_counts_with_descriptions.xlsx")
  282. inj_cause$counts <- NULL
  283. inj_place <- read_xlsx("tables/injury_place_counts_with_descriptions.xlsx")
  284. inj_place$counts <- NULL
  285. trauma <- merge(trauma, y = inj_cause, on = "PRIMARYECODEICD10")
  286. #trauma <- merge(trauma, y = inj_place, on = "PLACEOFINJURYCODE")
  287. ```
  288. ## 1.3 Filtering for NAs in important variables
  289. ```{r}
  290. # Filtering for NAs in selected columns
  291. trauma_filt <- trauma %>% filter_at(vars(sex.factor, age.factor, race.factor, ethnicity.factor, helmet.factor), all_vars(!is.na(.)))
  292. #initial filter included: sex.factor, age.factor, race.factor, ethnicity.factor, helmet.factor, SBP, sbp.hypo, TOTALGCS, FINALDISCHARGEDAYS, ISS, ISS.factor, CC_ALCOHOLISM, CC_SMOKING, CC_SUBSTANCEABUSE, CC_CHF, CC_RENAL, CC_DIABETES, CC_HYPERTENSION, CC_COPD, alc.withdraw.factor, mortality.factor
  293. # Seeing the total number of BAC screens for people with and without other drug use
  294. bac_screens <- trauma_filt %>% mutate(
  295. alcohol.use.total = case_when(
  296. is.na(ALCOHOLSCREENRESULT) ~ "Not Screened",
  297. ALCOHOLSCREENRESULT < 0.02 ~ "Sober",
  298. ALCOHOLSCREENRESULT >= 0.02 & ALCOHOLSCREENRESULT < 0.08 ~ "Impaired",
  299. ALCOHOLSCREENRESULT >= 0.08 ~ "Intoxicated"
  300. ),
  301. alcohol.use.clean = case_when(
  302. is.na(ALCOHOLSCREENRESULT) ~ "Not Screened",
  303. ALCOHOLSCREENRESULT < 0.02 & total.drugs == 0 ~ "Sober",
  304. ALCOHOLSCREENRESULT >= 0.02 & ALCOHOLSCREENRESULT < 0.08 & total.drugs == 0 ~ "Impaired",
  305. ALCOHOLSCREENRESULT >= 0.08 & total.drugs == 0 ~ "Intoxicated",
  306. ALCOHOLSCREENRESULT >= 0.08 & total.drugs >= 0 ~ "Multi-Drug"
  307. )
  308. )
  309. bac_screens_total <- sum(!is.na(bac_screens$alcohol.use.total))
  310. bac_screens_clean <- sum(!is.na(bac_screens$alcohol.use.clean))
  311. print(paste0("Number of total BAC screens in patients with known info: ", bac_screens_total))
  312. print(paste0("Number of filtered alcohol/multi-drug BAC screens in patients with known info: ", bac_screens_clean))
  313. # Filtering for only patients with BAC screens with NO other drug use (clean)
  314. keys_to_keep <- bac_screens[!is.na(bac_screens$alcohol.use.clean), ] %>% pull(INC_KEY)
  315. trauma_filt <- trauma_filt %>% filter(INC_KEY %in% keys_to_keep)
  316. ```
  317. ```{r}
  318. # Optional export to excel
  319. #write_xlsx(trauma_filt, path = paste0(cwd, "/TQP_Processed/trauma_filtered.xlsx"))
  320. ```
  321. # 2. Demographics table for alcohol use
  322. ```{r}
  323. # Table on helmet use
  324. # Explanatory & confounding variables
  325. explanatory <- c("alcohol.use", "motor_vehicle", "sex.factor", "age.factor", "race.factor", "ethnicity.factor")
  326. # Dependent variable of interest
  327. dependent <- "helmet.factor"
  328. table1 <- trauma_filt %>%
  329. summary_factorlist(dependent, explanatory,
  330. cont = "median", p_cont_para = "kruskal.test", p_cat = "chisq", p = TRUE,
  331. add_col_totals = TRUE,
  332. na_include = TRUE)
  333. # Optional export to excel
  334. #write_xlsx(x = table1, path = "tables/table1_demographics.xlsx")
  335. ```
  336. ```{r}
  337. # Table on alcohol use groups
  338. # Explanatory & confounding variables
  339. explanatory <- c("helmet.factor", "motor_vehicle", "sex.factor", "age.factor", "race.factor", "ethnicity.factor")
  340. # Dependent variable of interest
  341. dependent <- "alcohol.use"
  342. table1.1 <- trauma_filt %>%
  343. summary_factorlist(dependent, explanatory,
  344. cont = "median", p_cont_para = "kruskal.test", p_cat = "chisq", p = TRUE,
  345. add_col_totals = TRUE,
  346. na_include = TRUE)
  347. ```
  348. ```{r}
  349. # Pairwise comparison stats with row wise fisher's exact test for Alcohol use
  350. rwf1 <- table(trauma_filt$alcohol.use, trauma_filt$helmet.factor) %>% as.data.frame.matrix()
  351. rwf1 <- rwf1[ , c(2,1)]
  352. pairwiseNominalMatrix(x = table(trauma_filt$alcohol.use, trauma_filt$helmet.factor), compare = "row", fisher = TRUE, chisq = FALSE)
  353. rwf2 <- pairwise_fisher_test(rwf1, p.adjust.method = "fdr", detailed = TRUE)
  354. chisq.test(rwf1)
  355. ```
  356. ```{r}
  357. # Pairwise comparison stats with row wise fisher's exact test for motor vehicle involvement
  358. rwf1 <- table(trauma_filt$motor_vehicle, trauma_filt$helmet.factor) %>% as.data.frame.matrix()
  359. rwf1 <- rwf1[ , c(2,1)]
  360. pairwiseNominalMatrix(x = table(trauma_filt$motor_vehicle, trauma_filt$helmet.factor), compare = "column", fisher = TRUE, chisq = FALSE)
  361. rwf2 <- row_wise_fisher_test(rwf1, p.adjust.method = "fdr", detailed = TRUE)
  362. chisq.test(rwf1)
  363. ```
  364. ```{r}
  365. # Pairwise comparison stats with row wise fisher's exact test for motor vehicle involvement
  366. rwf1 <- table(trauma_filt$alcohol.use, trauma_filt$motor_vehicle) %>% as.data.frame.matrix()
  367. rwf1$unspecified <- NULL
  368. rwf1 <- rwf1[ , c(2,1)]
  369. rwf2 <- row_wise_fisher_test(rwf1, p.adjust.method = "fdr", detailed = TRUE)
  370. rwf3 <- pairwise_fisher_test(rwf1, p.adjust.method = "fdr", detailed = TRUE)
  371. chisq.test(rwf1)
  372. ```
  373. ```{r}
  374. # Pairwise wilcox test on age
  375. pairwise.wilcox.test(trauma_filt$AGEYEARS, trauma_filt$alcohol.use, p.adjust.method = "fdr")
  376. chisq.test(table(trauma_filt$age.factor, trauma_filt$helmet.factor))
  377. ```
  378. ```{r}
  379. # Pairwise comparison stats with sex
  380. rwf1 <- table(trauma_filt$sex.factor, trauma_filt$helmet.factor) %>% as.data.frame.matrix()
  381. rwf1 <- rwf1[ , c(2,1)]
  382. rwf2 <- pairwise_fisher_test(rwf1, p.adjust.method = "fdr", detailed = TRUE)
  383. chisq.test(rwf1)
  384. ```
  385. ```{r}
  386. # Pairwise comparison stats with race
  387. rwf1 <- table(trauma_filt$race.factor, trauma_filt$helmet.factor) %>% as.data.frame.matrix()
  388. rwf1 <- rwf1[ , c(2,1)]
  389. rwf2 <- pairwise_fisher_test(rwf1, p.adjust.method = "fdr", detailed = TRUE)
  390. chisq.test(rwf1)
  391. ```
  392. ```{r}
  393. # Pairwise comparison stats with ethnicity
  394. rwf1 <- table(trauma_filt$ethnicity.factor, trauma_filt$helmet.factor) %>% as.data.frame.matrix()
  395. rwf1 <- rwf1[ , c(2,1)]
  396. rwf2 <- pairwise_fisher_test(rwf1, p.adjust.method = "fdr", detailed = TRUE)
  397. chisq.test(rwf1)
  398. ```
  399. # 3. Clinical presentation and alcohol use groups
  400. ```{r}
  401. # Explanatory & confounding variables
  402. explanatory <- c("mortality.total", "mortality.ED", "mortality.hospital", "FINALDISCHARGEDAYS", "TOTALICULOS", "ISS", "ISS.factor", "TOTALGCS", "SBP", "sbp.hypo", "HC_ALCOHOLWITHDRAWAL", "HC_CARDARREST", "HC_DVTHROMBOSIS", "HC_EMBOLISM", "HC_KIDNEY", "HC_RESPIRATORY", "HC_SEPSIS", "HC_STROKECVA", "HC_VAPNEUMONIA", "HC_INTUBATION", "HC_UNPLANNEDICU", "HC_RETURNOR")
  403. # Dependent variable of interest
  404. dependent <- "alcohol.use" #helmet.factor
  405. table2 <- trauma_filt %>%
  406. summary_factorlist(dependent, explanatory,
  407. cont = "median", p_cont_para = "kruskal.test", p_cat = "chisq", p = TRUE,
  408. add_row_totals = FALSE,
  409. na_include = TRUE)
  410. # Optional export to excel
  411. #write_csv(x = table2, path = paste0(cwd, "/tables/table2_clinical_presentation.csv"))
  412. ```
  413. ```{r}
  414. # Explanatory & confounding variables
  415. explanatory <- c("mortality.total", "mortality.ED", "mortality.hospital", "FINALDISCHARGEDAYS", "TOTALICULOS", "ISS", "ISS.factor", "TOTALGCS", "SBP", "sbp.hypo", "HC_ALCOHOLWITHDRAWAL", "HC_CARDARREST", "HC_DVTHROMBOSIS", "HC_EMBOLISM", "HC_KIDNEY", "HC_RESPIRATORY", "HC_SEPSIS", "HC_STROKECVA", "HC_VAPNEUMONIA", "HC_INTUBATION", "HC_UNPLANNEDICU", "HC_RETURNOR")
  416. # Dependent variable of interest
  417. dependent <- "helmet.factor" #helmet.factor or alcohol.use
  418. table2.1 <- trauma_filt %>%
  419. summary_factorlist(dependent, explanatory,
  420. cont = "median", p_cont_para = "kruskal.test", p_cat = "chisq", p = TRUE,
  421. add_col_totals = TRUE,
  422. na_include = TRUE)
  423. # Optional export to excel
  424. #write_xlsx(x = table2.1, path = "tables/table2_clinical_presentation.xlsx")
  425. ```
  426. ```{r}
  427. # Mortality rates in helmet groups
  428. # Total mortality
  429. rwf1 <- table(trauma_filt$mortality.total, trauma_filt$helmet.factor)
  430. rwf1 <- rwf1[ , c(2,1)]
  431. fisher.test(rwf1)
  432. # ED mortality
  433. rwf1 <- table(trauma_filt$mortality.ED, trauma_filt$helmet.factor)
  434. rwf1 <- rwf1[ , c(2,1)]
  435. fisher.test(rwf1)
  436. # Hospital mortality
  437. rwf1 <- table(trauma_filt$mortality.hospital, trauma_filt$helmet.factor)
  438. rwf1 <- rwf1[ , c(2,1)]
  439. fisher.test(rwf1)
  440. ```
  441. ```{r}
  442. # Length of hospital stay
  443. wilcox.test(x = trauma_filt$FINALDISCHARGEDAYS, g = trauma_filt$helmet.factor)
  444. med_hosp_stay1 <- trauma_filt %>% dplyr::filter(helmet.factor == "Helmet")
  445. med_hosp_stay1 <- mean(med_hosp_stay1$FINALDISCHARGEDAYS, na.rm = TRUE)
  446. med_hosp_stay2 <- trauma_filt %>% dplyr::filter(helmet.factor == "No Helmet")
  447. med_hosp_stay2 <- mean(med_hosp_stay2$FINALDISCHARGEDAYS, na.rm = TRUE)
  448. print(paste0("Mean of Helmeted hospital stay: ", med_hosp_stay1, ". Mean of Non-helmeted hospital stay: ", med_hosp_stay2))
  449. # Length of ICU stay
  450. wilcox.test(x = trauma_filt$TOTALICULOS, g = trauma_filt$helmet.factor)
  451. med_hosp_stay1 <- trauma_filt %>% dplyr::filter(helmet.factor == "Helmet")
  452. med_hosp_stay1 <- mean(med_hosp_stay1$TOTALICULOS, na.rm = TRUE)
  453. med_hosp_stay2 <- trauma_filt %>% dplyr::filter(helmet.factor == "No Helmet")
  454. med_hosp_stay2 <- mean(med_hosp_stay2$TOTALICULOS, na.rm = TRUE)
  455. print(paste0("Mean of Helmeted hospital stay: ", med_hosp_stay1, ". Mean of Non-helmeted hospital stay: ", med_hosp_stay2))
  456. ```
  457. ```{r}
  458. # ISS
  459. wilcox.test(x = trauma_filt$ISS, g = trauma_filt$helmet.factor)
  460. iss_score1 <- trauma_filt %>% dplyr::filter(helmet.factor == "Helmet")
  461. iss_score1 <- mean(iss_score1$ISS, na.rm = TRUE)
  462. iss_score2 <- trauma_filt %>% dplyr::filter(helmet.factor == "No Helmet")
  463. iss_score2 <- mean(iss_score2$ISS, na.rm = TRUE)
  464. print(paste0("Mean of Helmeted ISS: ", iss_score1, ". Mean of Non-helmeted ISS: ", iss_score2))
  465. # Pairwise fisher test for ISS categories
  466. rwf1 <- table(trauma_filt$ISS.factor, trauma_filt$helmet.factor)
  467. rwf1 <- rwf1[, c(2,1)]
  468. rwf2 <- row_wise_fisher_test(xtab = rwf1, p.adjust.method = "fdr", detailed = TRUE)
  469. ```
  470. ```{r}
  471. # Total glasgow coma scale
  472. wilcox.test(TOTALGCS ~ helmet.factor, data = trauma_filt)
  473. ```
  474. ```{r}
  475. # Clinical outcomes
  476. clin_out <- function(tab, outcome, flip = FALSE) {
  477. if (flip == TRUE) {
  478. tab <- tab[, c(2,1)]
  479. }
  480. fish <- fisher.test(tab)
  481. print(outcome)
  482. df <- data.frame("clinical_outcome" = outcome, "p_value" = fish$p.value, "OR" = fish$estimate, "conf_low" = fish$conf.int[1], "conf_high" = fish$conf.int[2])
  483. rownames(df) <- NULL
  484. return(df)
  485. }
  486. # hypotensive - change to tab switch
  487. c1 <- clin_out(tab = table(trauma_filt$sbp.hypo, trauma_filt$helmet.factor), outcome = "Hypotensive", flip = TRUE)
  488. # alcohol withdrawal syndrome
  489. c2 <- clin_out(tab = table(trauma_filt$alc.withdraw.factor, trauma_filt$helmet.factor), outcome = "Alcohol Withdrawal Sydrome")
  490. # cardiac arrest
  491. c3 <- clin_out(tab = table(trauma_filt$HC_CARDARREST, trauma_filt$helmet.factor), outcome = "Cardiac Arrest")
  492. # DVT
  493. c4 <- clin_out(tab = table(trauma_filt$HC_DVTHROMBOSIS, trauma_filt$helmet.factor), outcome = "DVT")
  494. # Pulmonary embolism
  495. c5 <- clin_out(tab = table(trauma_filt$HC_EMBOLISM, trauma_filt$helmet.factor), outcome = "Pulmonary Embolism")
  496. # AKI
  497. c6 <- clin_out(tab = table(trauma_filt$HC_KIDNEY, trauma_filt$helmet.factor), outcome = "Acute Kidney Injury")
  498. # ARDS
  499. c7 <- clin_out(tab = table(trauma_filt$HC_RESPIRATORY, trauma_filt$helmet.factor), outcome = "Acute Respiratory Distress Syndrome")
  500. # Sepsis
  501. c8 <- clin_out(tab = table(trauma_filt$HC_SEPSIS, trauma_filt$helmet.factor), outcome = "Sepsis")
  502. # Stroke / CVA
  503. c9 <- clin_out(tab = table(trauma_filt$HC_STROKECVA, trauma_filt$helmet.factor), outcome = "Stroke / CVA")
  504. # Hospital-aquired pneumonia
  505. c10 <- clin_out(tab = table(trauma_filt$HC_VAPNEUMONIA, trauma_filt$helmet.factor), outcome = "Hospital-aquired pneumonia")
  506. # Unplanned intubation
  507. c11 <- clin_out(tab = table(trauma_filt$HC_INTUBATION, trauma_filt$helmet.factor), outcome = "Unplanned Intubation")
  508. # Unplanned admission to ICU
  509. c12 <- clin_out(tab = table(trauma_filt$HC_UNPLANNEDICU, trauma_filt$helmet.factor), outcome = "Unplanned admission to ICU")
  510. # Unplanned return to OR
  511. c13 <- clin_out(tab = table(trauma_filt$HC_RETURNOR, trauma_filt$helmet.factor), outcome = "Unplanned admission to OR")
  512. # Merging
  513. c <- dplyr::bind_rows(list(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13))
  514. c$OR_CI <- paste0(round(c$OR, 2), " [", round(c$conf_low, 2), "-", round(c$conf_high, 2), "]")
  515. # Exporting to excel
  516. #write_xlsx(x = c, path = "tables/adverse_outcomes_fisher.xlsx")
  517. ```
  518. ```{r}
  519. # Sytolic blood pressure (continuous)
  520. wilcox.test(x = trauma_filt$SBP, g = trauma_filt$helmet.factor)
  521. ```
  522. # 4. Comorbidities and alcohol use groups
  523. ```{r}
  524. # Explanatory & confounding variables
  525. explanatory <- c("CC_ALCOHOLISM", "CC_SMOKING", "CC_SUBSTANCEABUSE", "CC_MENTALPERSONALITY", "CC_CHF", "CC_RENAL", "CC_DIABETES", "CC_HYPERTENSION", "CC_COPD", "CC_BLEEDING", "CC_ANTICOAGULANT", "CC_CIRRHOSIS", "CC_CVA")
  526. # Dependent variable of interest
  527. dependent <- "alcohol.use" #helmet.factor or alcohol.use
  528. table3 <- trauma_filt %>%
  529. summary_factorlist(dependent, explanatory,
  530. cont = "median", p_cont_para = "kruskal.test", p_cat = "chisq", p = TRUE,
  531. add_row_totals = FALSE,
  532. na_include = TRUE)
  533. # Optional export to excel
  534. #write_xlsx(x = table3, path = "tables/table3_comorbidities.xlsx")
  535. ```
  536. ```{r}
  537. # Explanatory & confounding variables
  538. explanatory <- c("CC_ALCOHOLISM", "CC_SMOKING", "CC_SUBSTANCEABUSE", "CC_MENTALPERSONALITY", "CC_CHF", "CC_RENAL", "CC_DIABETES", "CC_HYPERTENSION", "CC_COPD", "CC_BLEEDING", "CC_ANTICOAGULANT", "CC_CIRRHOSIS", "CC_CVA")
  539. # Dependent variable of interest
  540. dependent <- "helmet.factor" #helmet.factor or alcohol.use
  541. table3.1 <- trauma_filt %>%
  542. summary_factorlist(dependent, explanatory,
  543. cont = "median", p_cont_para = "kruskal.test", p_cat = "chisq", p = TRUE,
  544. add_col_totals = TRUE,
  545. na_include = TRUE)
  546. # Optional export to excel
  547. #write_xlsx(x = table3.1, path = "tables/table3_comorbidities.xlsx")
  548. ```
  549. ```{r}
  550. # Comorbidities fishers
  551. # alcohol withdrawal syndrome
  552. d1 <- clin_out(tab = table(trauma_filt$CC_ALCOHOLISM, trauma_filt$helmet.factor), outcome = "Alcohol Use Disorder")
  553. # smoking
  554. d2 <- clin_out(tab = table(trauma_filt$CC_SMOKING, trauma_filt$helmet.factor), outcome = "Tobacco Use Disorder")
  555. # substance use
  556. d3 <- clin_out(tab = table(trauma_filt$CC_SUBSTANCEABUSE, trauma_filt$helmet.factor), outcome = "Substance Use Disorder")
  557. # mental/personality disorder
  558. d4 <- clin_out(tab = table(trauma_filt$CC_MENTALPERSONALITY, trauma_filt$helmet.factor), outcome = "Mental/Personality Disorder")
  559. # congestive heart failure
  560. d5 <- clin_out(tab = table(trauma_filt$CC_CHF, trauma_filt$helmet.factor), outcome = "Congestive heart failure")
  561. # end stage renal disease
  562. d6 <- clin_out(tab = table(trauma_filt$CC_RENAL, trauma_filt$helmet.factor), outcome = "End stage renal disease")
  563. # diabetes
  564. d7 <- clin_out(tab = table(trauma_filt$CC_DIABETES, trauma_filt$helmet.factor), outcome = "Diabetes")
  565. # hypertension
  566. d8 <- clin_out(tab = table(trauma_filt$CC_HYPERTENSION, trauma_filt$helmet.factor), outcome = "Hypertension")
  567. # COPD
  568. d9 <- clin_out(tab = table(trauma_filt$CC_COPD, trauma_filt$helmet.factor), outcome = "COPD")
  569. # bleeding disorder
  570. d10 <- clin_out(tab = table(trauma_filt$CC_BLEEDING, trauma_filt$helmet.factor), outcome = "Bleeding disorder")
  571. # anticoagulant therapy
  572. d11 <- clin_out(tab = table(trauma_filt$CC_ANTICOAGULANT, trauma_filt$helmet.factor), outcome = "Anticoagulant therapy")
  573. # Cirrhosis
  574. d12 <- clin_out(tab = table(trauma_filt$CC_CIRRHOSIS, trauma_filt$helmet.factor), outcome = "Cirrhosis")
  575. # Cerebrovascular attack
  576. d13 <- clin_out(tab = table(trauma_filt$CC_CVA, trauma_filt$helmet.factor), outcome = "Cerebrovascular attack")
  577. # Merging
  578. d <- dplyr::bind_rows(list(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13))
  579. d$OR_CI <- paste0(round(d$OR, 2), " [", round(d$conf_low, 2), "-", round(d$conf_high, 2), "]")
  580. # Exporting to excel
  581. #write_xlsx(x = d, path = "tables/comorbidities_fisher.xlsx")
  582. ```
  583. # 5. Bargraph of helmet usage
  584. ## 5.1 Helmet usage
  585. ```{r}
  586. # Data wrangling
  587. helmet_bar_df <- as.data.frame.matrix(table(trauma_filt$alcohol.use, trauma_filt$helmet.factor))
  588. helmet_bar_df <- tibble::rownames_to_column(helmet_bar_df, var = "alcohol")
  589. helmet_bar_df$alcohol <- factor(helmet_bar_df$alcohol, levels = c("Not Screened", "Sober", "Impaired", "Intoxicated", "Multi-Drug"))
  590. helmet_bar_df$percent <- (helmet_bar_df$Helmet / (helmet_bar_df$Helmet + helmet_bar_df$`No Helmet`)) * 100
  591. helmet_bar_df$percent <- round(helmet_bar_df$percent, digits = 1)
  592. # Barplot
  593. helmet_bar_plot <- helmet_bar_df %>% ggplot(aes(x = alcohol, y = percent, fill = alcohol, color = "black")) +
  594. geom_bar(stat = "identity") +
  595. geom_text(aes(label = percent), vjust = -0.5, size = 4) +
  596. scale_y_continuous(limits = c(0, 50), expand = c(0,0)) +
  597. scale_fill_manual(values = c("black", "#84888e", "#89C5D3", "#FEDBB2", "#E8ACBD")) +
  598. scale_color_manual(values = "black") +
  599. labs(x = "BAC Intoxication Status", y = "Percent Wearing a Helmet (%)", title = "Helmet Usage") +
  600. theme_classic() +
  601. theme(plot.title = element_text(hjust = 0.5, size = 16),
  602. axis.title = element_text(size = 14),
  603. axis.text.x = element_text(size = 12, angle = 45, hjust = 1),
  604. axis.text.y = element_text(size = 12),
  605. legend.position = "none")
  606. print(helmet_bar_plot)
  607. # Optional Save
  608. #ggsave(plot = helmet_bar_plot, filename = "figures/helmet_use_barplot.pdf", width = 1400, height = 1500, dpi = 300, units = "px")
  609. ```
  610. ## 5.2 Motor vehicle involvement
  611. ```{r}
  612. # Data wrangling
  613. helmet_bar_df <- as.data.frame.matrix(table(trauma_filt$alcohol.use, trauma_filt$motor_vehicle))
  614. helmet_bar_df <- tibble::rownames_to_column(helmet_bar_df, var = "alcohol")
  615. helmet_bar_df$alcohol <- factor(helmet_bar_df$alcohol, levels = c("Not Screened", "Sober", "Impaired", "Intoxicated", "Multi-Drug"))
  616. helmet_bar_df$percent <- (helmet_bar_df$yes / (helmet_bar_df$no + helmet_bar_df$unspecified + helmet_bar_df$yes)) * 100
  617. helmet_bar_df$percent <- round(helmet_bar_df$percent, digits = 1)
  618. # Barplot
  619. helmet_bar_plot <- helmet_bar_df %>% ggplot(aes(x = alcohol, y = percent, fill = alcohol, color = "black")) +
  620. geom_bar(stat = "identity") +
  621. geom_text(aes(label = percent), vjust = -0.5, size = 4) +
  622. scale_y_continuous(limits = c(0, 55), expand = c(0,0)) +
  623. scale_fill_manual(values = c("black", "#84888e", "#89C5D3", "#FEDBB2", "#E8ACBD")) +
  624. scale_color_manual(values = "black") +
  625. labs(x = "BAC Intoxication Status", y = "Percent Wearing a Helmet (%)", title = "Helmet Usage") +
  626. theme_classic() +
  627. theme(plot.title = element_text(hjust = 0.5, size = 16),
  628. axis.title = element_text(size = 14),
  629. axis.text.x = element_text(size = 12, angle = 45, hjust = 1),
  630. axis.text.y = element_text(size = 12),
  631. legend.position = "none")
  632. print(helmet_bar_plot)
  633. # Optional Save
  634. #ggsave(plot = helmet_bar_plot, filename = "figures/motor_vehicle_barplot.png", width = 1400, height = 1500, dpi = 300, units = "px")
  635. ```
  636. # 6. Dumbbell plot for comorbidities - start here
  637. ```{r}
  638. # Function to create a comorbidity dataframe for graphing in ggplot
  639. create_comor_df <- function(comorbid_values, comorbidity_title) {
  640. comor_df <- ftable(trauma_filt$alcohol.use, comorbid_values, trauma_filt$helmet.factor)
  641. comor_df <- data.frame(expand.grid(rev(attr(comor_df, "row.vars"))), unclass(comor_df))
  642. comor_df$percent <- (comor_df$X1 / (comor_df$X1 + comor_df$X2)) * 100
  643. colnames(comor_df) <- c("comorbidity", "alcohol", "helmet", "no_helmet", "percent")
  644. comor_df$comorbidity <- plyr::mapvalues(x = comor_df$comorbidity, from = c(0, 1), to = c("no", "yes"))
  645. comor_df$comorbidity <- factor(x = comor_df$comorbidity, levels = c("yes", "no"))
  646. comor_df$alcohol <- factor(x = comor_df$alcohol, levels = c("Not Screened", "Multi-Drug", "Intoxicated", "Impaired", "Sober"))
  647. comor_df$comorbidity_name <- comorbidity_title
  648. return(comor_df)
  649. }
  650. ```
  651. ```{r}
  652. # Calculating population counts for each comorbidity x alcohol intoxication status x helmet use group to find the interaction between addictive comorbidities and alcohol consumption in helmet use rates
  653. comor_alc <- create_comor_df(comorbid_values = trauma_filt$CC_ALCOHOLISM, comorbidity_title = "Alcoholism")
  654. comor_smo <- create_comor_df(comorbid_values = trauma_filt$CC_SMOKING, comorbidity_title = "Smoking")
  655. comor_sub <- create_comor_df(comorbid_values = trauma_filt$CC_SUBSTANCEABUSE, comorbidity_title = "Substance Abuse Disorder")
  656. #comor_men <- create_comor_df(comorbid_values = trauma_filt$CC_MENTALPERSONALITY, comorbidity_title = "Mental/Personality Disorder")
  657. comor_df <- dplyr::bind_rows(comor_alc, comor_smo, comor_sub) #comor_men
  658. comor_df$comorbidity_name <- plyr::mapvalues(x = comor_df$comorbidity_name, from = c("Alcoholism", "Smoking", "Substance Abuse Disorder"), to = c("Alcohol Use Disorder", "Tobacco Use Disorder", "Substance Use Disorder"))
  659. comor_df$comorbidity_name <- factor(comor_df$comorbidity_name, levels = c("Alcohol Use Disorder", "Tobacco Use Disorder", "Substance Use Disorder"))
  660. comor_df$alcohol <- factor(comor_df$alcohol, levels = rev(c("Not Screened", "Sober", "Impaired", "Intoxicated", "Multi-Drug")))
  661. # Dumbbell Plot
  662. comor_dumb_plot <- comor_df %>% ggplot(aes(x = alcohol, y = percent)) +
  663. geom_line() +
  664. geom_point(aes(color = comorbidity), size = 3) +
  665. facet_grid(cols = vars(comorbidity_name)) +
  666. scale_x_discrete(limits = rev) +
  667. scale_color_manual(values = c("#e41a1c", "#367db7")) +
  668. labs(x = "BAC Status", y = "Percent Helmet Wearing (%)", title = "Comorbidities in Alcohol Screening Groups", color = "Comorbidity") +
  669. theme_bw() +
  670. theme(plot.title = element_text(hjust = 0.5, size = 16),
  671. axis.title = element_text(size = 14),
  672. axis.text.x = element_text(size = 10, angle = 45, hjust = 1),
  673. axis.text.y = element_text(size = 10),
  674. strip.background = element_blank(),
  675. strip.text = element_text(size = 12))
  676. comor_dumb_plot
  677. # Optional Save
  678. #ggsave(plot = comor_dumb_plot, filename = "figures/comorbidities_dumbbell.pdf", width = 3000, height = 1500, dpi = 300, units = "px")
  679. ```
  680. ```{r}
  681. # Additional Plot for dumbbell
  682. rate_decline_plot <- comor_df %>% ggplot(aes(x = alcohol, y = percent, group = comorbidity_status, color = comorbidity_status)) +
  683. geom_line() +
  684. geom_point(size = 2) +
  685. scale_x_discrete(limits = rev) +
  686. scale_color_manual(values = c("#3fe1cf", "#367db7", "#0080ff", "#010080", "#fe0903", "#b90e0d", "#e1105d", "#800000")) +
  687. labs(x = "Intoxication Status", y = "Percent Helmet Wearing (%)", title = "Comorbidities in Alcohol Screening Groups", color = "Comorbidity") +
  688. theme_bw() +
  689. theme(plot.title = element_text(hjust = 0.5, size = 16),
  690. axis.title = element_text(size = 14),
  691. axis.text.x = element_text(size = 10),
  692. axis.text.y = element_text(size = 10))
  693. rate_decline_plot
  694. # Optional Save
  695. #ggsave(plot = rate_decline_plot, filename = paste0(cwd, "/figures/rate_decline_plot.pdf"), width = 2200, height = 1500, dpi = 300, units = "px")
  696. ```
  697. ## 6.1 Statistics for dumbell plot - GLM
  698. ```{r}
  699. comor_stats_df <- trauma_filt %>% dplyr::select(ALCOHOLSCREENRESULT, alcohol.use, CC_ALCOHOLISM, CC_SMOKING, CC_SUBSTANCEABUSE, CC_MENTALPERSONALITY, helmet.factor)
  700. comor_stats_df$alcohol.use <- dplyr::recode(comor_stats_df$alcohol.use, "Not Screened" = 0, "Sober" = 1, "Impaired" = 2, "Intoxicated" = 3, "Multi-Drug" = 4)
  701. comor_stats_df$helmet.factor <- dplyr::recode(comor_stats_df$helmet.factor, "Helmet" = 0, "No Helmet" = 1)
  702. # Complete model with all interacting comorbidities
  703. cc_alc_val_glm <- glm(helmet.factor ~ alcohol.use + CC_ALCOHOLISM + CC_SMOKING + CC_SUBSTANCEABUSE, family = binomial(), data = comor_stats_df)
  704. summary(cc_alc_val_glm)
  705. print(exp(coef(cc_alc_val_glm)))
  706. cc_alc_val_glm <- glm(helmet.factor ~ alcohol.use * (CC_ALCOHOLISM + CC_SMOKING + CC_SUBSTANCEABUSE), family = binomial(), data = comor_stats_df)
  707. summary(cc_alc_val_glm)
  708. print(exp(coef(cc_alc_val_glm)))
  709. # GLM alcoholism + alcohol use
  710. cc_alc_glm <- glm(helmet.factor ~ alcohol.use * CC_ALCOHOLISM, family = binomial, data = comor_stats_df)
  711. summary(cc_alc_glm)
  712. print(exp(coef(cc_alc_glm)))
  713. # GLM smoking + alcohol use
  714. cc_smo_glm <- glm(helmet.factor ~ alcohol.use * CC_SMOKING, family = binomial, data = comor_stats_df)
  715. summary(cc_smo_glm)
  716. print(exp(coef(cc_smo_glm)))
  717. # GLM substance use disorder + alcohol use
  718. cc_sud_glm <- glm(helmet.factor ~ alcohol.use * CC_SUBSTANCEABUSE, family = binomial, data = comor_stats_df)
  719. summary(cc_sud_glm)
  720. print(exp(coef(cc_sud_glm)))
  721. ```
  722. ```{r}
  723. # Modeling model correctness with DHARMa
  724. simulationOutput <- simulateResiduals(fittedModel = cc_alc_val_glm)
  725. plot(simulationOutput)
  726. #simulationOutput <- simulateResiduals(fittedModel = cc_alc_glm)
  727. #plot(simulationOutput)
  728. #simulationOutput <- simulateResiduals(fittedModel = cc_smo_glm)
  729. #plot(simulationOutput)
  730. #simulationOutput <- simulateResiduals(fittedModel = cc_sud_glm)
  731. #plot(simulationOutput)
  732. #simulationOutput <- simulateResiduals(fittedModel = cc_mpd_glm)
  733. #plot(simulationOutput)
  734. ```
  735. # 7. Logistic Regression Analysis
  736. ```{r}
  737. # Cleaning the trauma df for logistic regression
  738. trauma_filt_lr <- trauma_filt %>%
  739. select(sex.factor, AGEYEARS, age.factor, race.factor, ethnicity.factor, ALCOHOLSCREENRESULT, alcohol.use, helmet.factor, motor_vehicle,
  740. CC_ALCOHOLISM, CC_SMOKING, CC_SUBSTANCEABUSE) %>%
  741. mutate(
  742. sex.factor = sex.factor %>% factor(levels = c("Female", "Male")) %>% ff_label("Sex"),
  743. ethnicity.factor = ethnicity.factor %>% factor(levels = c("Not Hispanic", "Hispanic")) %>% ff_label("Ethnicity"),
  744. CC_ALCOHOLISM = CC_ALCOHOLISM %>% factor() %>% fct_recode("Negative" = "0", "Positive" = "1") %>% ff_label("Alcohol Use Disorder"),
  745. CC_SMOKING = CC_SMOKING %>% factor() %>% fct_recode("Negative" = "0", "Positive" = "1") %>% ff_label("Tobacco Use Disorder"),
  746. CC_SUBSTANCEABUSE = CC_SUBSTANCEABUSE %>% factor() %>% fct_recode("Negative" = "0", "Positive" = "1") %>% ff_label("Substance Use Disorder"),
  747. AGEYEARS = AGEYEARS %>% ff_label("Age (years)")
  748. )
  749. # Performing Logistic Regression and testing different variables in the model of predicting risk factors of helmet wearing
  750. dependent <- "helmet.factor"
  751. explanatory <- c("AGEYEARS", "sex.factor", "race.factor", "ethnicity.factor", "alcohol.use", "motor_vehicle",
  752. "CC_ALCOHOLISM", "CC_SMOKING", "CC_SUBSTANCEABUSE")
  753. explanatory_multi <- c("AGEYEARS", "race.factor", "ethnicity.factor", "alcohol.use",
  754. "CC_ALCOHOLISM", "CC_SMOKING", "CC_SUBSTANCEABUSE")
  755. logistic_fit <- trauma_filt_lr %>%
  756. finalfit(dependent, explanatory, explanatory_multi, keep_models = TRUE, metrics = TRUE)
  757. logistic_fit1 <- logistic_fit[[1]] %>% as.data.frame()
  758. logistic_fit2 <- logistic_fit[[2]] %>% as.character()
  759. print(logistic_fit2)
  760. ```
  761. ```{r}
  762. # Final logisitic regression to export
  763. dependent <- "helmet.factor"
  764. explanatory <- c("AGEYEARS", "sex.factor", "race.factor", "ethnicity.factor", "alcohol.use", "motor_vehicle",
  765. "CC_ALCOHOLISM", "CC_SMOKING", "CC_SUBSTANCEABUSE")
  766. logistic_fit <- trauma_filt_lr %>%
  767. finalfit(dependent, explanatory, metrics = TRUE)
  768. logistic_fit1 <- logistic_fit[[1]] %>% as.data.frame()
  769. logistic_fit2 <- logistic_fit[[2]] %>% as.character()
  770. print(logistic_fit2)
  771. # Exporting to excel
  772. #write_xlsx(x = logistic_fit1, path = "tables/table5_logistic_regression.xlsx")
  773. ```
  774. ```{r}
  775. # Odds ratio Plot
  776. dependent <- "helmet.factor"
  777. explanatory <- c("AGEYEARS", "sex.factor", "race.factor", "ethnicity.factor", "alcohol.use", "motor_vehicle",
  778. "CC_ALCOHOLISM", "CC_SMOKING", "CC_SUBSTANCEABUSE")
  779. # Exporting a Odds ratio plot
  780. #pdf(file = "figures/logistic_regression_odds_ratio_plot.pdf", height = 6, width = 9)
  781. trauma_filt_lr %>%
  782. or_plot(dependent, explanatory,
  783. remove_ref = TRUE,
  784. breaks = c(0, 1, 2, 3, 4, 5, 6, 7, 8),
  785. table_text_size = 3.5,
  786. title_text_size = 16)
  787. #dev.off()
  788. ```
  789. # 8. Supplemental Data
  790. ## 8.1 Yearly plot to get time-data for COVID
  791. ```{r}
  792. # Function for plotting graphs
  793. line_plotter <- function(df, x_axis, y_axis, x_label, y_label, plot_title) {
  794. line_plot <- df %>%
  795. ggplot(aes(x = x_axis, y = y_axis)) +
  796. geom_line(aes(group=1), size = 1) +
  797. geom_point(size = 2) +
  798. labs(x = x_label, y = y_label, title = plot_title) +
  799. theme_classic() +
  800. theme(plot.title = element_text(hjust = 0.5, size = 22),
  801. strip.background = element_blank(),
  802. strip.text = element_text(size = 14),
  803. axis.text = element_text(size = 14),
  804. axis.title = element_text(size = 16))
  805. return(line_plot)
  806. }
  807. ```
  808. ```{r}
  809. # Getting the number of bike injuries per year
  810. bike_injury_counts <- as.data.frame(table(trauma$Year))
  811. colnames(bike_injury_counts) <- c("Year", "n_count")
  812. # Yearly bike injury frequency (from python)
  813. bike_injury_counts$ntdb_totals <- c(997970, 1043736, 1097190, 1133053, 1209097, 1232956) #2017, 2018, 2019, 2020, 2021, 2022
  814. # Bike Injury frequency over total injuries
  815. bike_injury_counts$bike_freq <- (bike_injury_counts$n_count / bike_injury_counts$ntdb_totals) * 100
  816. # Plotting
  817. bike_injury_counts_plot <- line_plotter(df = bike_injury_counts,
  818. x_axis = bike_injury_counts$Year, y_axis = bike_injury_counts$bike_freq,
  819. x_label = "Year", y_label = "Percent Pedalcylist Injuries",
  820. plot_title = "Pedalcylist Trauma Frequency")
  821. bike_injury_counts_plot
  822. # Optional Save
  823. #ggsave(plot = bike_injury_counts_plot, filename = paste0(cwd, "/figures/yearly_pedalcyclist_trauma_frequency.pdf"), width = 1600, height = 1500, dpi = 300, units = "px")
  824. ```
  825. ```{r}
  826. # Getting the intoxication rate
  827. intox_counts <- as.data.frame.matrix(table(trauma_filt$Year, trauma_filt$alcohol.use))
  828. intox_counts$totals <- rowSums(intox_counts)
  829. intox_counts$intox_freq <- ((intox_counts$Intoxicated + intox_counts$`Multi-Drug`) / intox_counts$totals) * 100 #count both intoxicated & multi-drug groups?
  830. intox_counts <- tibble::rownames_to_column(intox_counts, var = "Year")
  831. # Plotting
  832. intox_freq_plot <- line_plotter(df = intox_counts,
  833. x_axis = intox_counts$Year, y_axis = intox_counts$intox_freq,
  834. x_label = "Year", y_label = "Percent Alcohol Intoxication",
  835. plot_title = "Intoxication Rate per Year")
  836. intox_freq_plot
  837. # Optional Save
  838. #ggsave(plot = intox_freq_plot, filename = paste0(cwd, "/figures/yearly_intoxication_frequency.pdf"), width = 1600, height = 1500, dpi = 300, units = "px")
  839. ```
  840. ```{r}
  841. # Getting the Helmet Use per year
  842. helmet_counts <- as.data.frame.matrix(table(trauma_filt$Year, trauma_filt$helmet.factor))
  843. helmet_counts$totals <- rowSums(helmet_counts)
  844. helmet_counts$helmet_freq <- ((helmet_counts$Helmet) / helmet_counts$totals) * 100
  845. helmet_counts <- tibble::rownames_to_column(helmet_counts, var = "Year")
  846. # Plotting
  847. helmet_freq_plot <- line_plotter(df = helmet_counts,
  848. x_axis = helmet_counts$Year, y_axis = helmet_counts$helmet_freq,
  849. x_label = "Year", y_label = "Percent Helmet Use",
  850. plot_title = "Helmet Use per Year")
  851. helmet_freq_plot
  852. # Optional Save
  853. #ggsave(plot = helmet_freq_plot, filename = paste0(cwd, "/figures/yearly_helmet_use_frequency.pdf"), width = 1600, height = 1500, dpi = 300, units = "px")
  854. ```
  855. ```{r}
  856. # Statistics on yearly intoxication rates
  857. # Dependent variable of interest
  858. dependent <- "year.factor"
  859. # Explanatory & confounding variables
  860. explanatory <- c("alcohol.use", "helmet.factor")
  861. # Table
  862. yearly_table <- trauma_filt %>% summary_factorlist(dependent, explanatory,
  863. p_cat = "chisq", p = TRUE)
  864. ```
  865. ## 8.2 Alcohol AIS analysis
  866. ```{r}
  867. # Filtering for filtered INC codes
  868. ais_filt <- ais[ais$INC_KEY %in% trauma_filt$INC_KEY, ]
  869. ais_filt <- ais_filt[ais_filt$AISSEVERITY != 9, ] #filtering unknown severity scores
  870. # Glimpsing
  871. ais_glimpse <- ff_glimpse(ais_filt)
  872. ais_glimpse_cont <- ais_glimpse[[1]]
  873. ais_glimpse_cat <- ais_glimpse[[2]]
  874. ```
  875. ```{r}
  876. # Labeling AIS scores based on alcohol intoxication levels
  877. alc_unscreened_keys <- trauma_filt %>% filter(alcohol.use == "Not Screened") %>% pull(INC_KEY)
  878. alc_sober_keys <- trauma_filt %>% filter(alcohol.use == "Sober") %>% pull(INC_KEY)
  879. alc_impair_keys <- trauma_filt %>% filter(alcohol.use == "Impaired") %>% pull(INC_KEY)
  880. alc_intox_keys <- trauma_filt %>% filter(alcohol.use == "Intoxicated") %>% pull(INC_KEY)
  881. multi_drug_keys <- trauma_filt %>% filter(alcohol.use == "Multi-Drug") %>% pull(INC_KEY)
  882. # Labeleding AIS scores based on helmet use
  883. helmet_yes_keys <- trauma_filt %>% filter(helmet.factor == "Helmet") %>% pull(INC_KEY)
  884. helmet_no_keys <- trauma_filt %>% filter(helmet.factor == "No Helmet") %>% pull(INC_KEY)
  885. ais_filt <- ais_filt %>% mutate(
  886. alcohol.use = case_when(
  887. INC_KEY %in% alc_unscreened_keys ~ "Not Screened",
  888. INC_KEY %in% alc_sober_keys ~ "Sober",
  889. INC_KEY %in% alc_impair_keys ~ "Impaired",
  890. INC_KEY %in% alc_intox_keys ~ "Intoxicated",
  891. INC_KEY %in% multi_drug_keys ~ "Multi-Drug"
  892. ),
  893. helmet.factor = case_when(
  894. INC_KEY %in% helmet_yes_keys ~ "Helmet",
  895. INC_KEY %in% helmet_no_keys ~ "No Helmet"
  896. )
  897. )
  898. # Filtering for NAs in selected columns
  899. ais_filt <- ais_filt %>% filter_at(vars(AISPREDOT, AISSEVERITY, AISSEVERITY, ISSREGION, alcohol.use, helmet.factor), all_vars(!is.na(.)))
  900. # Refactoring ISS region
  901. ais_filt <- ais_filt %>% mutate(
  902. ISSREGION.factor = ISSREGION %>%
  903. factor() %>%
  904. fct_recode(
  905. "Head & Neck" = "1",
  906. "Chest" = "2",
  907. "Abdominal & Pelvic" = "3",
  908. "Extremities" = "4",
  909. "Face" = "5",
  910. "External" = "6"
  911. ) %>%
  912. ff_label("ISS Region"),
  913. AISSEVERITY = AISSEVERITY %>%
  914. factor() %>%
  915. ff_label("AIS Severity Score"),
  916. alcohol.use = alcohol.use %>%
  917. factor(levels = c("Not Screened", "Sober", "Impaired", "Intoxicated", "Multi-Drug")) %>%
  918. ff_label("Alcohol Use"),
  919. helmet.factor = helmet.factor %>%
  920. factor(levels = c("Helmet", "No Helmet")) %>%
  921. ff_label("Helmet")
  922. )
  923. ais_filt <- ais_filt %>% mutate(
  924. ISSREGION = as.numeric(ISSREGION),
  925. AISSEVERITY = as.numeric(AISSEVERITY)
  926. )
  927. ```
  928. ```{r}
  929. # Filters for mild and severe AIS injury scores
  930. #ais_filt_mild <- ais_filt[ais_filt$AISSEVERITY %in% c("1,", "2"), ]
  931. ais_filt_severe <- ais_filt[ais_filt$AISSEVERITY > 2, ]
  932. # Explanatory & confounding variables
  933. explanatory <- c("ISSREGION.factor", "AISSEVERITY")
  934. # Explanatory variable of interest
  935. dependent <- "helmet.factor" #alcohol.use or helmet.factor
  936. table4.1 <- ais_filt %>%
  937. summary_factorlist(dependent, explanatory,
  938. cont = "mean", p_cont_para = "aov", p_cat = "chisq", p = TRUE, column = TRUE,
  939. add_col_totals = TRUE,
  940. na_include = TRUE)
  941. table4.1$severity <- "All"
  942. table4.2 <- ais_filt_severe %>%
  943. summary_factorlist(dependent, explanatory,
  944. cont = "mean", p_cont_para = "aov", p_cat = "chisq", p = TRUE,
  945. add_col_totals = TRUE,
  946. na_include = TRUE)
  947. table4.2$severity <- "Severe"
  948. table4 <- bind_rows(table4.1, table4.2)
  949. # Optional export to excel
  950. write_xlsx(x = table4, path = "tables/table4_ais.xlsx")
  951. ```
  952. ```{r}
  953. # Fishers test for ISS region - all
  954. rwf1 <- table(ais_filt$ISSREGION.factor, ais_filt$helmet.factor)
  955. rwf1 <- rwf1[, c(2,1)]
  956. chisq.test(rwf1)
  957. rwf2 <- row_wise_fisher_test(rwf1, p.adjust.method = "fdr", detailed = TRUE)
  958. ```
  959. ```{r}
  960. # Fishers test for ISS region - severe
  961. ais_filt2 <- ais_filt[ais_filt$AISSEVERITY > 2, ]
  962. rwf1 <- table(ais_filt2$ISSREGION.factor, ais_filt2$helmet.factor)
  963. rwf1 <- rwf1[, c(2,1)]
  964. chisq.test(rwf1)
  965. rwf2 <- row_wise_fisher_test(rwf1, p.adjust.method = "fdr", detailed = TRUE)
  966. ```
  967. ```{r}
  968. # AIS Severity scores
  969. wilcox.test(AISSEVERITY ~ helmet.factor, data = ais_filt)
  970. s <- ais_filt %>% dplyr::group_by(helmet.factor) %>%
  971. dplyr::summarise(mean_iss = mean(AISSEVERITY))
  972. ```
  973. ```{r}
  974. # Assessing poly-trauma: patients with more than one injury
  975. ais_poly_counts <- ais_filt %>% group_by(INC_KEY, alcohol.use) %>%
  976. dplyr::summarise(poly_trauma = n())
  977. # Explanatory variables
  978. explanatory <- "alcohol.use"
  979. # Explanatory variable of interest
  980. dependent <- "poly_trauma"
  981. # Statistics on AIS poly-trauma counts
  982. ais_poly_table <- ais_poly_counts %>%
  983. summary_factorlist(dependent, explanatory,
  984. cont = "mean", p_cont_para = "aov", p_cat = "chisq", p = TRUE)
  985. # Assessing poly-region-trauma: patients with more than one body region injury
  986. ais_poly_region_counts <- ais_filt %>% group_by(INC_KEY, alcohol.use, ISSREGION.factor) %>%
  987. dplyr::summarise(poly_trauma = n())
  988. ais_poly_region_counts <- ais_poly_region_counts %>% group_by(INC_KEY, alcohol.use) %>%
  989. dplyr::summarise(poly_trauma = n())
  990. # Explanatory variables
  991. explanatory <- "alcohol.use"
  992. # Explanatory variable of interest
  993. dependent <- "poly_trauma"
  994. # Statistics on AIS poly-trauma counts
  995. ais_poly_region_table <- ais_poly_region_counts %>%
  996. summary_factorlist(dependent, explanatory,
  997. cont = "mean", p_cont_para = "aov", p_cat = "chisq", p = TRUE)
  998. # Merging
  999. ais_poly_table$ais_group <- "Total AIS Injuries"
  1000. ais_poly_region_table$ais_group <- "Number of AIS Body Region Injuries"
  1001. ais_poly <- rbind(ais_poly_table, ais_poly_region_table)
  1002. # Exporting
  1003. #write_csv(x = ais_poly, file = paste0(cwd, "/tables/ais_poly-injuries.csv"))
  1004. ```

03_Statistical_Analysis.Rmd at commit f331570, no license · at the source

Overview

Authors: Daniel C Brock1, Gaibo Yan2, Chad T Wilson3, Emanuel Narcis Husu4,5
  1. Medical Scientist Training Program, Baylor College of Medicine, Houston, Texas, USA
  2. The Department of Family Medicine, The University of Tennessee Graduate School of Medicine, Knoxville, Tennessee, USA
  3. Michael E. DeBakey Department of Surgery, Baylor College of Medicine, Houston, Texas, USA
  4. H. Ben Taub Department of Physical Medicine and Rehabilitation, Baylor College of Medicine, Houston, Texas, USA
  5. Department of Clinical Sciences, Chicago Medical School, Rosalind Franklin University of Medicine and Science, North Chicago, Illinois, USA
Journal: Trauma surgery & acute care open, volume 11, issue 2, article e001974
Dates: received 30 June 2025; accepted 1 June 2026; published online 26 June 2026
Type: Research article · Language: English
License: CC BY-NC
Identifiers: DOI 10.1136/tsaco-2025-001974 · PMID 42375761 · PMCID PMC13311654 · OpenAlex W7166197619
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: other condition (population), traumatic brain injury (population), clinical / translational (subfield)
Methods: Statistics, Machine learning
Keywords: helmet, alcoholism, Brain Injuries, Traumatic, Head Injuries, Closed
Topic: Injury Epidemiology and Prevention (Public Health, Environmental and Occupational Health, Medicine), according to OpenAlex
Citations: cited by 1 paper (Europe PMC); 40 references in the paper
Notices: A comment on this paper has been published (42422562, from Europe PMC)

Abstract

Background: Helmet use significantly reduces the risk of traumatic brain injury among cyclists; however, the influence of alcohol use on helmet-wearing adherence remains understudied in large national data sets. The goal of this study was to investigate the relationship between alcohol use and helmet use in injured cyclists.

Methods: This study is a retrospective cross-sectional analysis of 155 766 cyclists with traumatic injuries from the National Trauma Data Bank spanning 8 years (2017–2023). Cyclists were categorized by blood alcohol concentration (BAC) as follows: not screened, sober (BAC <0.02), impaired (BAC 0.02–0.08), intoxicated (BAC ≥0.08), and multidrug intoxicated (BAC ≥0.08 plus ≥1 positive drug screen). The primary outcome was helmet usage. Secondary outcomes included mortality, hospital and intensive care unit length of stay, Injury Severity Score, and adverse events. Comorbid substance use disorders were considered as covariates.

Results: Alcohol use was associated with a dose-response decrease in helmet use. Helmet adherence was 45.9% in sober cyclists (n=51 566), compared with 19.9% in impaired (n=1592), 9.8% in intoxicated (n=8327), and 6.2% in multidrug intoxicated cyclists (n=3823; p<0.001). Alcohol use was associated with higher mortality rates (OR=2.3; p<0.001) and a greater proportion of injuries in the head and neck region (OR=1.4; p<0.001). Alcohol use when cycling was significantly associated with comorbid alcohol, tobacco, and substance use disorders (p<0.001). An interaction effect was observed between alcohol use and comorbid alcohol use disorder, where individuals with a history of alcohol use disorder exhibited a lower baseline helmet use that further declined with increasing BAC.

Conclusions: Alcohol use demonstrated a significant dose-response relationship with helmet non-usage among cyclists, particularly among those with substance use disorders. This relationship represents a critical public safety concern requiring further investigation to address its public health implications.

Level of Evidence: Retrospective Epidemiologic/Prognostic study, Level III.

Reproduced under the paper's license (CC BY-NC), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 7 matches between paragraphs and lines of code.

toofastdan117/TQP_bike_alcohol_helmets

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: f33157079569e2ceb6bb02961eccdb24d23a76cd, 3 September 2026
Languages: Jupyter (3), R (1)
Size: 52 files, 4 scripts
Software Heritage: not archived
Found in: the text, “Statistical methods”
Holds: README, 4 notebooks
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (3 files), pandas (3 files), broom (1 file), patchwork (1 file), pheatmap (1 file), rstatix (1 file), scikit-learn (1 file), survival (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
5 files

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 4 scripts, each with its path and the digest of its content;
  • 7 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability statement

Data may be obtained from a third party and are not publicly available.

Reproduced under the paper's license (CC BY-NC), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 2, 28 September 2026

  • Funding: added Texas Children's Hospital

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 6 keywords, 35 references, 1 integrity notice.

Cite

This paper

Brock, D. C., Yan, G., Wilson, C. T., & Husu, E. N. (2026). Association of alcohol use with helmet use in cyclists: analysis of the National Trauma Data Bank. Trauma surgery & acute care open, 11(2), e001974. https://doi.org/10.1136/tsaco-2025-001974

BibTeX

@article{brock2026association,
author = {Brock, Daniel C and Yan, Gaibo and Wilson, Chad T and Husu, Emanuel Narcis},
title = {{Association of alcohol use with helmet use in cyclists: analysis of the National Trauma Data Bank}},
journal = {Trauma surgery \& acute care open},
year = {2026},
month = jun,
volume = {11},
number = {2},
pages = {e001974},
publisher = {BMJ Publishing Group},
issn = {2397-5776},
doi = {10.1136/tsaco-2025-001974},
url = {https://doi.org/10.1136/tsaco-2025-001974},
pmid = {42375761},
pmcid = {PMC13311654}
}

RIS

TY - JOUR
AU - Brock, Daniel C
AU - Yan, Gaibo
AU - Wilson, Chad T
AU - Husu, Emanuel Narcis
TI - Association of alcohol use with helmet use in cyclists: analysis of the National Trauma Data Bank
T2 - Trauma surgery & acute care open
J2 - Trauma Surg Acute Care Open
PY - 2026
DA - 2026/06/26
VL - 11
IS - 2
SP - e001974
SN - 2397-5776
PB - BMJ Publishing Group
DO - 10.1136/tsaco-2025-001974
UR - https://doi.org/10.1136/tsaco-2025-001974
LA - en
ER -

CSL-JSON

{
"id": "10.1136/tsaco-2025-001974",
"type": "article-journal",
"title": "Association of alcohol use with helmet use in cyclists: analysis of the National Trauma Data Bank",
"container-title": "Trauma surgery & acute care open",
"author": [
{
"family": "Brock",
"given": "Daniel C"
},
{
"family": "Yan",
"given": "Gaibo"
},
{
"family": "Wilson",
"given": "Chad T"
},
{
"family": "Husu",
"given": "Emanuel Narcis"
}
],
"container-title-short": "Trauma Surg Acute Care Open",
"volume": "11",
"issue": "2",
"page": "e001974",
"DOI": "10.1136/tsaco-2025-001974",
"PMID": "42375761",
"PMCID": "PMC13311654",
"ISSN": "2397-5776",
"publisher": "BMJ Publishing Group",
"URL": "https://doi.org/10.1136/tsaco-2025-001974",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
26
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1093/bioinformatics/btag592 [code]
Network-based stratification of allele-specific expression reveals patient subgroups in Huntington's disease.
Journal: Bioinformatics (Oxford, England)
In common: survival, rstatix, broom, 6 other tools, other condition
[2] doi:10.1093/neuonc/noag128 [code]
Spatially-resolved single-cell imaging of melanoma brain metastases identifies localized immune patterns predictive of immune checkpoint blockade response.
Journal: Neuro-oncology
In common: survival, rstatix, pheatmap, 4 other tools, clinical / translational, other condition
[3] doi:10.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: survival, broom, pheatmap, 5 other tools
[4] doi:10.1038/s41586-026-10612-6 [code]
Acquired genetic and cell-state changes in IDH-mutant glioma progression.
Journal: Nature
In common: survival, broom, pheatmap, 4 other tools, other condition
[5] doi:10.1016/j.xcrm.2026.102682 [code]
TET CpG sequence-context-specific DNA demethylation shapes progression of IDH-mutant gliomas.
Journal: Cell reports. Medicine
In common: survival, broom, pheatmap, 4 other tools, other condition
[6] doi:10.1016/j.isci.2026.115657 [code]
Integration of machine learning to develop a disulfidptosis model for predicting glioma prognosis, immunotherapy response, and drug.
Journal: iScience
In common: survival, broom, pheatmap, 3 other tools, clinical / translational, other condition
[7] doi:10.1016/j.cell.2026.05.026 [code]
The critical role of the endogenous immune compartment after CAR T cell therapy in recurrent GBM.
Journal: Cell
In common: survival, rstatix, patchwork, 4 other tools, other condition
[8] doi:10.1073/pnas.2609132123 [code]
A human lysosomal storage disorder toolkit for decoding proteome landscapes in cortical-like and dopaminergic-like induced neurons.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: rstatix, broom, pheatmap, 4 other tools
[9] doi:10.3390/ijms27093997 [code]
Coordinated Multicellular Immune Programs and Drug Targets Revealed by Single-Cell Analysis in Driver-Mutated NSCLC.
Journal: International journal of molecular sciences
In common: survival, rstatix, pheatmap, 2 other tools, other condition
[10] doi:10.1002/imt2.70163 [code]
Spatial multi-omics unveils sphingolipid metabolic reprogramming within the retinal pathological niche.
Journal: iMeta
In common: rstatix, pheatmap, patchwork, 4 other tools

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.