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
Test for endogeneity when using in between-effectsHello everyone, I am trying to run the following model xi: xtivreg sba ids fco vvm nan avi i.year (…
How to change the data in letters ?Hello. The column I actually have is address1. I want to change the contents of address1 to address2…
Appending Files Conditional on File NameI have a number of files that are named the following: lp1_x0_rf1.dta ... lp1_x9_rf1.dta lp1_x0_rf2…
How to control MRTs in PPML Gravity ModelCan i control MRTs in PPML method by estimating exporter, importer and year group dummies by followi…
Stata markdown: can dyndoc create md files instead of html?I'm working in a project with many collaborators, all of which have Stata version 15. We use the dyn…
Subscribe to:
Post Comments (Atom)
0 Response to ASGEN command for weighted average
Post a Comment