Announcement

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

  • outreg2 make column title for each column different

    Hi everyone,

    I've been browsing the forum, but seem to not find an answer to my question. I am using multinational data and would like to run an adjusted logistic regression analysis separately for each country (n = 12 countries). The code runs fine and also creates the excel file, but I'm unable to fix the column titles and assign the country names. Currently they are displayed as cntry== 1, cntry== 2, cntry== 3, etc. I would prefer if the column title would state the country, eg. Austria, Belgium, etc. Any ideas on how I can fix this? The code looks as follows:

    forval x = 1(1)12 {
    logit health i.agegrp i. gender i.eisced if cntry== `x', or
    outreg2 health using Table1.xls, eform stats(coef ci) dec(2) label append ctitle(cntry== `x') sideway bracket(ci)
    }

    Thank you for your help!

  • #2
    outreg2 is from SSC, as you are asked to explain (FAQ Advice #12). Replace

    ctitle(cntry== `x')
    with

    Code:
    ctitle("`:lab (cntry) `x''")

    Comment

    Working...
    X