Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using frmttable, how do I wrap double statistics in parenthesis without using substat option?

    In the table below, I'm trying to wrap the "95% CI" columns in parentheses (this is the Stata results from the frmttable command):

    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
    -----------------------------------------------------------------------------------------------
    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:

    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)
    -----------------------------------------------------------------------------------------------
    Here's my code:
    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})
    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(\;, ):
    Code:
    brackets("","" \ (,) \ "","" \ (,) \ "","" \ (,))
    
    brackets("","" ; (,) ; "","" ; (,) ; "","" ; (,))
    
    brackets("","" , (,) , "","" , (,) , "","" , (,))
    
    brackets("",""  (,)  "",""  (,)  "",""  (,))
    but I get this error:
    option "brackets" (1x10) has more than two columns
    And just writing
    Code:
    brackets((,))
    wraps everything in parentheses.

    Is there a way to wrap specific columns with parentheses?

  • #2
    Did you ever figure this out? I've been trying to do the same thing.

    Comment


    • #3
      No. I abandoned the command, and now I use -putexcel-. If you want to create tables in Word, and you have Stata 15, you should try -putdocx-

      Comment

      Working...
      X