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

  • olivia schuter
    started a topic outreg2 if you regress with bysort year

    outreg2 if you regress with bysort year

    Dear all,

    I already found the command for regressing by year ( I use a logit function) and then outreg2 it. Though it still only shows the last estimate....

    levelsof year, local(years)

    local estimates_list
    foreach y of local years {
    logit A170 i.X047 log_pcBIP i.age_recoded i.health_status if year == `y', vce(robust) or
    estimates store e_`y'
    local estimates_list `estimates_list' e_`y'
    outreg2 `estimates_list' using "xxx", eform cti(OR)

    What am I doing wrong?
    Kind regards

  • Phil Bromiley
    You'll increase your chances of a useful answer if you follow the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.

    I think you need square brackets around the estimates list.

    outreg2 [`estimates_list'] using "xxx",

    Leave a comment: