Finding Analyst Estimates within a particular period
Posted: 25 June 2015 11:46 AM   [ Ignore ]
Newbie
Rank
Total Posts:  6
Joined  2015-06-24

Hi,

I am studying analyst expectations and I am looking to calculate forecast errors and forecast revisions. Forecast errors will be actual eps - initial consensus. Forecast revisions will be the difference between the final consensus estimate and the initial consensus estimate.

The initial consensus estimate is the average of the analysts’ most recent estimate (anndats) between the last annual earnings announcement date (anndats_act) and month 6.

The final consensus estimate is the average of the analysts’ most recent estimate between month 7 and the earnings announcement date.

I’m a sas newbie trying to put this together and I’m having difficulty coding for estimates in certain time periods.
I’m able to grab all analyst estimates that take place between the last earnings announcement and June if the earnings announcement takes place in the first half of the year. This is the first part of the below code. However I cannot figure out how to do this if the announcement is in the second half of the year. The second part of the below code will only include estimates between January and June of year t, however I would like to include estimates in t-1 so long as it’s after the last earnings announcement.


data ibex2; set ibesx;
IF month(anndats_act) ge 1 and month (anndats_act) lt 7 then do;
if month(anndats) LT 7;
if month(anndats) gt month(ANNDATS_ACT);
if anndats LT ANNDATS_ACT;end;
else if month(anndats_act) gt 6 and month(anndats_act) le 12
then do;
if month(anndats) LT 7;
if anndats lt anndats_act;end;
run;

My problem is the same but reversed when trying to determine final estimates. If the earnings announcement is in the second half of the year there’s no problem in getting estimates between July and announcement (second part of the below code). But for companies with announcements in the first half of the year I want to include estimates that took place after June t-1 up until announcement date in year t, but I don’t know what type of sas statement this would require. Right now the code below - before the else statement - includes estimates before June t-1, which I don’t require.

data ibesrev3; set ibesx;
IF month(anndats_act) ge 1 and month (anndats_act) lt 7 then do;
if anndats LT ANNDATS_ACT;end;
else if month(anndats_act) gt 6 and month(anndats_act) le 12
then do;
if month(anndats) GT 6 and month(anndats) LE 12;
if year(anndats)=year(anndats_act);
if anndats lt anndats_act;end;
run;


Does anyone have any suggestions on how I should go about tackling this problem?
Thanks very much,

B

Profile
 
 
Posted: 25 June 2015 01:11 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi B,

If I understand correctly, your problems are caused by first assuming that the fiscal year end is always December (having hardcoded month 6, 7, 12, etc), but at the same time you want to collect data for firms with any fiscal year end.

If that is indeed the case, it is probably a good idea to collect the data relative to the fiscal period end date. Use the function INTNX to create date variables relative to another date to create ‘cutoff’ dates. Something along these lines:
- using IBES with actuals dataset, collect relevant data for firm-years fiscalp, actual, last consensus)
- construct date variable (or variables) that define when you want to measure the initial forecast, for example: startDt = intnx(FY0EDATS, -11, b); format startDt date9.;/* didn’t test this, should be start of fiscal year; fiscal end date is called differently across tables*/
- get first consensus forecast after strartDt
- compute the 2 variables you need (revision as last forecast minus first forecast; error as actual - first)

Getting the ‘first’ consensus can be done by first getting all forecasts after startDt, then using proc sort to keep the first one, something like: proc sort data=mydataset; by ticker fiscalp statpers; run; proc sort data=mydataset nodupkey; by ticker fiscalp;

What the above sort does is to first sort by firmyear and the ibes date, and then sort again by firmyear and nodupkey, which will keep the oldest forecast (the ‘initial’).

Using the average forecast over the last 6 months as opposed to using the last before earnings announcement needs more gymnastics. Use INTNX construct another variable (fpedats - 6 months), take all forecasts for each firmyear between this date and the announcement date, and take the average.

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: 25 June 2015 03:51 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  6
Joined  2015-06-24

Hi Joost,

Thanks for responding. My full research is that I’m looking to see if there are any expectation errors in portfolios formed on book to market and gross profitability characteristics. Since these portfolios have been formed in June the idea is for the initial consensus forecast to also be established in June using analysts’ most recent forecast between June and the last annual earnings announcement date. So for example, say earnings were announced in February. I’d want all estimates after this date up to June. I’d remove any duplicate analysts, keeping the most recent estimate and the mean or median of these estimates would be my consensus. So essentially, because firms announce at different periods throughout the year,  estimates made from July t-1 to June t,  so long as its after an earnings announcement, could be used to form the initial consensus. And for the final consensus, I’m looking for all estimates from July t to June t+1 that are made before the earning announcements.

There’s no assumption that the fiscal period year end is December. The hardcoding of 6,7, and 12 is down to my coding deficiency :D. As you mentioned, I need something flexible.

Does your advice still hold based on my explanation?

Best Regards,

B

Profile
 
 
Posted: 25 June 2015 04:15 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi B,

Ok, thanks; that makes sense. A quick follow up question: are you only including fourth quarter earnings announcements? It seems the setup could be easier if you would include all quarterly earnings announcements.

Best Regards,

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: 25 June 2015 04:42 PM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  6
Joined  2015-06-24

Hi,

I’m using annual earnings announcements, but if it would be easier with quarterly then I’m open to suggestions.

Thanks,

B

Profile
 
 
Posted: 25 June 2015 05:38 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi B,

Annual earnings are the sum of the quarterly earnings. When Q4 earnings are announced, Q1-Q3 have been previously disclosed, so the ‘surprise’ in ‘annual’ earnings can only be in the Q4 portion.

The audit of Q4 is more thorough than Q1-Q3 (if any), so if that is an issue, it could make sense to limit to Q4. If that is not important, it is an option to use the preceding/current quarter at June 1.

Best,

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: 26 June 2015 06:31 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  6
Joined  2015-06-24

Hi,

OK, I’ll have a look into it. Thanks very much for your help. I really appreciate it.

B

Profile
 
 
Posted: 26 June 2015 08:05 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

You’re welcome—I just realize that another option is to use any 4 quarters relative to June 1 (that way you get to an annual number as well, where the quarters don’t need to be in the same fiscal year).

Take care,

Joost

 Signature 

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

Profile