Announcement

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

  • Weights for population

    Hi!!

    I have created the variable PERCAPITA, and I want to use weights ( FEX_C) to get the poulation estimate


    gen PERCAPITA=. if parent==10 | parent==11 | parent==12 | parent==13
    replace PERCAPITA= I_UGASTO/hogar_size if parent==1 | parent==2 | parent==3 | parent==4 | parent==5 | parent==6 | parent==7 | parent==8 | parent==9 | parent==14

    I am using the next line of code, but it is not working

    tabstat FEX_C, by (PERCAPITA) sta (sum)

    Any ideas?

  • #2
    from your text it is not clear what you want a population estimate of - but it seems unlikely that the command you tried will give it to you as what you asked for are summary statistics for the "FEX_C" variable separately for each level of the "PERCAPITA" variable; please try and clarify what you actually want and please provide a -dataex- example of the data in CODE blocks (read the FAQ to learn how to do this but "help dataex" is a good place to start)

    Comment


    • #3
      I've done it

      This is what I wanted to do:

      sum PERCAPITA [iw=FEX_C]

      Comment

      Working...
      X