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 PFS and OS (and likely the others too) are not logical #254

Closed
3 tasks done
Tracked by #119
danielinteractive opened this issue Mar 18, 2023 · 3 comments · Fixed by #273
Closed
3 tasks done
Tracked by #119

[Bug]: ADTTE PFS and OS (and likely the others too) are not logical #254

danielinteractive opened this issue Mar 18, 2023 · 3 comments · Fixed by #273
Assignees
Labels
bug Something isn't working sme

Comments

@danielinteractive
Copy link
Contributor

What happened?

When working on a multi-state code template, we realized that the ADTTE data sets produced by random.cdisc.data are not logical:

  1. The times between PFS and OS are not ordered logically for a single subject
  2. Also the censoring indicator is not logical for a single subject

Example:

library(random.cdisc.data)
library(dplyr)
set.seed(123)
ADSL <- radsl(N = 10, seed = 1, study_duration = 2)
ADTTE <- radtte(ADSL, seed = 2)

ADTTE %>% 
  filter(PARAMCD %in% c("OS", "PFS")) %>% 
  select(SUBJID, ADY, PARAMCD, CNSR) %>% 
  filter(SUBJID == "id-5")

Here we see that this subject is censored for PFS at day 108, but has observed OS at day 81, illustrating both problems mentioned above.

sessionInfo()

R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.6.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] random.cdisc.data_0.3.13 mstate_0.3.2             survival_3.4-0           scda_0.1.6              
[5] dplyr_1.0.10            

loaded via a namespace (and not attached):
 [1] pillar_1.8.1      compiler_4.2.2    prettyunits_1.1.1 remotes_2.4.2     tools_4.2.2      
 [6] pkgbuild_1.3.1    checkmate_2.1.0   lifecycle_1.0.3   tibble_3.1.8      lattice_0.20-45  
[11] pkgconfig_2.0.3   rlang_1.0.6       Matrix_1.5-1      DBI_1.1.3         cli_3.4.0        
[16] rstudioapi_0.14   yaml_2.3.5        curl_4.3.2        withr_2.5.0       generics_0.1.3   
[21] vctrs_0.5.2       rprojroot_2.0.3   grid_4.2.2        tidyselect_1.1.2  glue_1.6.2       
[26] data.table_1.14.2 R6_2.5.1          processx_3.7.0    fansi_1.0.3       purrr_0.3.4      
[31] callr_3.7.2       magrittr_2.0.3    backports_1.4.1   ps_1.7.1          ellipsis_0.3.2   
[36] splines_4.2.2     assertthat_0.2.1  utf8_1.2.2        crayon_1.5.1

Relevant log output

# A tibble: 2 × 4
  SUBJID   ADY PARAMCD  CNSR
  <chr>  <int> <fct>   <int>
1 id-5      81 OS          0
2 id-5     108 PFS         1

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.
@danielinteractive danielinteractive added the bug Something isn't working label Mar 18, 2023
@shajoezhu
Copy link
Contributor

Hi @danielinteractive , thanks for raising this, same issue with #234, some of these functions will need more refactoring, argument will need more than adsl. we will look it in more details the coming weeks

@shajoezhu
Copy link
Contributor

this is linked to #13 as well

@shajoezhu
Copy link
Contributor

brilliant! thanks a lot @Nolan-Steed

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

Successfully merging a pull request may close this issue.

3 participants