Sorting the sample based on quantiles
Posted: Sun Jan 20, 2019 9:24 am
Please help me. I have a variable, let's say the name of the variable is 'y'
I want to sort it based on quartiles in each year.
So I want to create another series, let's say series y_quan, that consists only the first 25% quartiles of variable y that has been sorted in each firm-year.
I noticed that we have @quantilesby formula. I have tried @quantilesby(y,@year,(0.25)) -> but this will give me the values of the firm-year quantiles. What I need is to create a series (y_quan) that consist the values of variable y, if it is in the 25%quartiles group.
I would like to also create another series for 25-50% quartiles group, 50-75% quartiles group, and 75% - 100% quartiles group.
Thanks
I want to sort it based on quartiles in each year.
So I want to create another series, let's say series y_quan, that consists only the first 25% quartiles of variable y that has been sorted in each firm-year.
I noticed that we have @quantilesby formula. I have tried @quantilesby(y,@year,(0.25)) -> but this will give me the values of the firm-year quantiles. What I need is to create a series (y_quan) that consist the values of variable y, if it is in the 25%quartiles group.
I would like to also create another series for 25-50% quartiles group, 50-75% quartiles group, and 75% - 100% quartiles group.
Thanks