[R] Displaying Dichotomous Variables as fractions in gtsummary Tables

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Mon Mar 27 20:31:12 CEST 2023


I think questions about gtsummary are better addressed to that project. 
They have a link "Getting Help" on their web page; I'd start there:

   https://www.danieldsjoberg.com/gtsummary/SUPPORT.html

Duncan Murdoch

On 27/03/2023 2:19 p.m., Deramus, Thomas Patrick wrote:
> Hi R Experts.
> 
> Apologies if this has been shared elsewhere, but I haven't been able to find a solid answer to this.
> 
> I'm wanting to create a table in gtsummary that displays entries for "Yes" and "No" as fractions rather than a relative to the total (e.g. {n} / {N} in the documentation).
> 
> I realize I can split them into rows with something like:
> type = all_dichotomous() ~ "categorical"
> 
> But I would honestly much rather display the variable as something like:
> 
> Condition? (Y/N)                   count "Yes"/ count "No"
> 
> 
> Is this possible to do in gtsummary?
> 
> Thank you in advance.
> The information in this e-mail is intended only for th...{{dropped:8}}



More information about the R-help mailing list