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
How to run this formula on stata = [Standard Deviation * (trading days) 1/2 ] , for a number of series.Hello, In the attached data below, in the first column there is 1, 1, 1…. 1 which means first securi…
Stock Price Pattern recognition using kernel regression on stataHello. I am doing a paper on technical analysis pattern recognition using Stata. Below is my initial…
merging global findex and GEM dataI have 3 datasets that offer different information on countries. Global findex data set is on how ad…
upgrade to stata 16Dear all, Sorry in advance if this is not the right place to ask the question. I have a permanent li…
multiple imputation: mvn vs chainedHi Statalist Questions regarding issues encountered during -mi- have been asked many times in this …
Subscribe to:
Post Comments (Atom)
0 Response to Generate weighted median variable by other variables
Post a Comment