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

how to make non-normally distributed variables show median (P75-P25) in tableone package #104

Open
lizhiwei1994 opened this issue Jan 15, 2024 · 0 comments

Comments

@lizhiwei1994
Copy link

In tableone package, how to make non-normally distributed variables show median (P75-P25)? In the following example, the non-normally distributed variable bili is shown as bili (median [IQR]) corresponding to 1.40 [0.80, 3.40], and I want the result to be
1.40 (2.60), where 2.60 = 3.40-0.80.

I don't know how to get the results I want.

library(tableone)
library(survival)# 为了使用pbc数据集
data(pbc)

biomarkers <- c("bili")

myVars <- c("time",  "bili")

tab2 <- CreateTableOne(vars = myVars, data = pbc)

print(tab2, nonnormal = biomarkers)
#>                      
#>                       Overall             
#>   n                       418             
#>   time (mean (SD))    1917.78 (1104.67)   
#>   bili (median [IQR])    1.40 [0.80, 3.40]

Created on 2024-01-15 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant