Closed ayogasekaram closed 2 years ago
Bug in s_ancova results in error when changing the reference group to "ARM B" or "ARM C".
library(scda) library(rtables) library(dplyr) adsl <- synthetic_cdisc_data("latest")$adsl adqs <- synthetic_cdisc_data("latest")$adqs adqs_single <- adqs %>% filter( AVISIT == "WEEK 1 DAY 8", # single time point PARAMCD == "FKSI-FWB" # single end point ) %>% mutate(CHG = ifelse(BMEASIFL == "Y", CHG, NA)) # only analyze evaluable population adqs_multi <- adqs %>% filter(AVISIT == "WEEK 1 DAY 8") basic_table() %>% split_cols_by("ARMCD", ref_group = "ARM B") %>% add_colcounts() %>% summarize_ancova( vars = "CHG", variables = list(arm = "ARMCD", covariates = NULL), table_names = "unadj", conf_level = 0.95, var_labels = "Unadjusted comparison", .labels = c(lsmean = "Mean", lsmean_diff = "Difference in Means") ) %>% summarize_ancova( vars = "CHG", variables = list(arm = "ARMCD", covariates = c("BASE", "STRATA1")), table_names = "adj", conf_level = 0.95, var_labels = "Adjusted comparison (covariates BASE and STRATA1)" ) %>% build_table(adqs_single, alt_counts_df = adsl)
Results in:
Thank you @ayogasekaram , the bug is fixed. The updates pull request is here https://github.com/insightsengineering/tern/pull/651
Bug in s_ancova results in error when changing the reference group to "ARM B" or "ARM C".
Results in: