-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADSL and ADAE dataset are compared and no issue found. I have derived 2 new variable in ADAE which are AREL and TRTA and 1 new variable in ADSL which is TRTA. Thanks, Jeetender
- Loading branch information
1 parent
fbf486d
commit 5d8d980
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
library(arsenal) | ||
library(stringr) | ||
|
||
|
||
|
||
adae <- r2rtf::r2rtf_adae | ||
|
||
|
||
load("~/forestly/data/forestly_adae_3grp.rda") | ||
|
||
|
||
# Derive AREL from existing AEREL | ||
adae <- adae %>% | ||
mutate(AREL = case_when( | ||
AEREL %in% c("PROBABLE", "POSSIBLE") ~ "RELATED", | ||
AEREL %in% c("NONE", "REMOTE", "") ~ "NOT RELATED", | ||
TRUE ~ AEREL # Keep original AREL if none of the conditions are met | ||
), | ||
TRTA = str_replace_all(as.character(TRTA), "Xanomeline ", "") %>% as.factor() # Remove "Xanomeline " and convert to factor | ||
) | ||
|
||
freq <- adae %>% count(AREL, AEREL) %>% | ||
arrange(desc(n)) | ||
print(freq) | ||
|
||
str(adae$TRTA) | ||
str(forestly_adae_3grp$TRTA) | ||
|
||
# Define the desired order of levels | ||
desired_levels <- c("Placebo", "Low Dose", "High Dose") | ||
|
||
# Standardize TRTA in adae | ||
adae$TRTA <- factor(adae$TRTA, levels = desired_levels) | ||
|
||
source("~/forestly/R/function_dataset0compare.R") | ||
|
||
# Call the function to compare the datasets and save the summary | ||
comparison_result <- compare_datasets(adae, forestly_adae_3grp, "compareresult_adae.html") | ||
|
||
# Save the adae dataset as an .rda file | ||
save(adae, file = "~/forestly/data-raw/forestly_adae.rda") | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
library(arsenal) | ||
library(stringr) | ||
|
||
|
||
adsl <- r2rtf::r2rtf_adsl | ||
|
||
|
||
|
||
|
||
load("~/forestly/data/forestly_adsl_3grp.rda") | ||
|
||
|
||
|
||
source("~/forestly/R/function_dataset0compare.R") | ||
|
||
|
||
#Compare ADSL dataset | ||
|
||
freq <- forestly_adsl_3grp %>% count(TRT01A, TRTA) %>% | ||
arrange(desc(n)) | ||
print(freq) | ||
|
||
# Derive TRTA from existing AEREL | ||
adsl <- adsl %>% | ||
mutate( | ||
TRTA = str_replace_all(as.character(TRT01A), "Xanomeline ", "") %>% as.factor() # Remove "Xanomeline " and convert to factor | ||
) | ||
|
||
# Define the desired order of levels | ||
desired_levels <- c("Placebo", "Low Dose", "High Dose") | ||
|
||
# Standardize TRTA in adae | ||
adsl$TRTA <- factor(adsl$TRTA, levels = desired_levels) | ||
|
||
|
||
# Save the adae dataset as an .rda file | ||
save(adsl, file = "~/forestly/data-raw/forestly_adsl.rda") |
Binary file not shown.