Hello stata-users,
I have come across code for trimming data globally but not what I am specifically looking for. I have two variables - age and a score. I want to remove the 1st and 99th percentile of the score within each age group. For instance, I'd like to remove the 1st and 99th percentile of the score for everyone that is 18 years old. Then I'd do the same for 19 years old in the dataset, and so on until 110 yo.
I have thought of creating age categories individually and then trimming but that is a lot of manual work (n=thousands). Are there any shortcuts in stata that I am unaware of?
Thank you.
Related Posts with Trimming percentiles within each age category
Missing F-statistics of regression. regress socialsecurity ageeea ageeea2 eea ageeeaeea ageeea2eea if eeadonutregression==1 [pweight=w…
Fixed effects: country, year and industryHi everybody, I have a dataset consisting of ~3,000 Private Equity returns in the period 2012-2018.…
Multiple Ego Network AnalysisI have 3000+ ego networks in one database. I can not seem to figure out the code to run a density an…
command _bayesmh_eqlablist is unrecognizedHi everyone, I am practicing bayesmh estimations on stata 14 for academic purposes. I do get bayesm…
Removing duplicates within years in panel dataHello, I am struggling with something that I wanted to share. I have an unbalanced panel dataset. T…
Subscribe to:
Post Comments (Atom)
0 Response to Trimming percentiles within each age category
Post a Comment