[backcolor=rgba(255, 255, 255, 0.917969)]Hi all,
[backcolor=rgba(255, 255, 255, 0.917969)]I am doing the final Project now and have a question regarding the "tabulate" command in Stata. In my data set there are three variables that will be used to generate a particular table -
[backcolor=rgba(255, 255, 255, 0.917969)]one variable that is the company name (var name - comnam),
[backcolor=rgba(255, 255, 255, 0.917969)]one variable that is the monthly date (var name - datem), and
[backcolor=rgba(255, 255, 255, 0.917969)]one variable that is the monthly return of the company by datem (var name - ret).
[backcolor=rgba(255, 255, 255, 0.917969)]I want to make a two-way table in Stata to observe these three variables, in which Each row displays returns of different companies on a specific day and Each column displays returns of the same company in all dates. The table below is an example I made in EXCEL.
[backcolor=rgba(255, 255, 255, 0.917969)]
I found out that I could use "tabulate" (tab for short) to generate a table similar to this but the table I get only displays frequencies. I tried to use the "sum" option available in "tab" command but I could not manage to display the value (which is the return).
[backcolor=rgba(255, 255, 255, 0.917969)]May I ask how to code in order to generate such table?
P.S. My professor refers me to a command called "tabstat" but I still could not get the table I want because there is only one variable "prc" including prices of all companies. When you are listing such as "list datem prc", they will show up as such that first all prices of company 1 by date and then all prices of company 2 by date.
P.P.S. I have attached the dta file in the attachment for your convenience.
Again thank you very much for your time and patience! : )