I'm trying to figure out the proper code to collapse a dataset and get the means and medians of a set of variables based on the top 20% and bottom 20% of another variable.
I've started with the following code:
collapse adminratio fundratio (median) medadmin=adminratio medfund=fundratio, by(portfolio) cw
But then how do I incorporate basing this on the top 20% and bottom 20% of another variable?
Thank you!
I've started with the following code:
collapse adminratio fundratio (median) medadmin=adminratio medfund=fundratio, by(portfolio) cw
But then how do I incorporate basing this on the top 20% and bottom 20% of another variable?
Thank you!
Comment