isubirana / compareGroups

R package to easily build publication-ready univariate or bivariate descriptive tables from a data set.
https://isubirana.github.io/compareGroups/
34 stars 13 forks source link

Add Median + Range #19

Closed phipz closed 2 months ago

phipz commented 3 years ago

Hello altogether,

thanks for the great work with this package. I previously used the "table1" package, now i am switching to this one because of the latex output.

Is there any chance, to get this package produce Media/Range outputs like in the screenshot? I have searched through all the documentation, but did not find any option.

Thanks for your help!

table1
isubirana commented 3 years ago

Thank you for using the compareGroups package.

By compareGroups functions it is not possible to report mean, median and missing values at the same time of a numeric continous variable. But it is possible to report median [minimum; maximum] by specifying method=2, Q1=0 and Q3=1 arguments from compareGroups or descrTable functions. By method=2 you are indicating that all numeric-continuous variables are treated as non-normal distributed variable and median [Q1; Q3] is reported instead of mean (SD). If you want a particular variable, e.g. tryglicerides to be treated as non-normal, type method=c("tryglic"=2).

I hope this helps.

Regards, Isaac.