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
Related Posts with ASGEN command for weighted average
Fractional Dynamic ProbitHello all, for my master thesis on bank's NPL, after having estimated the determinants of bad loan w…
Optimize by minimizing the value of an equation to get a parameter value for each observationDear Everyone, Software Used: STATA 15.1 I am trying to get a parameter value (R) for each observa…
Difference in Difference with multiple treatment periods and multiple treatmentsGood day all! This is my first post on Stata list. Please let me know if any additional information …
GMM Xtabond2Hi friends, This is my first experience for GMM. help me, please. I should examine the relationshi…
Generate a variable with the count of the value 3 across several variablesHi, I would like to generate a variable that contains the count of the value 3 across several column…
Subscribe to:
Post Comments (Atom)
0 Response to ASGEN command for weighted average
Post a Comment