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

summarize_coxreg multivar=FALSE table can not be paginated #952

Closed
clarkliming opened this issue Jun 7, 2023 · 0 comments · Fixed by #956
Closed

summarize_coxreg multivar=FALSE table can not be paginated #952

clarkliming opened this issue Jun 7, 2023 · 0 comments · Fixed by #956
Assignees
Labels
bug Something isn't working sme

Comments

@clarkliming
Copy link

multivar = FALSE,

library(scda)
library(dplyr)
library(tern)

adsl <- synthetic_cdisc_dataset("latest", "adsl")
adtte <- synthetic_cdisc_dataset("latest", "adtte")

# Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels.
adsl <- df_explicit_na(adsl)
adtte <- df_explicit_na(adtte)

adsl_filtered <- adsl %>% dplyr::filter(
  RACE %in% c("ASIAN", "BLACK OR AFRICAN AMERICAN", "WHITE")
)
adtte_filtered <- dplyr::inner_join(
  x = adsl_filtered[, c("STUDYID", "USUBJID")],
  y = adtte,
  by = c("STUDYID", "USUBJID")
)

anl <- adtte_filtered %>%
  filter(PARAMCD == "OS") %>%
  mutate(EVENT = 1 - CNSR) %>%
  filter(ARM %in% c("B: Placebo", "A: Drug X")) %>%
  mutate(ARM = droplevels(relevel(ARM, "B: Placebo"))) %>%
  mutate(RACE = droplevels(RACE) %>% formatters::with_label("Race"))

# Add variable for column split label
anl <- anl %>% mutate(col_label = "Treatment Effect Adjusted for Covariate")

variables <- list(
  time = "AVAL",
  event = "EVENT",
  arm = "ARM",
  covariates = c("AGE", "SEX", "RACE")
)

lyt <- basic_table() %>%
  split_cols_by("col_label") %>%
  summarize_coxreg(variables = variables, multivar= FALSE) %>%
  append_topleft("Effect/Covariate Included in the Model")

result <- build_table(lyt = lyt, df = anl)
result

cat(export_as_txt(result, lpp = 100))

gives error

Error in find_pag(pagdf, start, guess, rlpp = adjrlpp, min_siblings = min_siblings, :
Unable to find any valid pagination between 1 and 6

@clarkliming clarkliming changed the title multivar=FALSE table can not be paginated summarize_coxreg multivar=FALSE table can not be paginated Jun 7, 2023
@clarkliming clarkliming added bug Something isn't working sme labels Jun 7, 2023
@edelarua edelarua self-assigned this Jun 8, 2023
clarkliming added a commit to insightsengineering/chevron that referenced this issue Jun 30, 2023
close #463 

blocked by insightsengineering/tern#952

harmonize coxt01 and coxt02 as they are very similar

---------

Signed-off-by: Liming <[email protected]>
Co-authored-by: b_falquet <[email protected]>
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.

2 participants