Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: add up variable / quantile
From 
 
"Scharnigg, Stan (Stud. SBE)" <[email protected]> 
To 
 
"[email protected]" <[email protected]> 
Subject 
 
st: add up variable / quantile 
Date 
 
Tue, 29 Mar 2011 03:53:18 +0200 
Hello,
Thank you for time. I have two questions:
A. I want to know the performance of retail investors. I have the account IDs, but the data
is seperated in months. So I merged the files into stata. However, now I have multiple account IDs and Stata recognizes the performance for every month.
I want to know what the total performance is for a single account ID. 
I will give a short example to make clear what I mean:
accountID; gross_performance
1                -.1
1                 .2
3                 .1
3                 .1
desired outcome:
AccountID; gross_performance 
1                 .1 (-.1+.2)
3                 .2 (.1+.1)
B. Then, when I have the total performance. I want to divide it into quantiles (I want to get the top 25 percentile)
If I use this command:
"xtile quanvariable = Gross_performance, nquantiles(4)"
I create a new variable and the top 25 percentile gets the number 4.  However, how do I get an overview which account IDs are in the top 25 percentile? 
There will be around 2500 observations in the top 25 percentile, so therefore I was hoping that there is an option to get this information in an overview. 
Thank you for your answer
Stan
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/