| 所在主题: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 文件名: data1.xls | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 资料下载链接地址: https://bbs.pinggu.org/a-1170539.html | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 附件大小: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
这是朋友的来信,不过我有7,8年没用过SAS,语法都忘光了,只能求助于各位朋友了。下面是朋友的来信:
--------------------------------------------------- Can I seek your help on SAS PROC MEAN?
What I need is I want to first find the average for each stock for each period.
Then I want to average the stock's turnover average for each period.
As an example, I first need to know stock's 1 turnover average for 2000 Q1. = (54+34+64+12)/4 = 41
Then I need to know stock's 2 turnover average for 2000 Q1. = (31+42+52+53)/4 = 44.5
Then I need to find the simple average of all the stock's turnover for 2000 Q1. = (41+44.5) / 2 = 42.75
Ultimately, I want to find out the 42.75 for each time period.
Right now the way I'm doing it is the following.
proc means no print data = turnover maxdec = 9; output out = turnover1; class date share; variable turnover; run;
Then I will get something like this
2000Q1 1 41 2 44.5
Then to find the simple average of all the stock's average turnover for 2000Q1, I will manually find the average by adding 41 to 44.5 and then divide it by 2.
However, this is incredibly time consuming because I have around 1000 stocks for each time period. If I sum it up manually and then divide it by the number of stocks.
So, may I ask if you have any simpler methods to help me obtain my final answer?
Thank you so much |
||||||||||||||||||||||||||||||||||||||||||||||||||||
熟悉论坛请点击新手指南
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| 下载说明 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。 2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。 3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。 (如有侵权,欢迎举报) |
||||||||||||||||||||||||||||||||||||||||||||||||||||
京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明