楼主: zhd894250
1149 0

[其他] Question regarding generating a table [推广有奖]

  • 0关注
  • 0粉丝

学前班

80%

还不是VIP/贵宾

-

威望
0
论坛币
7 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
29 点
帖子
4
精华
0
在线时间
1 小时
注册时间
2011-9-20
最后登录
2012-10-8

楼主
zhd894250 发表于 2012-4-21 00:25:22 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
[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


二维码

扫码加我 拉你入群

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

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

关键词:generating regarding question regard RATING particular regarding generate question command

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-7 05:42