collectionsdatatablestatacollect

Stata tables/collect confidence interval in one cell


I work a lot with the new tables collect command in stata 17. Does anybody know how to get the confidence interval in one cell in the table vs. One column for lower bound and one column for the upper bound estimate?

Alternatively a quick fix in word (or excel though my final document is word. Saving the output in excel takes so long)

Is I see it there is no option to put it in one column, so maybe a layout work around?


Solution

  • From the stata documentation of the collect command, the quick start mentions table (colname) (result), command(_r_b _r_ci: regress y x1 x2 x3). You should be able to use collect with it, but without a minimum reproducible example of your specific case, it is hard to verify if this works as intended in your case. For the general idea of a minimum reproducible example please see here and for specific advice on how to create a minimum reproducible example please see here.

    Here is a general example that uses table, collect and putdocx to create a word document to get the confidence interval in one cell:

    use https://www.stata-press.com/data/r17/nlsw88.dta
    table (colname) (result), command(_r_b _r_ci: regress wage union occupation married age)
    collect layout (colname) (result)
    putdocx begin
    putdocx collect
    putdocx save Table, replace