question about discretionary accrual models
Posted: 23 July 2015 02:11 PM   [ Ignore ]
Total Posts:  1
Joined  2015-07-23

Dear Author and the forum,

I have been looking into the SAS code for the discretionary accrual estimation and it seems to me that for the parameter estimation, the code includes all year-industry observations, rather than excluding the one for which the discretionary accruals are to be estimated (i.e. effectively estimating n sets of parameters for each year-industry subsample of the size n). Do I understand the code correctly and if so, how do I adjust it?


Posted: 23 July 2015 05:37 PM   [ Ignore ]   [ # 1 ]
Total Posts:  901
Joined  2011-09-19

hi Kerrida,

Yes, in the accrual model here ( the regression is done by industry-year.

If you want to leave out one firm-year at the time, you need to basically write a ‘loop’ around this regression. I have a code snippet that may help you get started (not related to accrual models though):

%macro doBootstrap(filter);
doRegModel(data=h3.d_day_age2_wins (where=( date < &filter; or date > &filter; + 14)) , dep=totOfnsexport 7_1indep = &indep;);
data bootstrap_game;
set _outp1_3;
Parameter eq "Mgame1_14";
filter= &filter;run;
/* Add new obs to original data set */
proc append base=bootstrap data=bootstrap_game;


The %do_over is a very helpful macro by Clay ( Filter is a dataset that holds (in this case) dates to filter out (one at a time) (in your case you would push firm-years into the array).

The doBootstrap calls a macro where a regression runs, I keep the variable I need (you probably need to keep more variables).

If you run into limitations with %do_over (the array being too ‘deep’), you could chop the dataset into pieces by industry-year, and loop over industry-years (and within that loop, exclude one firmyear at the time).

Hope this helps,




To reply/post new questions: Please use the group WRDS/SAS on Google Groups!