全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1117 0
2012-04-21
[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?

[backcolor=rgba(255, 255, 255, 0.917969)]Thank you!


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! : )
portfood.rar
大小:(9.53 KB)

 马上下载

本附件包括:

  • portfood.dta



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群