Announcement

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

  • ASGEN command for weighted average

    Hello everyone,


    I have to compute the weighted average of democratic scores in the destination countries, weighted it with my shares of emigrants in a certain province in a year.
    This is the Stata command i am using:

    bysort provincia year: asgen weighted_average= democracy_polity if democracy_polity!=. & share_emigration!=., weight(share_emigration)

    However, the new variables doe not make much sense since the values do not sum up to 1.

    Thank you,
    Best,
    Margherita


  • #2
    Duplicate post. If interested please follow https://www.statalist.org/forums/for...ighted-average

    Comment

    Working...
    X