Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ADTTE error in variable logic #271

Open
3 tasks done
Tracked by #119
kaigu1990 opened this issue Apr 17, 2023 · 1 comment
Open
3 tasks done
Tracked by #119

[Bug]: ADTTE error in variable logic #271

kaigu1990 opened this issue Apr 17, 2023 · 1 comment
Labels
bug Something isn't working sme

Comments

@kaigu1990
Copy link

kaigu1990 commented Apr 17, 2023

Thanks for this practical package for creating ADaM. I have few question about some logic error when I look at the ADTTE dataset.

library(dplyr)
library(random.cdisc.data)
library(diffdf)

# call function to be able to match random number generation from previous R versions
RNGkind(sample.kind = "Rounding")

cadsl_new <- radsl(seed = 1, na_vars = list()) %>% `attr<-`("creation date", Sys.Date())
cadae_new <- radae(cadsl_new, seed = 1, na_vars = list()) %>% `attr<-`("creation date", Sys.Date())
cadrs_new <- radrs(cadsl_new, seed = 1, na_vars = list()) %>% `attr<-`("creation date", Sys.Date())
cadtte_new <- radtte(cadsl_new, seed = 1, na_vars = list()) %>% `attr<-`("creation date", Sys.Date())

data <- cadtte_new %>%
  filter(PARAMCD == "PFS" & CNSR == 1 & DCSREAS == "DEATH") %>%
  select(USUBJID, SUBJID, DCSREAS, DTHDT, DTHCAUS, CNSR, EVNTDESC, CNSDTDSC)

image

When the subject die, I think the PFS that I filter should be indicated as event rather than censor in the PFS rule. And when I just filter the PFS censor subjects as shown below, I find the "Last Date Known To Be Alive" should not appear in EVNTDESC of PFS censor, but should be OS censor. And the logic between EVNTDESC and CNSDTDSC is a little confused if it's in normal oncology trials.

data <- cadtte_new %>%
  filter(PARAMCD == "PFS" & CNSR == 1) %>%
  select(USUBJID, SUBJID, DCSREAS, DTHDT, DTHCAUS, CNSR, EVNTDESC, CNSDTDSC)

sessionInfo()

R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 
 
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8  LC_CTYPE=Chinese (Simplified)_China.utf8   
[3] LC_MONETARY=Chinese (Simplified)_China.utf8 LC_NUMERIC=C                               
[5] LC_TIME=Chinese (Simplified)_China.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] diffdf_1.0.4             random.cdisc.data_0.3.13 dplyr_1.1.1             

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9        lubridate_1.9.2   mvtnorm_1.1-3     lattice_0.20-45   tidyr_1.3.0      
 [6] class_7.3-20      digest_0.6.29     utf8_1.2.3        R6_2.5.1          cellranger_1.1.0 
[11] backports_1.4.1   labelled_2.9.1    evaluate_0.15     rootSolve_1.8.2.3 e1071_1.7-12     
[16] httr_1.4.3        ggplot2_3.4.0     pillar_1.9.0      rlang_1.1.0       lazyeval_0.2.2   
[21] Exact_3.2         readxl_1.4.1      rstudioapi_0.13   data.table_1.14.2 Matrix_1.5-1     
[26] checkmate_2.1.0   rmarkdown_2.14    htmlwidgets_1.5.4 munsell_0.5.0     proxy_0.4-27     
[31] compiler_4.2.1    xfun_0.31         pkgconfig_2.0.3   DescTools_0.99.47 htmltools_0.5.3  
[36] tidyselect_1.2.0  tibble_3.2.1      lmom_2.9          expm_0.999-6      fansi_1.0.4      
[41] viridisLite_0.4.0 withr_2.5.0       MASS_7.3-57       grid_4.2.1        jsonlite_1.8.0   
[46] gtable_0.3.0      lifecycle_1.0.3   magrittr_2.0.3    scales_1.2.0      gld_2.6.6        
[51] zip_2.2.0         cli_3.6.1         stringi_1.7.12    remotes_2.4.2     ellipsis_0.3.2   
[56] generics_0.1.3    vctrs_0.6.1       boot_1.3-28       openxlsx_4.2.5    tools_4.2.1      
[61] forcats_0.5.1     glue_1.6.2        purrr_1.0.1       hms_1.1.2         fastmap_1.1.0    
[66] yaml_2.3.7        timechange_0.2.0  colorspace_2.0-3  plotly_4.10.0     knitr_1.39       
[71] haven_2.5.0

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@kaigu1990 kaigu1990 added the bug Something isn't working label Apr 17, 2023
@shajoezhu
Copy link
Contributor

Thanks @kaigu1990 , this is related to #234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sme
Projects
None yet
Development

No branches or pull requests

3 participants