In the table below, I'm trying to wrap the "95% CI" columns in parentheses (this is the Stata results from the frmttable command):
I know that the substat option will put the double statistics in parentheses below the ratio, but I want the values side-by-side. I want it to look like this:
Here's my code:
I thought I could use the brackets() option, but I'm having a hard time specifying the brackets for each column. I tried using several different separators(\;, ):
but I get this error:
And just writing
wraps everything in parentheses.
Is there a way to wrap specific columns with parentheses?
HTML Code:
----------------------------------------------------------------------------------------------- Both Groups Intervention Control Ratio 95% CI Ratio 95% CI Ratio 95% CI ----------------------------------------------------------------------------------------------- overall,crude 1.35 1.21, 1.50 1.40 1.16, 1.64 1.42 1.18, 1.66 overall,adj_for_age 1.24 1.10, 1.39 1.26 1.01, 1.50 1.27 1.05, 1.50 overall,full_adj 1.24 1.09, 1.39 1.24 1.00, 1.49 1.29 1.05, 1.53 -----------------------------------------------------------------------------------------------
HTML Code:
----------------------------------------------------------------------------------------------- Both Groups Intervention Control Ratio 95% CI Ratio 95% CI Ratio 95% CI ----------------------------------------------------------------------------------------------- overall,crude 1.35 (1.21, 1.50) 1.40 (1.16, 1.64) 1.42 (1.18, 1.66) overall,adj_for_age 1.24 (1.10, 1.39) 1.26 (1.01, 1.50) 1.27 (1.05, 1.50) overall,full_adj 1.24 (1.09, 1.39) 1.24 (1.00, 1.49) 1.29 (1.05, 1.53) -----------------------------------------------------------------------------------------------
Code:
matrix dcols = (0,0,1,0,0,1,0,0,1) frmttable using test.docx, replace /// statmat(ratios) doubles(dcols) dbldiv(", ") /// ctitles("", "Both Groups", "", "Intervention", "", "Control", "" \ /// "", "Ratio", "95% CI", "Ratio", "95% CI", "Ratio", "95% CI") /// multicol(1,2,2;1,4,2;1,6,2) basefont(fs8 roman) coljust(l{c})
Code:
brackets("","" \ (,) \ "","" \ (,) \ "","" \ (,)) brackets("","" ; (,) ; "","" ; (,) ; "","" ; (,)) brackets("","" , (,) , "","" , (,) , "","" , (,)) brackets("","" (,) "","" (,) "","" (,))
option "brackets" (1x10) has more than two columns
Code:
brackets((,))
Is there a way to wrap specific columns with parentheses?
Comment