I am new on Stata and do not really understand some basic commands as well as the terminology used, so I would really appreciate if you could provide me a step-by-step answer if it is possible. I will explain, along the following points, the analysis I want to perform:
1) I have 120 variables with 9,630 observations each (i.e. 120 columns and 9,630 rows), although some observations are null (i.e. they display "-"). For each variable, I want to assign to all observations a number from 1 to 10, being number 1 the observations with the highest values and number 10 the observations with the lowest values. In other words, I want to assign a decile (from 1 to 10) to all observations that comprise each of the 120 variables. It is important to note that all observations correspond to the same characteristic (i.e. a given type of fee), while each variable (i.e. each column) corresponds to each month from January 2004 to December 2013 (i.e. 120 months).
2) Once I have sorted all the observations into deciles for each of the 120 variables, I want to calculate the average of a different characteristic (i.e. returns) for each decile and variable based on the sorting performed previously. It would be really helpful if you could clarify me whether I should import a dataset containing information on the two characteristics (i.e. 120 (months)*2(characteristics) columns and 9,630 rows). As I stated before, I am relatively new on Stata and I am used to import data from Excel.
3) The final output table containing the averages should exhibit 10 columns (i.e. one for each decile) and 120 rows (i.e. one for each month from January 2004 to December 2013)
Thank you in advance for your help.
1) I have 120 variables with 9,630 observations each (i.e. 120 columns and 9,630 rows), although some observations are null (i.e. they display "-"). For each variable, I want to assign to all observations a number from 1 to 10, being number 1 the observations with the highest values and number 10 the observations with the lowest values. In other words, I want to assign a decile (from 1 to 10) to all observations that comprise each of the 120 variables. It is important to note that all observations correspond to the same characteristic (i.e. a given type of fee), while each variable (i.e. each column) corresponds to each month from January 2004 to December 2013 (i.e. 120 months).
2) Once I have sorted all the observations into deciles for each of the 120 variables, I want to calculate the average of a different characteristic (i.e. returns) for each decile and variable based on the sorting performed previously. It would be really helpful if you could clarify me whether I should import a dataset containing information on the two characteristics (i.e. 120 (months)*2(characteristics) columns and 9,630 rows). As I stated before, I am relatively new on Stata and I am used to import data from Excel.
3) The final output table containing the averages should exhibit 10 columns (i.e. one for each decile) and 120 rows (i.e. one for each month from January 2004 to December 2013)
Thank you in advance for your help.
Comment