Hello,
I have a dataset which lists the year, state, age group, income, and survey weight of individuals surveyed. Agegroup takes on 0 if the individual is 16-19 years old, 1 if 20-24, 2 if 25-29, etc.
I would like to create a variable that has the weighted median income of individuals by year, state, and agegroup. So for example, I would like the weighted median income of all individuals in 2015, in Alabama, in agegroup 0 (ie 16-19 yo).
I've read some simpler examples of weighted medians, such as this one using levelsof and foreach, but I'm unsure of how to do so by year, state, agegroup specifications.
Thank you in advance!
Related Posts with Generate weighted median variable by other variables
Problem with misspecificationHello All, Using a dataset of 600,000 observations and 60 variables I ran regress and then tested f…
Controlled interrupted time series with count data using glm, panel data, and Newey-West standard errorsHi, I am trying to conduct an interrupted time series analysis with an intervention group and a con…
How to use data in ARDL Bounds testThis is my first time to use Stata in fairly complicated research. Must the variables which are in l…
Exporting Test Results to word from xttest0 and xttest3Dear all, may someone clarify, how I can export the results from xttest0 to word? If I write: xtre…
Help with SFA - sfpanel model BC95Dear Stata users, I am working on "the trade potential between China and Central and Eastern Europe…
Subscribe to:
Post Comments (Atom)
0 Response to Generate weighted median variable by other variables
Post a Comment