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
Missing variables when downloading with wbopendataHi all, I am trying to re-download the complete WDI dataset, so as to have data from more recent yea…
finding duplicate values between two variablesDear all, I am using Stata 15 and for my panel data I have director IDs (Director_ID) and the CEO I…
IVprobit (opposit signs of first step regression to a simple regression)Hi All Code: ivprobit Y (X=religioniv) CONTROLS i.isic i.ccode, vce(robust) When I use ivprobit mo…
Industry as a control variablesHello, I'm doing my master thesis and I'm using a multitple linear regression. I'm regressing CSR pe…
Problem with ConditionsDear Statalist, I am analyzing a dataset that incorporates a directed-dyad year unit of analysis. Bu…
Subscribe to:
Post Comments (Atom)
0 Response to Generate weighted median variable by other variables
Post a Comment