diff --git a/submission/adam/adadas.xpt b/submission/adam/adadas.xpt index 9e047d5..11f78ca 100644 Binary files a/submission/adam/adadas.xpt and b/submission/adam/adadas.xpt differ diff --git a/submission/output/tlf-primary-pilot3.rtf b/submission/output/tlf-primary-pilot3.rtf index a61bdc8..ead26f5 100644 --- a/submission/output/tlf-primary-pilot3.rtf +++ b/submission/output/tlf-primary-pilot3.rtf @@ -59,7 +59,7 @@ {\f1\fs20\i [3] Pairwise comparison with treatment as a categorical variable: p-values without adjustment for multiple comparisons.} \par\ql\tx7245\tqr\tx12960 {\f1\fs20\i Source: }\pmartabqr -{\f1\fs20\i 19:46 Friday, August 25, 2023}\par +{\f1\fs20\i 18:17 Friday, February 09, 2024}\par } { \trowd @@ -139,9 +139,9 @@ \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx6740 \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx8986 \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx11232 \pard\intbl\ql{Mean (SD)}\cell -\pard\intbl\ql{26.8 (13.78)}\cell -\pard\intbl\ql{26.5 (13.30)}\cell -\pard\intbl\ql{22.7 (12.54)}\cell +\pard\intbl\ql{26.7 (13.79)}\cell +\pard\intbl\ql{26.4 (13.18)}\cell +\pard\intbl\ql{22.8 (12.48)}\cell \row } @@ -187,9 +187,9 @@ \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx6740 \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx8986 \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx11232 \pard\intbl\ql{Mean (SD)}\cell -\pard\intbl\ql{ 2.6 ( 5.83)}\cell -\pard\intbl\ql{ 2.0 ( 5.62)}\cell -\pard\intbl\ql{ 1.4 ( 4.40)}\cell +\pard\intbl\ql{ 2.5 ( 5.80)}\cell +\pard\intbl\ql{ 2.0 ( 5.55)}\cell +\pard\intbl\ql{ 1.5 ( 4.26)}\cell \row } @@ -201,7 +201,7 @@ \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx11232 \pard\intbl\ql{Median (Range)}\cell \pard\intbl\ql{ 2.0 (-11;16)}\cell \pard\intbl\ql{ 2.0 (-11;17)}\cell -\pard\intbl\ql{ 1.0 ( -7;14)}\cell +\pard\intbl\ql{ 1.0 ( -7;13)}\cell \row } @@ -213,7 +213,7 @@ \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx11232 \pard\intbl\ql{p-value(Dose Response) [1][2]}\cell \pard\intbl\ql{}\cell \pard\intbl\ql{}\cell -\pard\intbl\ql{ 0.187 }\cell +\pard\intbl\ql{ 0.245 }\cell \row } @@ -236,8 +236,8 @@ \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx8986 \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx11232 \pard\intbl\ql{p-value(Xan - Placebo) [1][3]}\cell \pard\intbl\ql{}\cell -\pard\intbl\ql{ 0.534 }\cell -\pard\intbl\ql{ 0.173 }\cell +\pard\intbl\ql{ 0.569 }\cell +\pard\intbl\ql{ 0.233 }\cell \row } @@ -248,8 +248,8 @@ \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx8986 \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx11232 \pard\intbl\ql{ Diff of LS Means (SE)}\cell \pard\intbl\ql{}\cell -\pard\intbl\ql{-0.5 (0.83)}\cell -\pard\intbl\ql{-1.2 (0.86)}\cell +\pard\intbl\ql{-0.5 (0.82)}\cell +\pard\intbl\ql{-1.0 (0.84)}\cell \row } @@ -260,8 +260,8 @@ \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx8986 \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx11232 \pard\intbl\ql{ 95% CI}\cell \pard\intbl\ql{}\cell -\pard\intbl\ql{(-2.2;1.1)}\cell -\pard\intbl\ql{(-2.9;0.5)}\cell +\pard\intbl\ql{(-2.1;1.1)}\cell +\pard\intbl\ql{(-2.7;0.7)}\cell \row } @@ -285,7 +285,7 @@ \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx11232 \pard\intbl\ql{p-value(Xan High - Xan Low) [1][3]}\cell \pard\intbl\ql{}\cell \pard\intbl\ql{}\cell -\pard\intbl\ql{ 0.446 }\cell +\pard\intbl\ql{ 0.520 }\cell \row } @@ -297,7 +297,7 @@ \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx11232 \pard\intbl\ql{ Diff of LS Means (SE)}\cell \pard\intbl\ql{}\cell \pard\intbl\ql{}\cell -\pard\intbl\ql{-0.6 (0.85)}\cell +\pard\intbl\ql{-0.5 (0.84)}\cell \row } @@ -309,7 +309,7 @@ \clbrdrt\clbrdrl\clbrdrb\clbrdrr\clvertalt\clpadfl0\clpadl120 \clpadft0\clpadt120 \clpadfb0\clpadb120 \clpadfr0\clpadr120 \cellx11232 \pard\intbl\ql{ 95% CI}\cell \pard\intbl\ql{}\cell \pard\intbl\ql{}\cell -\pard\intbl\ql{(-2.3;1.0)}\cell +\pard\intbl\ql{(-2.2;1.1)}\cell \row } diff --git a/submission/pkgs4adrg.r b/submission/pkgs4adrg.r index 007a2e6..55fd9b3 100644 --- a/submission/pkgs4adrg.r +++ b/submission/pkgs4adrg.r @@ -6,15 +6,15 @@ library(data.table) pkgloaded <- sessionInfo()$loadedOnly #get intial list of packages that were loaded pkgother <- sessionInfo()$otherPkgs #get initla list of packages that were also listed in the Session but may not have been used -loaded <- data.frame(rbindlist(pkgloaded, idcol = TRUE, fill=T)) %>% - select(Package, Title, Version, Description) %>% - mutate(loaded='Y') -other <- data.frame(rbindlist(pkgother, idcol = TRUE, fill=T)) %>% - select(Package, Title, Version, Description) %>% - mutate(loaded='N') +loaded <- data.frame(rbindlist(pkgloaded, idcol = TRUE, fill = TRUE)) %>% + select(Package, Title, Version, Description) %>% + mutate(loaded = "Y") +other <- data.frame(rbindlist(pkgother, idcol = TRUE, fill = TRUE)) %>% + select(Package, Title, Version, Description) %>% + mutate(loaded = "N") pkgdesc <- bind_rows(loaded, other) # stacks all package data frames. # NOTE column 'loaded', from this data frame can be used to subset out packages not used and may not be needed for the adrg.pdf -# update path to save CSV in your local area. -write.csv(pkgdesc, "/cloud/project/submission/pkgs4adrg.csv", row.names=FALSE) +# update path to save CSV in your local area. +write.csv(pkgdesc, "/cloud/project/submission/pkgs4adrg.csv", row.names = FALSE) diff --git a/submission/programs/adadas.r b/submission/programs/adadas.r index 2469a00..6769a42 100644 --- a/submission/programs/adadas.r +++ b/submission/programs/adadas.r @@ -80,27 +80,6 @@ adas2 <- adas1 %>% create_var_from_codelist(adadas_spec, AVISIT, AVISITN) %>% # derive AVISITN from codelist create_var_from_codelist(adadas_spec, PARAM, PARAMN) # derive PARAMN from codelist -# derive PARAMCD=ACTOT, DTYPE=LOCF -# A dataset with combinations of PARAMCD, AVISIT which are expected. -actot_expected_obsv <- tibble::tribble( - ~PARAMCD, ~AVISITN, ~AVISIT, - "ACTOT", 0, "Baseline", - "ACTOT", 8, "Week 8", - "ACTOT", 16, "Week 16", - "ACTOT", 24, "Week 24" -) - -adas_locf <- derive_locf_records( - data = adas2, - dataset_expected_obs = actot_expected_obsv, - by_vars = exprs( - STUDYID, SITEID, SITEGR1, USUBJID, TRTSDT, TRTEDT, - TRTP, TRTPN, AGE, AGEGR1, AGEGR1N, RACE, RACEN, SEX, - ITTFL, EFFFL, COMP24FL, PARAMCD - ), - order = exprs(AVISITN, AVISIT), - keep_vars = exprs(VISIT, VISITNUM, ADY, ADT, PARAM, PARAMN, QSSEQ) -) ## derive AWRANGE/AWTARGET/AWTDIFF/AWLO/AWHI/AWU aw_lookup <- tribble( @@ -112,7 +91,7 @@ aw_lookup <- tribble( ) adas3 <- derive_vars_merged( - adas_locf, + adas2, dataset_add = aw_lookup, by_vars = exprs(AVISIT) ) %>% @@ -122,8 +101,60 @@ adas3 <- derive_vars_merged( ) -## baseline information BASE/CHG/PCHG +## ANL01FL adas4 <- adas3 %>% + mutate(diff = AWTARGET - ADY) %>% + restrict_derivation( + derivation = derive_var_extreme_flag, + args = params( + by_vars = exprs(USUBJID, PARAMCD, AVISIT), + order = exprs(AWTDIFF, diff), + new_var = ANL01FL, + mode = "first" + ), + filter = !is.na(AVISIT) + ) + +# derive PARAMCD=ACTOT, DTYPE=LOCF +# A dataset with combinations of PARAMCD, AVISIT which are expected. +actot_expected_obsv <- tibble::tribble( + ~PARAMCD, ~AVISITN, ~AVISIT, + "ACTOT", 0, "Baseline", + "ACTOT", 8, "Week 8", + "ACTOT", 16, "Week 16", + "ACTOT", 24, "Week 24" +) + +adas_locf2 <- adas4 %>% + restrict_derivation( + derivation = derive_locf_records, + args = params( + dataset_expected_obs = actot_expected_obsv, + by_vars = exprs( + STUDYID, SITEID, SITEGR1, USUBJID, TRTSDT, TRTEDT, + TRTP, TRTPN, AGE, AGEGR1, AGEGR1N, RACE, RACEN, SEX, + ITTFL, EFFFL, COMP24FL, PARAMCD + ), + order = exprs(AVISITN, AVISIT), + keep_vars = exprs(VISIT, VISITNUM, ADY, ADT, PARAM, PARAMN, QSSEQ) + ), + filter = !is.na(ANL01FL) + ) %>% + ################# assign ANL01FL for new records + mutate(ANL01FL = if_else(is.na(DTYPE), ANL01FL, "Y")) %>% + ################# re-derive AWRANGE/AWTARGET/AWTDIFF/AWLO/AWHI/AWU + select(-c("AWRANGE", "AWTARGET", "AWLO", "AWHI")) %>% + derive_vars_merged( + dataset_add = aw_lookup, + by_vars = exprs(AVISIT) + ) %>% + mutate( + AWTDIFF = abs(AWTARGET - ADY), + AWU = "DAYS" + ) + +## baseline information BASE/CHG/PCHG +adas5 <- adas_locf2 %>% # Calculate BASE derive_var_base( by_vars = exprs(STUDYID, USUBJID, PARAMCD), @@ -141,19 +172,7 @@ adas4 <- adas3 %>% filter = is.na(ABLFL) ) -## ANL01FL -adas5 <- adas4 %>% - mutate(diff = AWTARGET - ADY) %>% - restrict_derivation( - derivation = derive_var_extreme_flag, - args = params( - by_vars = exprs(USUBJID, PARAMCD, AVISIT), - order = exprs(AWTDIFF, diff), - new_var = ANL01FL, - mode = "first" - ), - filter = !is.na(AVISIT) - ) + ## out to XPT adas5 %>%