Relative Content

Tag Archive for tableone

Summing columns by strata in table1

I used the following code to get a table that is stratified by disease (narcolepsy, idiopathic hypersomnia), and app usage (Yes, No) for two binary variables (XWV_TIME, PR_TX). I would like to obtain the sum total within strata such that the Yes and No columns (and percentage) are computed for each strata. For example, to the left of the second column would be 62 (%), 32 (%) 66 (%) for the Narcolepsy strata. Then, the same thing would be done to the IH strata and the Overall strata. Is there a way to do this with the extra.col argument?