question about the Jones model code
Posted: 08 November 2011 09:23 PM   [ Ignore ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

Joost,

in this Jone’s model code.

2nd step, calculation of some variable inverse:

ATtm1Inverse = 1 / ATtm1;

Sas reported a lot of divided by zero error. becasue some of the ATtm1 are zero.

Will this be a problem?

Please kindly let me know how do you think about this.

Thanks!

 Signature 

Zenghui
A humble student of business

Profile
 
 
Posted: 09 November 2011 08:45 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Zenghui,

The macro uses the ‘lag’ function to computed lagged values. The first lagged observation will be the last observation of the previous firm. So, these observations need to be dropped.

The code uses this piece to clear those observations:

if GVKEY ne GVKEYtm1 OR FYEAR ne (FYEARtm1+1) then do;
  ACTtm1   = .;
  ATtm1   = .;
  CHEtm1   = .;
  DLCtm1   = .;
  LCTtm1   = .;
  PPEGTtm1 = .;
  PPENTtm1 = .;
  RECTtm1   = .;
  RECTRtm1 = .;
  SALEtm1   = .;
end;

Atm1 which is the scalar, is set to zero. As a result, many ‘division by zero’ errors occur, which are not a problem. (Observations with missing variables are not used in regressions.)

Another approach is to use proc sql to get lagged variables (match on a.fyear -1 = b.fyear and a.gvkey = b.gvkey, where a and b are the same dataset). Then, there is no need to ‘clean up’.

Hope this helps,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 13 November 2011 08:29 PM   [ Ignore ]   [ # 2 ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

Joost,

Sorry for the late reply. The past a few days are diaster for me.

I will learn more about this code. Thanks for your help.

Cheers,

 Signature 

Zenghui
A humble student of business

Profile