OSCR

Frequency and prognostic outcomes of emergency diagnosis in 13 non-neoplastic conditions in England: A population-based cohort study using linked electronic health records of 1.7 million patients.

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.

5 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 7 matches
  1. [1] § Methods › Study population ↔ C2_run_analyses.Rmd, lines 584 to 633 · score 0.81 · axial spondyloarthritis, rheumatoid arthritis, multiple sclerosis, Lyme disease, coeliac disease, MS · block oscr:b:W411PWTDFH3VH-0 · Report a mismatch
  2. [2] § Results › Association with prognosis ↔ C2_run_analyses.Rmd, lines 584 to 633 · score 0.68 · brain tumours, colon cancer, Lyme disease, coeliac disease, MS, tuberculosis · block oscr:b:W411PWTDFH3VH-0 · Report a mismatch
  3. [3] § Results › Frequency and characteristics of emergency diagnosis ↔ C2_run_analyses.Rmd, lines 635 to 699 · score 0.66 · 31–35, 66–70, pancreatic cancer, Lyme disease, schizophrenia, age · block oscr:b:Y1568E1R1H147-6 · Report a mismatch
  4. [4] § Results › Association with prognosis ↔ C3_report_EDs.Rmd, lines 835 to 910 · score 0.63 · brain tumours, colon cancer, year mortality, emergency diagnosis, tuberculosis, schizophrenia · block oscr:b:JVXGTWCH2QMR8-3 · Report a mismatch
  5. [5] § Results › Association with prognosis ↔ C2_run_analyses.Rmd, lines 701 to 759 · score 0.56 · axial spondyloarthritis, multiple sclerosis, coeliac disease, Parkinson, SBE, PCOS · block oscr:b:ECZZDCTD6K3GD-D · Report a mismatch
  6. [6] § Results › Frequency and characteristics of emergency diagnosis ↔ C3_report_EDs.Rmd, lines 216 to 268 · score 0.54 · 31–35, 66–70, deprivation, pancreatic, schizophrenia, Lyme · block oscr:b:Z98SXTGFQDPXQ-Q · Report a mismatch
  7. [7] § Methods › Statistical analyses ↔ C3_report_EDs.Rmd, lines 216 to 268 · score 0.50 · IMD twentile, 81–90, age, diagnosis · block oscr:b:Z98SXTGFQDPXQ-Q · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R Markdown · 765 lines · 33 KB · MIT · 4 matches

  1. ---
  2. title: "Emergency diagnoses - basic frequency and analyses"
  3. author: "Emma Whitfield"
  4. date: "`r Sys.Date()`"
  5. output: word_document
  6. ---
  7. ```{r setup, include=FALSE}
  8. knitr::opts_chunk$set(echo = TRUE)
  9. library(tidyverse)
  10. library(flextable)
  11. library(gtsummary)
  12. library(lubridate)
  13. library(RMySQL)
  14. library(glue)
  15. library(lmtest)
  16. library(glmmTMB)
  17. library(boot)
  18. source('A0_global_vars_R.R')
  19. sensitivity_analysis <- F # to run sensitivity analysis 1 set to TRUE and offset to FALSE
  20. offset <- F # to run sensitivity analysis 2 set to TRUE and sensitivity_analysis to FALSE
  21. exclude_covid <- F # to exclude potential covid bias on prognosis set to TRUE
  22. td <- today()
  23. results_filepath <- glue("{results_filepath}{td}")
  24. if (!file.exists(results_filepath)) {
  25. dir.create(file.path(results_filepath))
  26. }
  27. if (sensitivity_analysis) {
  28. results_filepath <- glue("{results_filepath}/sensitivity_analysis")
  29. if (!file.exists(results_filepath)) {
  30. dir.create(file.path(results_filepath))
  31. }
  32. }
  33. if (offset) {
  34. results_filepath <- glue("{results_filepath}/offset")
  35. if (!file.exists(results_filepath)) {
  36. dir.create(file.path(results_filepath))
  37. }
  38. }
  39. if (exclude_covid) {
  40. results_filepath <- glue("{results_filepath}/exclude_covid")
  41. if (!file.exists(results_filepath)) {
  42. dir.create(file.path(results_filepath))
  43. }
  44. }
  45. if (sensitivity_analysis) {
  46. ED_defn <- 'emergency hospital admission or A&E attendance'
  47. } else {
  48. ED_defn <- 'emergency hospital admission'
  49. }
  50. ```
  51. ```{r display, echo=FALSE, fig.align = "center", warning = FALSE, message = FALSE, results = "asis", fig.width = 16, fig.height = 12}
  52. if (sensitivity_analysis) {
  53. cat('# Sensitivity analysis\n')
  54. }
  55. if (offset) {
  56. cat('# Offset death\n')
  57. }
  58. if (exclude_covid) {
  59. cat('# Exclude 2019 diagnoses\n')
  60. }
  61. # 1. Useful functions ----
  62. extract_EDs <- function(pln, condition) {
  63. db <- dbConnect(
  64. MySQL(),
  65. host = host,
  66. user = user,
  67. password = password,
  68. dbname = dbname,
  69. port = port
  70. )
  71. # extract patients and followup
  72. pat_query <- dbSendQuery(conn = db,
  73. statement = glue('select * from {sql_schema}.{pln}_{condition}_patients;'))
  74. patients <- fetch(pat_query, n = -1)
  75. dbClearResult(pat_query)
  76. fup_query <- dbSendQuery(conn = db,
  77. statement = glue('select * from {sql_schema}.{pln}_{condition}_admissions;'))
  78. admit <- fetch(fup_query, n = -1)
  79. dbClearResult(fup_query)
  80. if (sensitivity_analysis) {
  81. # also get attendances
  82. fup_query <- dbSendQuery(conn = db,
  83. statement = glue('select * from {sql_schema}.{pln}_{condition}_attends;'))
  84. attend <- fetch(fup_query, n = -1)
  85. dbClearResult(fup_query)
  86. }
  87. launders_query <- dbSendQuery(conn = db,
  88. statement = glue('select * from {sql_schema}.{pln}_{condition}_launders;'))
  89. launders <- fetch(launders_query, n = -1)
  90. dbClearResult(launders_query)
  91. death_query <- dbSendQuery(conn = db,
  92. statement = glue('select * from {sql_schema}.{pln}_{condition}_death;'))
  93. death <- fetch(death_query, n = -1)
  94. dbClearResult(death_query)
  95. dbDisconnect(db)
  96. rm(list = c("pat_query", "fup_query", "launders_query", "death_query"))
  97. patients <- patients %>%
  98. mutate(diagdate = ymd(diagdate),
  99. startdate = ymd(startdate),
  100. enddate = ymd(enddate),
  101. deathdate = ymd(deathdate)) %>%
  102. mutate(imd = as.numeric(imd))
  103. # restrict to only patients diagnosed in relevant periods if needed
  104. if (sensitivity_analysis) {
  105. patients <- patients %>%
  106. filter(diagdate >= ymd('2007-05-01'))
  107. } else if (exclude_covid) {
  108. patients <- patients %>%
  109. filter(diagdate < ymd('2019-01-01'))
  110. }
  111. # make sure there are no extra patients
  112. cases <- unique(patients$patid)
  113. admit <- admit %>%
  114. filter(patid %in% cases)
  115. launders <- launders %>%
  116. filter(patid %in% cases)
  117. death <- death %>%
  118. filter(patid %in% cases)
  119. launders <- launders %>%
  120. mutate(recorddate = ymd(recorddate))
  121. admit <- admit %>%
  122. mutate(admidate = ymd(admidate)) %>%
  123. select(-description)
  124. # add time to diagnosis
  125. admit_ttd <- admit %>%
  126. distinct(patid, admidate, .keep_all = T) %>%
  127. left_join(patients %>% select(patid, diagdate, yob) %>% distinct(), by = join_by(patid)) %>%
  128. mutate(ttd = as.numeric(difftime(diagdate, admidate, units = "days")))
  129. # get emergency event closest to diagnosis for each patient
  130. latest_admit <- admit_ttd %>%
  131. group_by(patid) %>%
  132. summarise(earliest_ttd = min(ttd)) %>%
  133. filter(earliest_ttd <= 30)
  134. # identify ED patients
  135. if (sensitivity_analysis) {
  136. attend <- attend %>%
  137. filter(patid %in% cases)
  138. attend <- attend %>%
  139. mutate(arrivaldate = ymd(arrivaldate)) %>%
  140. select(-aepatgroup)
  141. attend_ttd <- attend %>%
  142. distinct(patid, arrivaldate, .keep_all = T) %>%
  143. left_join(patients %>% select(patid, diagdate, yob) %>% distinct(), by = join_by(patid)) %>%
  144. mutate(ttd = as.numeric(difftime(diagdate, arrivaldate, units = "days")))
  145. latest_attend <- attend_ttd %>%
  146. group_by(patid) %>%
  147. summarise(earliest_ttd = min(ttd)) %>%
  148. filter(earliest_ttd <= 30)
  149. patients_admit <- patients %>%
  150. mutate(ED = patid %in% c(latest_admit$patid, latest_attend$patid))
  151. } else {
  152. patients_admit <- patients %>%
  153. mutate(ED = patid %in% latest_admit$patid)
  154. }
  155. # get comorbidity score at six months before diagnosis date
  156. launders <- launders %>%
  157. filter(ttd >= 180) %>%
  158. group_by(patid) %>%
  159. summarise(comorb_score = n_distinct(comorbidity)) %>%
  160. select(patid, comorb_score)
  161. patients_admit <- patients_admit %>%
  162. left_join(launders, by = join_by(patid)) %>%
  163. mutate(comorb_score = replace_na(comorb_score, 0))
  164. patients_admit <- patients_admit %>%
  165. mutate(diagyear = year(diagdate),
  166. gender = case_when(gender == 1 ~ 'Men',
  167. gender == 2 ~ 'Women',
  168. gender == 3 ~ 'Indeterminate',
  169. gender == 4 ~ 'Unknown',
  170. gender == 0 ~ 'Data not entered',
  171. T ~ as.character(gender)),
  172. diagage = diagyear - yob,
  173. datasource = case_when(str_detect(datasource, 'ons') ~ 'ons',
  174. T ~ datasource)) %>%
  175. select(patid, ED, diagyear, datasource, diagage, gender, comorb_score, imd, diagdate, deathdate)
  176. # append prognosis
  177. patients_admit <- patients_admit %>%
  178. left_join(death, by = join_by(patid))
  179. return(patients_admit)
  180. }
  181. append_hospitalisations <- function(patients_admit, pln, condition) {
  182. db <- dbConnect(
  183. MySQL(),
  184. host = host,
  185. user = user,
  186. password = password,
  187. dbname = dbname,
  188. port = port
  189. )
  190. hosp_query <- dbSendQuery(conn = db,
  191. statement = glue('select * from {sql_schema}.{pln}_{condition}_hosp;'))
  192. hosp_records <- fetch(hosp_query, n = -1)
  193. dbClearResult(hosp_query)
  194. dbDisconnect(db)
  195. rm(hosp_query)
  196. # make sure no extra patients
  197. cases <- unique(patients_admit$patid)
  198. hosp_records <- hosp_records %>%
  199. filter(patid %in% cases)
  200. # prepare hospital counts
  201. # make sure not counting any night twice
  202. hosp_records <- hosp_records %>%
  203. mutate(diagdate = ymd(diagdate),
  204. admidate = ymd(admidate),
  205. discharged = ymd(discharged)) %>%
  206. group_by(patid) %>%
  207. arrange(desc(admidate)) %>%
  208. mutate(next_admission = lag(admidate)) %>%
  209. ungroup() %>%
  210. mutate(admidate = if_else(admidate <= diagdate, diagdate + days(1), admidate),
  211. discharged = if_else(!is.na(next_admission) & (discharged > next_admission), next_admission, discharged),
  212. discharged = if_else(discharged > diagdate + days(365), diagdate + days(365), discharged))
  213. # remove stays that start and end on same day - counting number of nights stayed
  214. hosp_records <- hosp_records %>%
  215. filter(admidate < discharged) %>%
  216. mutate(tih = as.integer(difftime(discharged, admidate, units = "days")))
  217. hosp_summary <- hosp_records %>%
  218. group_by(patid) %>%
  219. summarise(total_tih = sum(tih),
  220. n_admissions = n())
  221. # now add to patients_admit
  222. patients_admit <- patients_admit %>%
  223. left_join(hosp_summary, by = join_by(patid)) %>%
  224. mutate(total_tih = replace_na(total_tih, 0),
  225. n_admissions = replace_na(n_admissions, 0))
  226. return(patients_admit)
  227. }
  228. assess_prognosis <- function(patients_admit, pln, condition) {
  229. # restrict to patients who didn't die on diagnosis date
  230. no_death <- patients_admit %>%
  231. filter((diagdate != deathdate) | is.na(deathdate),
  232. !is.na(imd)) %>%
  233. mutate(datasource = as.factor(datasource),
  234. diagyear = diagyear - 1999)
  235. no_death <- no_death %>%
  236. mutate(death.bin = (!is.na(death)) & (death > 0) & (death <= 365),
  237. death_offset = ifelse(death.bin, death, 365))
  238. # function to bootstrap excess mortality for confidence intervals
  239. excess_mort <- function(data, indices) {
  240. d <- data[indices,]
  241. obs_temp <- d %>%
  242. group_by(ED) %>%
  243. summarise(n.pats = n(),
  244. n.death = sum(death.bin)) %>%
  245. mutate(prop.death = 100*n.death/n.pats)
  246. return(obs_temp$prop.death[obs_temp$ED] - obs_temp$prop.death[!obs_temp$ED])
  247. }
  248. # if main analysis estimate the excess mortality in ED vs non-ED patients
  249. if (!(offset | sensitivity_analysis | exclude_covid)) {
  250. excess_mort_res <- boot(data = no_death, statistic = excess_mort, R = 1000)
  251. excess_mort_ci <- boot.ci(excess_mort_res, type = "norm")
  252. }
  253. # function to bootstrap excess time in hospital
  254. excess_tih <- function(data, indices) {
  255. d <- data[indices,]
  256. obs_temp <- d %>%
  257. group_by(ED) %>%
  258. summarise(mean.time = mean(total_tih))
  259. return(obs_temp$mean.time[obs_temp$ED] - obs_temp$mean.time[!obs_temp$ED])
  260. }
  261. # if main analysis estimate the excess tih in ED vs non-ED patients
  262. if (!(offset | sensitivity_analysis | exclude_covid)) {
  263. excess_tih_res <- boot(data = no_death, statistic = excess_tih, R = 1000)
  264. excess_tih_ci <- boot.ci(excess_tih_res, type = "norm")
  265. }
  266. obs <- no_death %>%
  267. group_by(ED) %>%
  268. summarise(n.pats = n(),
  269. n.death = sum(death.bin),
  270. n.admitted = sum(n_admissions > 0),
  271. mean.admit = mean(n_admissions),
  272. mean.time = mean(total_tih)) %>%
  273. mutate(prop.death = 100*n.death/n.pats,
  274. prop.admitted = 100*n.admitted/n.pats)
  275. # calculate by diagyr but suppress anything for fewer than 10 patients
  276. obs_diagyr <- no_death %>%
  277. group_by(ED, diagyear) %>%
  278. summarise(n.pats = n(),
  279. n.death = sum(death.bin),
  280. n.admitted = sum(n_admissions > 0),
  281. mean.admit = mean(n_admissions),
  282. mean.time = mean(total_tih)) %>%
  283. mutate(prop.death = ifelse(n.death >= 10, 100*n.death/n.pats, NA),
  284. prop.admitted = ifelse(n.admitted >= 10, 100*n.admitted/n.pats, NA),
  285. mean.admit = ifelse(n.admitted >= 10, mean.admit, NA),
  286. mean.time = ifelse(n.admitted >= 10, mean.time, NA))
  287. # fit death models
  288. m1 <- glm(death.bin ~ ED + diagage + diagyear + imd + comorb_score + datasource,
  289. data = no_death,
  290. family = binomial(link = "logit"))
  291. death.int <- exp(confint(m1, "EDTRUE"))
  292. m2 <- glm(death.bin ~ ED,
  293. data = no_death,
  294. family = binomial(link = "logit"))
  295. death.crude.int <- exp(confint(m2, "EDTRUE"))
  296. # fit hospitalisation models
  297. if (offset) {
  298. m3 <- glmmTMB(total_tih ~ ED + diagage + diagyear + imd + comorb_score + datasource + offset(log(death_offset)),
  299. data = no_death,
  300. family = nbinom2)
  301. m4 <- glmmTMB(total_tih ~ ED + offset(log(death_offset)),
  302. data = no_death,
  303. family = nbinom2)
  304. } else {
  305. m3 <- glmmTMB(total_tih ~ ED + diagage + diagyear + imd + comorb_score + datasource,
  306. data = no_death,
  307. family = nbinom2)
  308. m4 <- glmmTMB(total_tih ~ ED,
  309. data = no_death,
  310. family = nbinom2)
  311. }
  312. time.int <- exp(confint(m3, "EDTRUE"))
  313. time.crude.int <- exp(confint(m4, "EDTRUE"))
  314. if (!(offset | sensitivity_analysis | exclude_covid)) {
  315. main_prog <- tibble(n.ED = obs$n.pats[obs$ED], n.EDdeath = obs$n.death[obs$ED], death.obs_true = obs$prop.death[obs$ED], n.NED = obs$n.pats[!obs$ED], n.NEDdeath = obs$n.death[!obs$ED], death.obs_false = obs$prop.death[!obs$ED], death.crude = exp(coef(m2)[2]), death.lowcrude = death.crude.int[1], death.upcrude = death.crude.int[2], death = exp(coef(m1)[2]), death.low = death.int[1], death.up = death.int[2], excess.mort = excess_mort_res$t0, excess.lowmort = excess_mort_ci$normal[2], excess.upmort = excess_mort_ci$normal[3], n.EDadmitted = obs$n.admitted[obs$ED], perc.EDadmitted = obs$prop.admitted[obs$ED], time.obs_true = obs$mean.time[obs$ED], n.NEDadmitted = obs$n.admitted[!obs$ED], perc.NEDadmitted = obs$prop.admitted[!obs$ED], time.obs_false = obs$mean.time[!obs$ED], time.crude = time.crude.int[3], time.lowcrude = time.crude.int[1], time.upcrude = time.crude.int[2], time = time.int[3], time.low = time.int[1], time.up = time.int[2], excess.tih = excess_tih_res$t0, excess.lowtih = excess_tih_ci$normal[2], excess.uptih = excess_tih_ci$normal[3])
  316. } else {
  317. main_prog <- tibble(n.ED = obs$n.pats[obs$ED], n.EDdeath = obs$n.death[obs$ED], death.obs_true = obs$prop.death[obs$ED], n.NED = obs$n.pats[!obs$ED], n.NEDdeath = obs$n.death[!obs$ED], death.obs_false = obs$prop.death[!obs$ED], death.crude = exp(coef(m2)[2]), death.lowcrude = death.crude.int[1], death.upcrude = death.crude.int[2], death = exp(coef(m1)[2]), death.low = death.int[1], death.up = death.int[2], n.EDadmitted = obs$n.admitted[obs$ED], perc.EDadmitted = obs$prop.admitted[obs$ED], time.obs_true = obs$mean.time[obs$ED], n.NEDadmitted = obs$n.admitted[!obs$ED], perc.NEDadmitted = obs$prop.admitted[!obs$ED], time.obs_false = obs$mean.time[!obs$ED], time.crude = time.crude.int[3], time.lowcrude = time.crude.int[1], time.upcrude = time.crude.int[2], time = time.int[3], time.low = time.int[1], time.up = time.int[2])
  318. }
  319. return(list("main_prog" = main_prog, "diagyr_prog" = obs_diagyr))
  320. }
  321. assess_gender_prognosis <- function(patients_admit) {
  322. # compare gender association with death
  323. # restrict to patients who didn't die on diagnosis date
  324. no_death <- patients_admit %>%
  325. filter((diagdate != deathdate) | is.na(deathdate),
  326. !is.na(imd)) %>%
  327. mutate(datasource = as.factor(datasource),
  328. diagyear = diagyear - 1999)
  329. if (sum(!is.na(no_death$death) & (no_death$death < 0))) {
  330. errorCondition('Patient has deathdate before emergency diagnosis')
  331. }
  332. no_death <- no_death %>%
  333. mutate(death.bin = (!is.na(death)) & (death > 0) & (death <= 365),
  334. death_offset = ifelse(death.bin, death, 365))
  335. m1 <- glm(death.bin ~ ED + gender*(diagage + diagyear + imd + comorb_score + datasource),
  336. data = no_death,
  337. family = binomial(link = "logit"))
  338. m2 <- glm(death.bin ~ gender*(ED + diagage + diagyear + imd + comorb_score + datasource),
  339. data = no_death,
  340. family = binomial(link = "logit"))
  341. death.test <- lrtest(m1, m2)
  342. if (offset) {
  343. m3 <- glmmTMB(total_tih ~ ED + gender*(diagage + diagyear + imd + comorb_score + datasource) + offset(log(death_offset)),
  344. data = no_death,
  345. family = nbinom2)
  346. m4 <- glmmTMB(total_tih ~ gender*(ED + diagage + diagyear + imd + comorb_score + datasource) + offset(log(death_offset)),
  347. data = no_death,
  348. family = nbinom2)
  349. } else {
  350. m3 <- glmmTMB(total_tih ~ ED + gender*(diagage + diagyear + imd + comorb_score + datasource),
  351. data = no_death,
  352. family = nbinom2)
  353. m4 <- glmmTMB(total_tih ~ gender*(ED + diagage + diagyear + imd + comorb_score + datasource),
  354. data = no_death,
  355. family = nbinom2)
  356. }
  357. hosp.test <- lrtest(m3, m4)
  358. return(tibble(death.p = death.test$`Pr(>Chisq)`[2], hosp.p = hosp.test$`Pr(>Chisq)`[2]))
  359. }
  360. # 2. Loop to process data ----
  361. res <- tibble(gender = c(), pln = c(), condition = c(), ED = c(), n.pats = c(), ED.p = c())
  362. timeres <- tibble(gender = c(), pln = c(), condition = c(), diagyear = c(), prop = c(), low.ci = c(), up.ci = c())
  363. ageres <- tibble(gender = c(), pln = c(), condition = c(), diagage = c(), prop = c(), low.ci = c(), up.ci = c())
  364. imdres <- tibble(gender = c(), pln = c(), condition = c(), imd = c(), prop = c(), low.ci = c(), up.ci = c())
  365. prognosis <- tibble(gender = c(), pln = c(), condition = c(), n.ED = c(), n.EDdeath = c(), death.obs_true = c(), n.NED = c(), n.NEDdeath = c(), death.obs_false = c(), death.crude = c(), death.lowcrude = c(), death.upcrude = c(), death = c(), death.low = c(), death.up = c(), excess.mort = c(), excess.lowmort = c(), excess.upmort = c(), n.EDadmitted = c(), perc.EDadmitted = c(), time.obs_true = c(), n.NEDadmitted = c(), perc.NEDadmitted = c(), time.obs_false = c(), time.crude = c(), time.lowcrude = c(), time.upcrude = c(), time = c(), time.low = c(), time.up = c(), excess.tih = c(), excess.lowtih = c(), excess.uptih = c())
  366. diagyr_prognosis <- tibble(gender = c(), pln = c(), condition = c(), diagyear = c(), ED = c(), n.pats = c(), n.death = c(), n.admitted = c(), prop.death = c(), prop.admitted = c(), mean.admit = c(), mean.time = c())
  367. gender_diffs <- tibble(pln = c(), condition = c(), death.p = c(), hosp.p = c())
  368. tidy_res <- function(patients_admit, group_var, cond1, pln1) {
  369. patients_admit %>%
  370. group_by({{group_var}}, gender) %>%
  371. summarise(prop = 100*mean(ED, na.rm = T),
  372. low.ci = 100*prop.test(sum(ED), n())$conf.int[1],
  373. up.ci = 100*prop.test(sum(ED), n())$conf.int[2],
  374. n.ED = sum(ED),
  375. n.pats = n()) %>%
  376. mutate(condition = cond1,
  377. pln = pln1)
  378. }
  379. for (cond in conditions) {
  380. cat("# ", cond, "\n")
  381. for (plnx in c('gold', 'aurum')) {
  382. cat("## ", plnx, "\n")
  383. patients_admit <- extract_EDs(plnx, cond)
  384. patients_admit <- append_hospitalisations(patients_admit, plnx, cond)
  385. # ED frequency and trends
  386. if (!(cond %in% c('ovarian_cancer', 'PCOS'))) {
  387. patients_admit <- patients_admit %>%
  388. filter(gender %in% c('Men', 'Women'))
  389. # compare ED frequency
  390. EDcross <- table(patients_admit$ED, patients_admit$gender)
  391. EDp <- chisq.test(EDcross)
  392. if (any(EDp$expected < 5)) {
  393. cat("Warning - ", cond, "EP chi-sq has values less than 5")
  394. knitr::kable(EDp$expected)
  395. }
  396. temp_res <- patients_admit %>%
  397. group_by(gender) %>%
  398. summarise(ED = sum(ED),
  399. n.pats = n_distinct(patid)) %>%
  400. mutate(condition = cond,
  401. pln = plnx,
  402. ED.p = EDp$p.value)
  403. gender_diffs <- gender_diffs %>%
  404. rbind(assess_gender_prognosis(patients_admit) %>%
  405. mutate(condition = cond,
  406. pln = plnx))
  407. } else {
  408. temp_res <- patients_admit %>%
  409. group_by(gender) %>%
  410. summarise(ED = sum(ED),
  411. n.pats = n_distinct(patid)) %>%
  412. mutate(condition = cond,
  413. pln = plnx,
  414. ED.p = NA)
  415. }
  416. res <- res %>%
  417. rbind(temp_res)
  418. timeres <- timeres %>%
  419. rbind(tidy_res(patients_admit, diagyear, cond, plnx))
  420. ageres <- ageres %>%
  421. rbind(tidy_res(patients_admit %>%
  422. mutate(age_group = case_match(diagage,
  423. seq(0, 15) ~ "< 16",
  424. seq(16, 20) ~ "16-20",
  425. seq(21, 25) ~ "21-25",
  426. seq(26, 30) ~ "26-30",
  427. seq(31, 35) ~ "31-35",
  428. seq(36, 40) ~ "36-40",
  429. seq(41, 45) ~ "41-45",
  430. seq(46, 50) ~ "46-50",
  431. seq(51, 55) ~ "51-55",
  432. seq(56, 60) ~ "56-60",
  433. seq(61, 65) ~ "61-65",
  434. seq(66, 70) ~ "66-70",
  435. seq(71, 75) ~ "71-75",
  436. seq(76, 80) ~ "76-80",
  437. seq(81, 90) ~ "81-90",
  438. .default = "> 90")),
  439. age_group, cond, plnx))
  440. imdres <- imdres %>%
  441. rbind(tidy_res(patients_admit, imd, cond, plnx))
  442. for (gen in c('Men', 'Women')) {
  443. if (cond %in% c('ovarian_cancer', 'PCOS') & (gen == "Men")) next
  444. # patient characteristics
  445. cat("### ", gen, "\n")
  446. t <- patients_admit %>%
  447. filter(gender == gen) %>%
  448. mutate(imd5 = case_when(imd %in% seq(1, 4) ~ '1 - Least deprived',
  449. imd %in% seq(5, 8) ~ '2',
  450. imd %in% seq(9, 12) ~ '3',
  451. imd %in% seq(13, 16) ~ '4',
  452. imd %in% seq(17, 20) ~ '5 - Most deprived',
  453. T ~ as.character(imd))) %>%
  454. select(ED, diagage, comorb_score, imd5, datasource) %>%
  455. tbl_summary(by = ED,
  456. type = all_continuous() ~ "continuous2",
  457. statistic = list(
  458. all_continuous() ~ c("{mean} ({sd})", "{median} ({p25}, {p75})"),
  459. all_categorical() ~ "{n} ({p}%)"
  460. ),
  461. digits = list(all_continuous() ~ 1,
  462. all_categorical() ~ 1),
  463. label = list(diagage = "Age at diagnosis", comorb_score = "Comorbidity score", imd5 = "IMD quintile", datasource = "Source of diagnosis")) %>%
  464. add_n()
  465. cat("\n")
  466. cat(knitr::knit_print(t))
  467. # prognosis
  468. tmp_prog <- assess_prognosis(patients_admit %>%
  469. filter(gender == gen),
  470. plnx, cond)
  471. prognosis <- prognosis %>%
  472. rbind(tmp_prog$main_prog %>%
  473. mutate(gender = gen,
  474. condition = cond,
  475. pln = plnx))
  476. diagyr_prognosis <- diagyr_prognosis %>%
  477. rbind(tmp_prog$diagyr_prog %>%
  478. mutate(gender = gen,
  479. condition = cond,
  480. pln = plnx))
  481. }
  482. }
  483. }
  484. # clean up tables
  485. res <- res %>%
  486. rowwise() %>%
  487. mutate(prop = 100*prop.test(ED, n.pats)$estimate,
  488. low.ci = 100*prop.test(ED, n.pats)$conf.int[1],
  489. up.ci = 100*prop.test(ED, n.pats)$conf.int[2]) %>%
  490. mutate(s = glue("{signif(prop, 3)}% ({signif(low.ci, 3)}%, {signif(up.ci, 3)}%) {ED.p}")) %>%
  491. mutate(condition = case_match(condition,
  492. "AS" ~ "Axial spondyloarthritis",
  493. "brain_tumours" ~ "Brain tumours",
  494. "CHD" ~ "CHD",
  495. "COPD" ~ "COPD",
  496. "IBD" ~ "IBD",
  497. "MS" ~ "Multiple sclerosis",
  498. "PCOS" ~ "PCOS",
  499. "RA" ~ "Rheumatoid arthritis",
  500. "SBE" ~ "SBE",
  501. "TB" ~ "Tuberculosis",
  502. "celiac" ~ "Coeliac disease",
  503. "colon_cancer" ~ "Colon cancer",
  504. "lung_cancer" ~ "Lung cancer",
  505. "lyme" ~ "Lyme disease",
  506. "ovarian_cancer" ~ "Ovarian cancer",
  507. "pancreatic_cancer" ~ "Pancreatic cancer",
  508. "parkinsons" ~ "Parkinson's disease",
  509. "schizophrenia" ~ "Schizophrenia"))
  510. timeres <- timeres %>%
  511. mutate(grp = case_match(condition,
  512. c("AS", "brain_tumours", "celiac", "CHD", "colon_cancer", "COPD", "IBD", "lung_cancer", "lyme") ~ "1",
  513. .default = "2"),
  514. condition = case_match(condition,
  515. "AS" ~ "Axial spondyloarthritis",
  516. "brain_tumours" ~ "Brain tumours",
  517. "CHD" ~ "CHD",
  518. "COPD" ~ "COPD",
  519. "IBD" ~ "IBD",
  520. "MS" ~ "Multiple sclerosis",
  521. "PCOS" ~ "PCOS",
  522. "RA" ~ "Rheumatoid arthritis",
  523. "SBE" ~ "SBE",
  524. "TB" ~ "Tuberculosis",
  525. "celiac" ~ "Coeliac disease",
  526. "colon_cancer" ~ "Colon cancer",
  527. "lung_cancer" ~ "Lung cancer",
  528. "lyme" ~ "Lyme disease",
  529. "ovarian_cancer" ~ "Ovarian cancer",
  530. "pancreatic_cancer" ~ "Pancreatic cancer",
  531. "parkinsons" ~ "Parkinson's disease",
  532. "schizophrenia" ~ "Schizophrenia"))
  533. ageres <- ageres %>%
  534. mutate(age_group = factor(age_group, levels = c("< 16", "16-20", "21-25", "26-30", "31-35", "36-40", "41-45", "46-50", "51-55", "56-60", "61-65", "66-70", "71-75", "76-80", "81-90", "> 90"), ordered = T)) %>%
  535. mutate(age_mid = case_match(age_group,
  536. "< 16" ~ 8,
  537. "16-20" ~ 18,
  538. "21-25" ~ 23,
  539. "26-30" ~ 28,
  540. "31-35" ~ 33,
  541. "36-40" ~ 38,
  542. "41-45" ~ 43,
  543. "46-50" ~ 48,
  544. "51-55" ~ 53,
  545. "56-60" ~ 58,
  546. "61-65" ~ 63,
  547. "66-70" ~ 68,
  548. "71-75" ~ 73,
  549. "76-80" ~ 78,
  550. "81-90" ~ 85,
  551. "> 90" ~ 95),
  552. grp = case_match(condition,
  553. c("AS", "brain_tumours", "celiac", "CHD", "colon_cancer", "COPD", "IBD", "lung_cancer", "lyme") ~ "1",
  554. .default = "2"),
  555. condition = case_match(condition,
  556. "AS" ~ "Axial spondyloarthritis",
  557. "brain_tumours" ~ "Brain tumours",
  558. "CHD" ~ "CHD",
  559. "COPD" ~ "COPD",
  560. "IBD" ~ "IBD",
  561. "MS" ~ "Multiple sclerosis",
  562. "PCOS" ~ "PCOS",
  563. "RA" ~ "Rheumatoid arthritis",
  564. "SBE" ~ "SBE",
  565. "TB" ~ "Tuberculosis",
  566. "celiac" ~ "Coeliac disease",
  567. "colon_cancer" ~ "Colon cancer",
  568. "lung_cancer" ~ "Lung cancer",
  569. "lyme" ~ "Lyme disease",
  570. "ovarian_cancer" ~ "Ovarian cancer",
  571. "pancreatic_cancer" ~ "Pancreatic cancer",
  572. "parkinsons" ~ "Parkinson's disease",
  573. "schizophrenia" ~ "Schizophrenia"))
  574. imdres <- imdres %>%
  575. mutate(grp = case_match(condition,
  576. c("AS", "brain_tumours", "celiac", "CHD", "colon_cancer", "COPD", "IBD", "lung_cancer", "lyme") ~ "1",
  577. .default = "2"),
  578. condition = case_match(condition,
  579. "AS" ~ "Axial spondyloarthritis",
  580. "brain_tumours" ~ "Brain tumours",
  581. "CHD" ~ "CHD",
  582. "COPD" ~ "COPD",
  583. "IBD" ~ "IBD",
  584. "MS" ~ "Multiple sclerosis",
  585. "PCOS" ~ "PCOS",
  586. "RA" ~ "Rheumatoid arthritis",
  587. "SBE" ~ "SBE",
  588. "TB" ~ "Tuberculosis",
  589. "celiac" ~ "Coeliac disease",
  590. "colon_cancer" ~ "Colon cancer",
  591. "lung_cancer" ~ "Lung cancer",
  592. "lyme" ~ "Lyme disease",
  593. "ovarian_cancer" ~ "Ovarian cancer",
  594. "pancreatic_cancer" ~ "Pancreatic cancer",
  595. "parkinsons" ~ "Parkinson's disease",
  596. "schizophrenia" ~ "Schizophrenia"))
  597. prognosis <- prognosis %>%
  598. left_join(gender_diffs, by = join_by(condition, pln)) %>%
  599. mutate(condition = case_match(condition,
  600. "AS" ~ "Axial spondyloarthritis",
  601. "brain_tumours" ~ "Brain tumours",
  602. "CHD" ~ "CHD",
  603. "COPD" ~ "COPD",
  604. "IBD" ~ "IBD",
  605. "MS" ~ "Multiple sclerosis",
  606. "PCOS" ~ "PCOS",
  607. "RA" ~ "Rheumatoid arthritis",
  608. "SBE" ~ "SBE",
  609. "TB" ~ "Tuberculosis",
  610. "celiac" ~ "Coeliac disease",
  611. "colon_cancer" ~ "Colon cancer",
  612. "lung_cancer" ~ "Lung cancer",
  613. "lyme" ~ "Lyme disease",
  614. "ovarian_cancer" ~ "Ovarian cancer",
  615. "pancreatic_cancer" ~ "Pancreatic cancer",
  616. "parkinsons" ~ "Parkinson's disease",
  617. "schizophrenia" ~ "Schizophrenia"))
  618. diagyr_prognosis <- diagyr_prognosis %>%
  619. mutate(grp = case_match(condition,
  620. c("AS", "brain_tumours", "celiac", "CHD", "colon_cancer", "COPD", "IBD", "lung_cancer", "lyme") ~ "1",
  621. .default = "2"),
  622. condition = case_match(condition,
  623. "AS" ~ "Axial spondyloarthritis",
  624. "brain_tumours" ~ "Brain tumours",
  625. "CHD" ~ "CHD",
  626. "COPD" ~ "COPD",
  627. "IBD" ~ "IBD",
  628. "MS" ~ "Multiple sclerosis",
  629. "PCOS" ~ "PCOS",
  630. "RA" ~ "Rheumatoid arthritis",
  631. "SBE" ~ "SBE",
  632. "TB" ~ "Tuberculosis",
  633. "celiac" ~ "Coeliac disease",
  634. "colon_cancer" ~ "Colon cancer",
  635. "lung_cancer" ~ "Lung cancer",
  636. "lyme" ~ "Lyme disease",
  637. "ovarian_cancer" ~ "Ovarian cancer",
  638. "pancreatic_cancer" ~ "Pancreatic cancer",
  639. "parkinsons" ~ "Parkinson's disease",
  640. "schizophrenia" ~ "Schizophrenia"))
  641. # save all analysis results as csvs
  642. if (!offset) {
  643. write_csv(res, glue('{results_filepath}/res.csv'))
  644. write_csv(timeres, glue('{results_filepath}/timeres.csv'))
  645. write_csv(ageres, glue('{results_filepath}/ageres.csv'))
  646. write_csv(imdres, glue('{results_filepath}/imdres.csv'))
  647. write_csv(diagyr_prognosis, glue('{results_filepath}/diagyear_prognosis.csv'))
  648. }
  649. write_csv(prognosis, glue('{results_filepath}/prognosis.csv'))
  650. cat(glue('\nAll results saved at {results_filepath}'))
  651. cat('\nPlease update analysis_dt in A0_global_vars_R.R accordingly \n')
  652. ```
  653. ```{r session_info, echo=FALSE, message = FALSE, results = "asis"}
  654. cat('# Session information\n')
  655. print(sessionInfo())
  656. ```

C2_run_analyses.Rmd at commit a082a9d, under MIT · at the source

Overview

  1. ECHO (Epidemiology of Cancer Healthcare & Outcomes), Department of Behavioural Science and Health, Institute of Epidemiology and Health Care, UCL (University College London), London, United Kingdom
  2. Department of General Practice and Primary Care, University of Melbourne, Melbourne, Australia
  3. Cancer Intelligence, Cancer Research UK, London, United Kingdom
  4. Safety, Quality & Well-Being Institute, Houston Methodist, Houston, Texas, United States of America
  5. National Disease Registration Service, NHS England, Leeds, United Kingdom
  6. Institute of Health Informatics, UCL, London, United Kingdom
  7. Interdisciplinary Transformation University, Linz, Austria
  8. Health Data Research UK, London, United Kingdom
  9. UCL Hospitals Biomedical Research Centre, London, United Kingdom
  10. British Heart Foundation Data Science Centre, London, United Kingdom
Institutions: University College London (United Kingdom); The University of Melbourne (Australia); Cancer Research UK (United Kingdom); Houston Methodist (United States); NHS England (United Kingdom); British Heart Foundation (United Kingdom); UCL Biomedical Research Centre (United Kingdom); Health Data Research UK (United Kingdom); Interdisciplinary Transformation University Austria (Austria)
Journal: PLoS medicine, volume 23, issue 8, article e1005182
Dates: received 5 January 2026; accepted 3 July 2026; published online 25 August 2026
Type: Research article · Language: English
License: none stated
Identifiers: DOI 10.1371/journal.pmed.1005182 · PMID 42640879 · PMCID PMC13505939 · OpenAlex W7204193769
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: other (modality), human (organism), clinical / translational (subfield)
Methods: Machine learning, Statistics
MeSH: Electronic Health Records*, Emergency Service, Hospital*, Noncommunicable Diseases*, Adolescent, Adult, Aged, Aged, 80 and over, Child, Cohort Studies, Emergency Room Visits, England, Female, Humans, Male, Middle Aged, Prognosis, Young Adult (* major topic)
Topic: Hematological disorders and diagnostics (Hematology, Medicine), according to OpenAlex
Funding: Wellcome Trust (218529/Z/19/Z)
Citations: not cited yet (Europe PMC); 61 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (none stated) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repositories

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

Zenodo 13710755

License: CC-BY-4.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: the text, “Study population”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
2 files

Zenodo 16840511

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: the text, “Statistical analyses”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: tidyverse (3 files), ggplot2 (1 file), glmmTMB (1 file), patchwork (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
9 files

ekw26/atlas-phenotypes

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 92d97fb92c2624c5ec03159c2c94c17cb2b70e4b, 6 September 2024
Size: 38 files, 0 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
2 files

ekw26/atlas-emergencies

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: a082a9d528f098780a249bcd82d04a64d1439973, 24 June 2026
Languages: R (4), Python (3)
Size: 9 files, 7 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: README, license file, 3 notebooks
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: tidyverse (3 files), ggplot2 (1 file), glmmTMB (1 file), patchwork (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
9 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:

  • 4 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 14 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

The paper has a data availability statement. Its license (none stated) does not allow reproducing it here; in short, from what the harvester recognized in it:

  • no repository, dataset or request procedure was recognized in it

Read it in the paper: doi.org/10.1371/journal.pmed.1005182.

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 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 10 authors, 17 MeSH terms, 1 funder, 50 references.

Cite

This paper

Whitfield, E., White, B., Barclay, M. E., Rafiq, M., Zakkak, N., Berglund, M., Singh, H., McPhail, S., Denaxas, S., & Lyratzopoulos, G. (2026). Frequency and prognostic outcomes of emergency diagnosis in 13 non-neoplastic conditions in England: A population-based cohort study using linked electronic health records of 1.7 million patients. PLoS medicine, 23(8), e1005182. https://doi.org/10.1371/journal.pmed.1005182

BibTeX

@article{whitfield2026frequency,
author = {Whitfield, Emma and White, Becky and Barclay, Matthew E and Rafiq, Meena and Zakkak, Nadine and Berglund, Marta and Singh, Hardeep and McPhail, Sean and Denaxas, Spiros and Lyratzopoulos, Georgios},
title = {{Frequency and prognostic outcomes of emergency diagnosis in 13 non-neoplastic conditions in England: A population-based cohort study using linked electronic health records of 1.7 million patients}},
journal = {PLoS medicine},
year = {2026},
month = aug,
volume = {23},
number = {8},
pages = {e1005182},
publisher = {PLOS},
issn = {1549-1277},
doi = {10.1371/journal.pmed.1005182},
url = {https://doi.org/10.1371/journal.pmed.1005182},
pmid = {42640879},
pmcid = {PMC13505939}
}

RIS

TY - JOUR
AU - Whitfield, Emma
AU - White, Becky
AU - Barclay, Matthew E
AU - Rafiq, Meena
AU - Zakkak, Nadine
AU - Berglund, Marta
AU - Singh, Hardeep
AU - McPhail, Sean
AU - Denaxas, Spiros
AU - Lyratzopoulos, Georgios
TI - Frequency and prognostic outcomes of emergency diagnosis in 13 non-neoplastic conditions in England: A population-based cohort study using linked electronic health records of 1.7 million patients
T2 - PLoS medicine
J2 - PLoS Med
PY - 2026
DA - 2026/08/25
VL - 23
IS - 8
SP - e1005182
SN - 1549-1277
PB - PLOS
DO - 10.1371/journal.pmed.1005182
UR - https://doi.org/10.1371/journal.pmed.1005182
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pmed.1005182",
"type": "article-journal",
"title": "Frequency and prognostic outcomes of emergency diagnosis in 13 non-neoplastic conditions in England: A population-based cohort study using linked electronic health records of 1.7 million patients",
"container-title": "PLoS medicine",
"author": [
{
"family": "Whitfield",
"given": "Emma"
},
{
"family": "White",
"given": "Becky"
},
{
"family": "Barclay",
"given": "Matthew E"
},
{
"family": "Rafiq",
"given": "Meena"
},
{
"family": "Zakkak",
"given": "Nadine"
},
{
"family": "Berglund",
"given": "Marta"
},
{
"family": "Singh",
"given": "Hardeep"
},
{
"family": "McPhail",
"given": "Sean"
},
{
"family": "Denaxas",
"given": "Spiros"
},
{
"family": "Lyratzopoulos",
"given": "Georgios"
}
],
"container-title-short": "PLoS Med",
"volume": "23",
"issue": "8",
"page": "e1005182",
"DOI": "10.1371/journal.pmed.1005182",
"PMID": "42640879",
"PMCID": "PMC13505939",
"ISSN": "1549-1277",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pmed.1005182",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
25
]
]
}
}

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.1038/s41591-024-03142-z [code]
Proteomic signatures improve risk prediction for common and rare diseases.
Journal: Nature medicine
In common: ggplot2, tidyverse, clinical / translational, author Spiros Denaxas
[2] doi:10.1007/s12311-026-02006-1 [code]
Innovative 3D-Image Analysis of Cerebellar Vascularization Highlights Angiogenic Gene Dysregulations in a Murine Model of Apnea of Prematurity.
Journal: Cerebellum (London, England)
In common: glmmTMB, patchwork, ggplot2, 1 other tool, 1 reference
[3] doi:10.2147/nss.s506461 [code]
We are the Sensors of Consciousness! A Review and Analysis on How Awakenings During Sleep Influence Dream Recall.
Journal: Nature and science of sleep
In common: glmmTMB, patchwork, ggplot2, 1 other tool, 1 reference
[4] doi:10.1242/jeb.252086 [code]
Transcriptional predictors of rescue behaviour in ants.
Journal: The Journal of experimental biology
In common: glmmTMB, patchwork, ggplot2, 1 other tool, 1 reference
[5] doi:10.1038/s41514-026-00391-9 [code]
Region-specific transcriptional signatures of brain aging in the absence of neuropathology at the single-cell level.
Journal: npj aging
In common: glmmTMB, patchwork, ggplot2, 1 other tool, 1 reference
[6] doi:10.1016/j.crneur.2023.100113 [code]
Apnea of prematurity induces short and long-term development-related transcriptional changes in the murine cerebellum.
Journal: Current research in neurobiology
In common: glmmTMB, patchwork, ggplot2, 1 other tool, 1 reference
[7] doi:10.1186/s13578-022-00869-5 [code]
Intermittent hypoxia in a mouse model of apnea of prematurity leads to a retardation of cerebellar development and long-term functional deficits.
Journal: Cell & bioscience
In common: glmmTMB, patchwork, ggplot2, 1 other tool, 1 reference
[8] doi:10.1136/bmjment-2025-302124 [code]
Do the pharmacokinetics of statins explain psychiatric symptom improvement from adjunctive statin prescribing in severe mental illness? Three target trial emulation studies.
Journal: BMJ mental health
In common: tidyverse, clinical / translational, 3 references
[9] doi:10.3390/insects13010081 [code]
Exploring Higher-Order Conceptual Learning in an Arthropod with a Large Multisensory Processing Center.
Journal: Insects
In common: glmmTMB, ggplot2, tidyverse, 2 references
[10] doi:10.1523/jneurosci.0238-25.2025 [code]
Emotional and Social Dimension of Abstract Concepts Meet with Interoception in Right Anterior Insula.
Journal: The Journal of neuroscience : the official journal of the Society for Neuroscience
In common: glmmTMB, patchwork, ggplot2, 1 other tool, other

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.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1371/journal.pmed.1005182.svg)](https://openscicode.org/badge/doi/10.1371/journal.pmed.1005182)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1371/journal.pmed.1005182.svg
   :target: https://openscicode.org/badge/doi/10.1371/journal.pmed.1005182
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1371/journal.pmed.1005182"><img src="https://openscicode.org/badge/doi/10.1371/journal.pmed.1005182.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

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