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 variable does not make much sense since the values do not sum up to 1. How can I create the right variable?
Thank you,
Best,
Margherita
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 variable does not make much sense since the values do not sum up to 1. How can I create the right variable?
Thank you,
Best,
Margherita
Comment