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

Swapping tab_* for {gtsummary} #260

Closed
aspina7 opened this issue Jul 24, 2020 · 5 comments
Closed

Swapping tab_* for {gtsummary} #260

aspina7 opened this issue Jul 24, 2020 · 5 comments

Comments

@aspina7
Copy link
Member

aspina7 commented Jul 24, 2020

May be worth considering to use {gtsummary } for descriptive tables.

Would mean swapping to {flextable } rather than kable. Which would also play nicely if we swapped to officedown as in #188

Would then mean that we could retire tab_linelist and would significantly lighten {epibuffet}.

Thoughts @zkamvar @pbkeating ?

@zkamvar
Copy link
Member

zkamvar commented Aug 10, 2020

I fully support this idea. I don't know if it would necessarily lighten epibuffet since much of the weight is coming from {surveyr}, but I like the approach of {gt} and {gtsummary} and think that it has had a lot more thought an effort put into it than {epibuffet}.

@aspina7 aspina7 changed the title Swapping tab_linelist for {gtsummary} Swapping tab_* for {gtsummary} Oct 31, 2020
@aspina7
Copy link
Member Author

aspina7 commented Oct 31, 2020

also has functions for survey weighted tables
as well as for inline text

@zkamvar
Copy link
Member

zkamvar commented Nov 2, 2020

I am 100% for this (assuming it works for our use-cases). We may even consider just making {gtsummary} a backend for {epibuffet}

@aspina7
Copy link
Member Author

aspina7 commented Jul 28, 2021

turns out is possible to replicate the results of our tab_univariate (example below) - so actually the only wrapper that needs writing is to produce stratified estimates (mantel haenszel)
@pbkeating this shaves off a bit of time!

output <- linelist %>% 
  select(died_covid, gender, age_group) %>%    # keep variables of interest
  tbl_uvregression(                         ## produce univariate table
    method = glm,                           ## define regression want to run (generalised linear model)
    y = died_covid,                            ## define outcome variable
    method.args = list(family = binomial),  ## define what type of glm want to run (logistic)
    exponentiate = TRUE,                    ## exponentiate to produce odds ratios (rather than log odds)
    hide_n = TRUE                               ## dont include overall counts in regression table
  ) 

## produce counts for each of the variables of interest
cross_tab <- output$inputs$data %>% 
  tbl_summary(by = died_covid)

## combine for a full table 
tbl_merge(list(cross_tab, output))

@aspina7
Copy link
Member Author

aspina7 commented Apr 22, 2022

in progress for surveys in #275

aspina7 added a commit that referenced this issue Apr 23, 2022
aspina7 added a commit that referenced this issue Aug 2, 2022
aspina7 added a commit that referenced this issue Aug 10, 2022
@aspina7 aspina7 closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants