请选择 进入手机版 | 继续访问电脑版
楼主: lizhewenbei
2496 9

请大神指教:程序和数据均无误,为何操纵性应计DA计算不正确?有程序有数据,恳请检验 [推广有奖]

  • 15关注
  • 5粉丝

副教授

36%

还不是VIP/贵宾

-

威望
0
论坛币
309 个
通用积分
11.4770
学术水平
4 点
热心指数
13 点
信用等级
5 点
经验
9699 点
帖子
609
精华
0
在线时间
496 小时
注册时间
2008-2-6
最后登录
2024-1-9

lizhewenbei 学生认证  发表于 2014-11-14 10:55:19 |显示全部楼层 |坛友微信交流群
相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
%macro aa;/*导入现金流量表*/
%do i=1 %to 2;
  proc import out=fs_comscfd&i.
  datafile="E:\da_calcu\FS_Comscfd&i..txt"
dbms=tab replace;getnames=yes; datarow=4;run;
%end;%mend;%aa

data fs_comscfd;set fs_comscfd1-fs_comscfd2;run;

%macro bb;/*导入利润表*/
%do i=1 %to 2;
proc import out=fs_comins&i.
datafile="E:\da_calcu\fs_comins&i..txt"
dbms=tab replace;
getnames=yes; datarow=4;run;
%end;%mend;%bb

data fs_comins;set fs_comins1-fs_comins2;run;

%macro cc;%do i=1 %to 2;/*导入资产负债表*/
proc import out=fs_combas&i.
datafile="E:\da_calcu\fs_combas&i..txt"
dbms=tab replace;
getnames=yes; datarow=4;run;
%end;%mend;%cc

data fs_combas;set fs_combas1-fs_combas2;run;

/*选出当前年份的归属行业*/
proc import out=indcd_year
datafile='e:\da_calcu\indcd_year.xls' dbms=excel replace;
getnames=yes; SCANTEXT=Yes;run;
data indcd_year;set indcd_year;length stkcd 8;run;

proc sort data=fs_combas;by stkcd accper;run;
proc sort data=fs_comins;by stkcd accper;run;
proc sort data=fs_comscfd;by stkcd accper;run;


proc sql;
create table fin as select
a.stkcd, d.ind,
year(a.accper) as year,
b.b001100000 as rev,
c.c001000000 as cfo,
b.b002000101-c.c001000000 as tacc,
a.a001000000 as ta,
a.a001111000+ a.a001110000 as rec,
a.a001212000 as ppe
from fs_combas a,   fs_comins b,   fs_comscfd c,  indcd d
where a.stkcd=b.stkcd and a.stkcd=c.stkcd and a.stkcd=d.stkcd
and month(a.accper)=12 and month(b.accper)=12 and month(c.accper)=12
and year(a.accper)=year(b.accper) and year(a.accper)=year(c.accper) and year(a.accper)=d.year/**/
order by stkcd,year;
drop table fs_combas1,fs_combas2,fs_comins1,fs_comins2,fs_comscfd1,fs_comscfd2;
quit;


/*将各指标除以期初总资产*/
proc sql;
create table idx as
select distinct a.stkcd,a.year,a.ind,
a.tacc/b.ta as tacc format=11.8,
1/b.ta as a0 format=20.18,
(a.rev-b.rev)/b.ta as rev format=10.8,
(a.rev-b.rec)/b.ta as rec,
a.ppe/b.ta as ppe format=10.8
from fin a,   fin b
where a.stkcd=b.stkcd and a.year=b.year+1 and b.ta>0
order by stkcd,year;

/*计算各行业的观测值数目*/
create table regtj as select distinct ind,year,n(stkcd) as nn from idx group by ind,year;

/*要求各行业每年至少有15个观测值*/
create table idx1 as
select distinct a.*,b.nn  from idx a,regtj b
where a.ind=b.ind and a.year=b.year and b.nn>=15 and a.tacc ne .
order by ind,year,stkcd;
quit;

/*分行业、年度估计三个回归参数*/
proc reg data=idx1 outest=ot;
model tacc=a0 rev ppe/noint adjrsq;
by ind year;
run;

/*计算操纵性应计项目*/
proc sql;
create table da1 as
select distinct a.stkcd,a.year,a.ind,
b.a0*a.a0+b.rev*(a.rev-a.rec)+b.ppe*a.ppe as nda format=10.6,
a.tacc-(calculated nda) as da1 format=10.6
from idx1 a,ot b
where a.ind=b.ind and a.year=b.year and _adjrsq_>=0.01
order by stkcd,year;
quit;/*计算出的DA放在数据集da1中*/

/*描述:结果很奇怪*/
proc sort data=da1;by da1;run;
proc means data=da1;var da1;run;


二维码

扫码加我 拉你入群

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

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

关键词:操纵性 calculate Distinct proc sql replace 程序 资产负债表 replace import 利润表

DA_CALCU.rar

5 MB

DA计算的程序和数据

lizhewenbei 学生认证  发表于 2014-11-22 01:54:47 |显示全部楼层 |坛友微信交流群
自己顶一下,希望大神能指点啊。

使用道具

teqel 发表于 2014-11-22 06:07:20 |显示全部楼层 |坛友微信交流群
set fs_comins1-fs_comins2;这句是什么意思,没看懂

使用道具

lizhewenbei 学生认证  发表于 2014-11-22 11:23:02 |显示全部楼层 |坛友微信交流群
teqel 发表于 2014-11-22 06:07
set fs_comins1-fs_comins2;这句是什么意思,没看懂
我的意思是,先把数据库下载的两张利润表信息导入SAS,再使用set语句,将两张表格纵向合并,所以用了data fs_comins;set fs_comins1-fs_comins2;run;

使用道具

teqel 发表于 2014-11-23 13:11:10 |显示全部楼层 |坛友微信交流群
虽然不明白你的具体目的是什么,但是我感觉你这一部分的程序很危险:
其中stkcd不是unit的,year(a.accper)也不是,用sql会产生很多虚假的行。如果不会操纵的话,还是老老实实使用data step 的match merge比较安全
proc sql;
        create table fin as select
                a.stkcd, d.ind,
                year(a.accper) as year,
                b.b001100000 as rev,
                c.c001000000 as cfo,
                b.b002000101-c.c001000000 as tacc,
                a.a001000000 as ta,
                a.a001111000+ a.a001110000 as rec,
                a.a001212000 as ppe
        from fs_combas a,   fs_comins b,   fs_comscfd c,  indcd d
                where a.stkcd=b.stkcd and a.stkcd=c.stkcd and a.stkcd=d.stkcd
                        and month(a.accper)=12 and month(b.accper)=12 and month(c.accper)=12
                        and year(a.accper)=year(b.accper) and year(a.accper)=year(c.accper) and year(a.accper)=d.year/**/
        order by stkcd,year;
        drop table fs_combas1,fs_combas2,fs_comins1,fs_comins2,fs_comscfd1,fs_comscfd2;
quit;

使用道具

lizhewenbei 学生认证  发表于 2014-11-23 18:14:17 |显示全部楼层 |坛友微信交流群
teqel 发表于 2014-11-23 13:11
虽然不明白你的具体目的是什么,但是我感觉你这一部分的程序很危险:
其中stkcd不是unit的,year(a.accper ...
谢谢teqel,你说的有道理,确实有风险。
我用这个procsql语句,无非是想把资产负债表、利润表等数据合并,其效果完全等同于merge,其实用merge说不定要好很多。
另外我问一下,你所说的stkcd、year(a.accper)不是unit的,是指的啥意思?

使用道具

teqel 发表于 2014-11-24 00:36:27 |显示全部楼层 |坛友微信交流群
lizhewenbei 发表于 2014-11-23 18:14
谢谢teqel,你说的有道理,确实有风险。
我用这个procsql语句,无非是想把资产负债表、利润表等数据合并 ...
我试了一下,没有问题,是我看错了。想说unique,写错了,呵呵。/*分行业、年度估计三个回归参数*/这个程序出来不少missing value,我太懂这个

使用道具

lizhewenbei 学生认证  发表于 2014-11-24 14:35:16 |显示全部楼层 |坛友微信交流群
teqel 发表于 2014-11-24 00:36
我试了一下,没有问题,是我看错了。想说unique,写错了,呵呵。/*分行业、年度估计三个回归参数*/这个程 ...
model tacc=a0 rev ppe/noint adjrsq;这个语句是为了按照修正的琼斯模型,计算上市公司本应有的应计项目,拟合的tacc就是本应有的正常应计项目,或者称为非操纵性应计项目。而剩余的部分就是我们常说的盈余管理,或者叫做操纵性应急项目

使用道具

teqel 发表于 2014-11-25 01:23:09 |显示全部楼层 |坛友微信交流群
lizhewenbei 发表于 2014-11-24 14:35
model tacc=a0 rev ppe/noint adjrsq;这个语句是为了按照修正的琼斯模型,计算上市公司本应有的应计项目, ...
这个得向你学习

使用道具

lizhewenbei 学生认证  发表于 2014-11-25 17:22:41 |显示全部楼层 |坛友微信交流群
teqel 发表于 2014-11-25 01:23
这个得向你学习
你太客气了,我也是摸索中的人,咱们共同努力

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-3-29 14:11