library(CTNote)
<- "__++++*o-------+--+-o-o-o+o+oooooo"
usePattern_char measure_retention(usePattern_char)
[1] 28
Data challenge R/Medicine 2024
Chi Zhang
March 25, 2024
Task overview see here
Questions of interest (examples)
Article describing the process: Odom 2023
SUD: substance use disorders; UDS: urine drug screening
Multiple categories for UDS variable
+
: positive for substance-
: negative for substanceo
: no sample*
: inconclusive or mixed results_
: no specimeen required per study design (weekend, holidays, pre-randomization)TLFB: time-line followback: patient self-report with a standard schema
Interpret: +++++---+-----------o-
Three studies
If want to know which subject belongs to which study, use CreateProtocolHistory()
or everybody
data to have project ID.
Opioids: Oxymorphone, Opium, Fentanyl, Hydromorphone, Codeine, Suboxone, Tramadol, Morphine, Buprenorphine, Hydrocodone, Opioid, Methadone, Oxycodone, Heroin
As of CTNote, there are three types of outcomes
# A tibble: 2,492 × 3
who treatment inductDelay
<int> <fct> <dbl>
1 2 Outpatient BUP + EMM 0
2 3 Inpatient BUP NA
3 4 Inpatient NR-NTX 0
4 6 Outpatient BUP + SMM 0
5 7 Inpatient NR-NTX 1
6 9 Inpatient NR-NTX NA
7 10 Outpatient BUP 0
8 11 Methadone 0
9 12 Outpatient BUP 0
10 13 Outpatient BUP 0
# ℹ 2,482 more rows
Weekly pattern data. Week 1 starts the day after randomisation or signed consent, depending whether patients are randomized or not. Negative time stamps suggest prior randomization (or consent).
# A tibble: 3,560 × 8
who startWeek randWeek1 randWeek2 endWeek Baseline Phase_1 Phase_2
<int> <dbl> <dbl> <dbl> <dbl> <chr> <chr> <chr>
1 1 -4 NA NA 15 _____ ooooooooooooooo ""
2 2 -5 0 NA 14 ____++ ----oo-o-o-o+o ""
3 3 -6 0 NA 23 _______ o-ooo-ooooooooo… ""
4 4 -4 0 NA 24 ____- ---------------… ""
5 5 -4 NA NA 15 _____ ooooooooooooooo ""
6 6 -6 0 NA 14 ____+_+ -ooooooooooooo ""
7 7 -5 0 NA 24 _____+ ----ooooooooooo… ""
8 8 -4 NA NA 25 _____ ooooooooooooooo… ""
9 9 -6 0 NA 22 ____+__ ooooooooooooooo… ""
10 10 -7 0 NA 22 _____+_- --o--*++o-+++++… ""
# ℹ 3,550 more rows
# A tibble: 3,560 × 8
who startWeek randWeek1 randWeek2 endWeek Baseline Phase_1 Phase_2
<int> <dbl> <dbl> <dbl> <dbl> <chr> <chr> <chr>
1 1 -4 NA NA 14 _____ oooooooooooooo ""
2 2 -5 0 NA 14 ++++++ -----------*+- ""
3 3 -6 0 NA 23 ++++*-- ----*----------… ""
4 4 -4 0 NA 24 +++-- -------------*-… ""
5 5 -4 NA NA 14 _____ oooooooooooooo ""
6 6 -6 0 NA 14 +++++++ -------------- ""
7 7 -5 0 NA 24 _+++-- ---------------… ""
8 8 -4 NA NA 24 _____ ooooooooooooooo… ""
9 9 -6 0 NA 22 +++**-- ---------------… ""
10 10 -7 0 NA 22 --*+++++ ---------++-+-*… ""
# ℹ 3,550 more rows
Outcomes (relapse)