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
Panel data (i , j and t ) 2SLS using fixed effects when endogenous variable only varies over timeI have emissions data on c.1300 firms, over 10 years, across 27 EU countries. I am looking at the re…
Diff-in-diff with time fixed effectsHi everyone, Maybe it is a trivial question but I am running a DID regression based on a dataset wi…
Extracting words from a string variable using a local listHello, I want generate a new varibale that display the words found in the string variable that matc…
Id variable stored in double formatHello Stata members, I am analysing dataset in which pid is stored in double format. Since I want t…
Generating summarized variables for synthetic control predictorsHello, I am setting up a synthetic control based on data that looks something like this: cityid | ye…
Subscribe to:
Post Comments (Atom)
0 Response to Trimming percentiles within each age category
Post a Comment