Percentile conditioned on another variable
Clash Royale CLAN TAG #URR8PPP Percentile conditioned on another variable Consider the following toy dataset with two variables: * Example generated by -dataex-. To install: ssc install dataex clear input str10 date float size "30.06.2018" 15 "29.06.2018" 10 "30.06.2018" 12 "01.07.2018" 13 "29.06.2018" 20 "30.06.2018" 22 "01.07.2018" 9 end For each date I want to drop the top 1% and bottom 1% of size. So, if there are 100 observations for 30.06.2018 the highest and the lowest size on this date should be dropped. 30.06.2018 I can generate percentiles for a variable but I struggle to do it while conditioning on another variable. So, what happens with less than 100 observations for each date? Check out egen either way, but watch what it does with different group sizes. – Nick Cox Jul 5 at 10:22 ...