[R] Displaying Dichotomous Variables as fractions in gtsummary Tables

Deramus, Thomas Patrick tder@mu@ @end|ng |rom p@rtner@@org
Mon Mar 27 20:33:22 CEST 2023

Will do.

Thank you!

-----Original Message-----
From: Duncan Murdoch <murdoch.duncan using gmail.com> 
Sent: Monday, March 27, 2023 2:31 PM
To: Deramus, Thomas Patrick <tderamus using partners.org>; r-help using r-project.org
Subject: Re: [R] Displaying Dichotomous Variables as fractions in gtsummary Tables

        External Email - Use Caution        

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:


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 the 
> ...{{dropped:14}}
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see 
> https://secure-web.cisco.com/1LvENKIbjtPWholsX80-j5YEYlVwwXvvOSXcYh28C
> b-GBuljAxGzuiwHosdaKPHB5oJX8Ke1aUPro8Gf6M7aNonb46YRfYxYvBgdn-jLitmEBrh
> 61EcKUl8Wn5xRUfNkbVtvREDWGNasbnqtHBgWksyclJ6ZfwMYVQD1bvG9-XxNm0tp4KDb2
> LO1xj3NDn1rabg65tvRcJ_cQtD4HxSgZ8ktvhkgk9Qm9OgjYOlCGG0cwaV9ag4JOanSWAt
> VXrAK09SAUGag9tWL1a7CC8CvBoX4rxDeh0IXPy135tcqsGr64-wyGEerybmvql-Sap2AT
> /https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-help
> PLEASE do read the posting guide 
> http://secure-web.cisco.com/1hRetA69YFDHC8oyfq1c6Hv0myf0elSoasSrh2ESLu
> 37Kzjs_pARzAspsULbiZI3AwhZmYIbFTNO_K6VyUvGoEhPsiQFBTtfiUExKCvIxKVen_O3
> OhJi3bMjmRs1TyroNsqR9gmoCQA0U7OMPAZM0E9Sjjiw9smxOe-d9A-rxfv5jeDMbR4MYv
> COhuky4cWv9VZpT-jGB2O0QK_N9EIPJXdIi2ehL0_imqLbvSH9-LDeFquBlMvwqo2HVcVx
> -EduiYMoYGBdU5j20LAmSshjCB69P8bwgXUndoyBBydbDWEBzqGDt8ofXApnXKfyeLwfE/
> http%3A%2F%2Fwww.R-project.org%2Fposting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

The information in this e-mail is intended only for the person to whom it is addressed.  If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline <https://www.massgeneralbrigham.org/complianceline> .
Please note that this e-mail is not secure (encrypted).  If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately.  Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail. 

More information about the R-help mailing list