Hi experts!
I have a four-year repeated cross-sectional data set. I want to divide my observations (within each year) into 400 equal-sized groups according to their income ranks. In addition, whenever there are ties, I want to assign ranks according to the value of another given variable.
I only know that we can do the following:
xtile newvar = income, n(400)
But xtile does not seem to allow me to introduce an additional variable to assign ranks when there are ties. Is there any simple method or user-written command? Thank you!
Related Posts with Divide data into groups according to percentile rank AND another given variable (if tie exists)
How to generate cumulative sum of changes of a variable in a group across timeDear All, I'm new on Statalist and I'm still figuring out how to use dataex so apologies for my dat…
net problems (can't find stata.toc)Can anyone shed any light on the following. In the first command I specify the HTTP directory and t…
Multivariate fractional probit and heckman selectionDear all, I am attempting a "Heckman type" of analysis that combines both the Multivariate Fraction…
Summing over a range of observationsHi, I'm doing a long-run event study using the methodology of Kolari & Pynnonen (2018), where i …
In need of help with a dataset containing multiple observations by IDDear Statalist, Hello! I've been a regular visitor here for months, but this is my first time posti…
Subscribe to:
Post Comments (Atom)
0 Response to Divide data into groups according to percentile rank AND another given variable (if tie exists)
Post a Comment