result <-basic_table(show_colcounts =TRUE) %>%split_cols_by("ARMCD", ref_group ="ARM A") %>%split_rows_by("PARAM", split_fun = drop_split_levels) %>%summarize_ancova(vars ="CHG",variables =list(arm ="ARMCD", covariates =c("BASE", "AVISIT", "AVISIT*ARMCD")),conf_level =0.95,var_labels ="WEEK 1 DAY 8",table_names ="WEEK 1 DAY 8",interaction_y ="WEEK 1 DAY 8",interaction_item ="AVISIT" ) %>%summarize_ancova(vars ="CHG",variables =list(arm ="ARMCD", covariates =c("BASE", "AVISIT", "AVISIT*ARMCD")),conf_level =0.95,var_labels ="WEEK 2 DAY 15",table_names ="WEEK 2 DAY 15",interaction_y ="WEEK 2 DAY 15",interaction_item ="AVISIT" ) %>%summarize_ancova(vars ="CHG",variables =list(arm ="ARMCD", covariates =c("BASE", "AVISIT", "AVISIT*ARMCD")),conf_level =0.95,var_labels ="WEEK 5 DAY 36",table_names ="WEEK 5 DAY 36",interaction_y ="WEEK 5 DAY 36",interaction_item ="AVISIT" ) %>%build_table(adqs_in, alt_counts_df = adsl)result
ARM A ARM B ARM C
(N=134) (N=134) (N=132)
——————————————————————————————————————————————————————————————————————————
BFI All Questions
WEEK 1 DAY 8
n 68 73 62
Adjusted Mean 4.34 5.96 3.90
Difference in Adjusted Means 1.62 -0.44
95% CI (-1.75, 4.98) (-3.94, 3.06)
p-value 0.3460 0.8059
WEEK 2 DAY 15
n 68 73 62
Adjusted Mean 12.99 11.23 9.86
Difference in Adjusted Means -1.76 -3.13
95% CI (-5.12, 1.60) (-6.64, 0.37)
p-value 0.3048 0.0795
WEEK 5 DAY 36
n 68 73 62
Adjusted Mean 23.88 23.08 28.21
Difference in Adjusted Means -0.81 4.33
95% CI (-4.17, 2.56) (0.83, 7.83)
p-value 0.6383 0.0155
Fatigue Interference
WEEK 1 DAY 8
n 68 73 62
Adjusted Mean 5.97 5.19 5.21
Difference in Adjusted Means -0.78 -0.76
95% CI (-4.17, 2.61) (-4.30, 2.78)
p-value 0.6522 0.6729
WEEK 2 DAY 15
n 68 73 62
Adjusted Mean 11.39 9.42 9.55
Difference in Adjusted Means -1.96 -1.84
95% CI (-5.35, 1.43) (-5.37, 1.70)
p-value 0.2560 0.3084
WEEK 5 DAY 36
n 68 73 62
Adjusted Mean 22.79 25.37 23.43
Difference in Adjusted Means 2.58 0.64
95% CI (-0.81, 5.97) (-2.89, 4.18)
p-value 0.1353 0.7212
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(tern)library(dplyr)adsl <- random.cdisc.data::cadsladqs <- random.cdisc.data::cadqsadqs_in <- adqs %>%filter(AVISIT %in%c("WEEK 1 DAY 8", "WEEK 2 DAY 15", "WEEK 5 DAY 36")) %>%droplevels() %>%filter(PARAM %in%c("BFI All Questions", "Fatigue Interference")) %>%mutate(CHG =ifelse(BMEASIFL =="Y", CHG, NA)) # only analyze evaluable population