楼主: 管理考研
5164 4

求 SAS FAMA-FRENCH 三因素模型的程序 [推广有奖]

  • 4关注
  • 1粉丝

已卖:2份资源

讲师

2%

还不是VIP/贵宾

-

威望
0
论坛币
5470 个
通用积分
0
学术水平
0 点
热心指数
1 点
信用等级
0 点
经验
3891 点
帖子
130
精华
0
在线时间
649 小时
注册时间
2008-2-12
最后登录
2021-11-18

楼主
管理考研 发表于 2011-7-24 00:43:29 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
求   SAS    FAMA-FRENCH  三因素模型的程序  万谢 万谢
二维码

扫码加我 拉你入群

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

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

关键词:FRENCH 三因素模型 FAMA Fre Ama 程序 因素 模型 SAS

沙发
cufejinrong 发表于 2011-10-17 19:11:51
同求!!!!!!

藤椅
sike1211 发表于 2011-11-19 15:17:43

来源:http://blog.sina.com.cn/s/blog_8ab121f50100y3ec.html

option errors=1;

libname ff93 "F:\SAS Study ";

PROC IMPORT OUT= ff93.be

            DATAFILE= "F:\SAS Study \be.dta"

            DBMS=DTA REPLACE;

RUN;

data temp;set ff93.be;

year1=substr(accper,1,4);

year=input(year1,8.0);

if A300000>0;

rename A300000=BE;  

drop accper year1;

run;

data temp1;set temp;run;

proc sort; by stkcd year;run;

PROC IMPORT OUT= ff93.mret

            DATAFILE= "F:\SAS Study \mret.dta"

            DBMS=DTA REPLACE;

RUN;

data ff93.mret;set ff93.mret;

year=substr(trdmnt,1,4)+0;

month=substr(trdmnt,6,2)+0;

run;

data stock;set ff93.mret;

run;

data stock2;set stock;

if month=12;

run;

proc sql;

create table BM as select

stock2.Msmvosd, temp1.*

from stock2, temp1

where stock2.stkcd=temp1.stkcd and stock2.year=temp1.year;

quit;

data bm1;set bm;

BM=BE/Msmvosd;

rename Msmvosd=mktcap;

if BM=. then delete;

run;

proc sort; by year; run;

proc univariate noprint; var BM; by year; output out=bm2 pctlpts=30 70 PCTLPRE=dec;run;

data bm3;merge bm1 bm2; by year;

if bm<=dec30 then HL=0;

if dec30<bm<=dec70 then HL=1;

if bm>dec70 then HL=2;

run;

proc sql;

create table bm4 as select

bm3.dec30, bm3.dec70, bm3.HL, stock.*

from bm3, stock

where bm3.stkcd=stock.stkcd and bm3.year=stock.year-1;

quit;

data me1;set stock;

if month=6;

size=Msmvosd;

run;

proc sort; by year;run;

proc univariate noprint; var size; by year; output out=size2 pctlpts=50 PCTLPRE=dec;run;

data size3; merge me1 size2; by year;

if size>dec50 then big=1;else big=0;

keep stkcd year big size;

run;

data size4;set bm4;

if month>=7 then rankyear=year;

if month<7 then rankyear=year-1;

run;

proc sql;

create table me3 as select

size3.size, size3.big, size4.*

from size3, size4

where size3.stkcd=size4.stkcd and size3.year=size4.rankyear;

quit;

run;

data bm7;set me3;

if big=0 and hl=0 then portnum=1;

if big=0 and hl=1 then portnum=2;

if big=0 and hl=2 then portnum=3;

if big=1 and hl=0 then portnum=4;

if big=1 and hl=1 then portnum=5;

if big=1 and hl=2 then portnum=6;

run;

proc sort; by year month portnum; run;

proc summary;weight msmvosd;

var mretwd;

by year month portnum;

output out=port3 mean=vwm;

run;

proc transpose data=port3 out=port4 prefix=vwmpret; by year month; var vwm;run;

data port5;set port4;

smb=mean(vwmpret1, vwmpret2,vwmpret3)-mean(vwmpret4, vwmpret5,vwmpret6);

hml=mean(vwmpret3, vwmpret6)-mean(vwmpret1, vwmpret4);

drop _name_;

run;

data rm;set ff93.mret;run;

proc sort; by year month stkcd;run;

proc summary;weight msmvosd;

var mretwd;

by year month;

output out=rm1 mean=rm;

run;

PROC IMPORT OUT= ff93.interest

            DATAFILE= "F:\SAS Study \interest.dta"

            DBMS=DTA REPLACE;

RUN;

data int;set ff93.interest;

year1=substr(trdmnt,1,4);

month1=substr(trdmnt,6,2);

year=input(year1,8.0);

month=input(month1,8.0);

drop trdmnt year1 month1;

run;

proc sql;

create table rmf1 as select

rm1.year, rm1.month,rm-rf as mktrf, rm1.rm, int.rf

from rm1, int

where rm1.year=int.year and rm1.month=int.month;

quit;

proc sql;

create table factors as select

rmf1.*, port5.smb, port5.hml

from rmf1, port5

where rmf1.year=port5.year and rmf1.month=port5.month;

quit;

data ff93.3factors;set factors;

run;

板凳
こうえき 发表于 2011-11-20 19:19:26
sike1211 发表于 2011-11-19 15:17
来源:http://blog.sina.com.cn/s/blog_8ab121f50100y3ec.html

option errors=1;
太有爱了
那一年 那一夜 刹那永恒

报纸
whb110 发表于 2013-1-31 01:08:36
sike1211 发表于 2011-11-19 15:17
来源:http://blog.sina.com.cn/s/blog_8ab121f50100y3ec.html

option errors=1;
程序有个地方没有按照原文思想去做。作者要求按照中位数分组,您是对半分,这样是不对滴。要median。另外,25个组合也没有写程序。

请求补充一下25个组合的程序。注意t年和t-1年的分组要求及回报的计算方法。

多谢!!

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-24 10:05