Announcement

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

  • Esttab not giving the right output

    Hello,

    I am trying to create a table (4 columns and 3 rows) with names of states (variable state_name which is a numeric variable) with the maximum and minimum of another variable in the format below.

    min State_name max State_name
    Var1
    Var 2
    Var3

    I'm using this code:
    Code:
    summ imm_recdint 
    scalar max=r(max)
    scalar min=r(min)
    eststo D1 : tabstat  imm_recdint state_name if (imm_recdint==min) 
    eststo D2 :tabstat  imm_recdint  state_name if (imm_recdint==max)
    I'm not sure how to use esttab to get the result in the format specified. I need to do repeat the code above for 2 more variables. The result in the window when I run the code above is as below. I want the state name to appear instead of the coded value as a number.
    eststo D1 : tabstat imm_recdint state_name if (imm_recdint==min)
    stats imm_re~t state_~e
    mean 2.607753 5
    . eststo D2 :tabstat imm_recdint state_name if (imm_recdint==max)
    stats imm_re~t state_~e
    mean 3.683776 18
    Thank you so much in advance!
Working...
X