lsting <-as_listing( out,key_cols ="TRT01A",disp_cols =names(out),main_title ="Listing of Patients Who Discontinued Early from Study")head(lsting, 20)
Listing of Patients Who Discontinued Early from Study
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Day of Study
Discontinuation Day of Study
Date of First Day of Last Relative to First Discontinuation
Study Drug Study Drug Study Drug Relative to Reason for
Treatment Center/Patient ID Age/Sex/Race Administration Administration Administration Randomization Discontinuation
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
A: Drug X CHN-1/id-62 36/F/WHITE 2020-11-22 455 454 455 DEATH
B: Placebo CHN-9/id-11 28/F/NATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER 2021-01-27 388 387 388 DEATH
C: Combination USA-11/id-136 38/F/ASIAN 2019-10-02 865 864 868 DEATH
USA-11/id-100 40/F/ASIAN 2020-03-10 705 705 707 LACK OF EFFICACY
CHN-11/id-91 44/M/BLACK OR AFRICAN AMERICAN 2020-05-29 625 625 626 DEATH
Experimental use!
WebR is a tool allowing you to run R code in the web browser. Modify the code below and click run to see the results. Alternatively, copy the code and click here to open WebR in a new tab.
Code
library(dplyr)library(rlistings)adsl <- random.cdisc.data::cadslout <- adsl %>%filter(AEWITHFL =="Y") %>%mutate(ID =paste(SITEID, SUBJID, sep ="/"),ASR =paste(AGE, SEX, RACE, sep ="/"),DISCONT =ifelse(!is.na(DCSREAS) & EOSSTT !="COMPLETED", "Yes", "No"),SSADTM =as.POSIXct(strftime(TRTSDTM, format ="%Y-%m-%d %H:%M:%S"),format ="%Y-%m-%d",tz ="UTC" ),SSAEDY =as.numeric(ceiling(difftime(EOSDT, SSADTM, units ="days"))),RANDEDY =as.numeric(ceiling(difftime(EOSDT, RANDDT, units ="days"))), ) %>%filter(DISCONT =="Yes") %>%select(ID, ASR, TRT01A, SSADTM, EOSDY, SSAEDY, RANDEDY, DCSREAS)var_labels(out) <-c(ID ="Center/Patient ID",ASR ="Age/Sex/Race",TRT01A ="Treatment",SSADTM ="Date of First\nStudy Drug\nAdministration",EOSDY ="Day of Last\nStudy Drug\nAdministration",SSAEDY ="Day of Study\nDiscontinuation\nRelative to First\nStudy Drug\nAdministration",RANDEDY ="Day of Study\nDiscontinuation\nRelative to\nRandomization",DCSREAS ="Reason for\nDiscontinuation")