Hi All
I am a beginner with Stata and am working with analyst data downloaded from IBES. I am using Stata to compute the dispersion of forecasts made by analysts over a certain period. The formula that I need to calculate is as follows:
Std Dev of earnings forecasts issued by individual analysts in year t/ Stock price of year t-1
I have used the following Stata code to do the above computation:
gen fyear=year(fpedats)
gen fmonth=month(fpedats)
gen year_actual=year(anndats_act)
gen month_actual=month(anndats_act)
sort ticker fyear analys fpedats
gen date=anndats_act-anndats
sort ticker fyear analys fpedats date
by ticker fyear analys fpedats: gen n=_n
keep if n==1 (deleting multiple forecasts from one analyst in a year)
sort ticker fyear (fpedats)
by ticker fyear: gen analyst_num=_N
sort ticker fyear (fpedats)
by ticker fyear: egen std_forecast_full=sd(value)
With the above code, I hope to compute the 1st part of my formula, that is std dev of forecasts issued by individual analysts. However, the mean of this final column (std_forecast_full) is very high like 1234.56 etc. I think this is not right.
Can someone please point what is wrong with above code? Can someone also tell what would be the code to divide this column with stock price from last year?
Thank you so much for the help! Please let me know shall further information be required.
Related Posts with Analyst Forecast Dispersion
xtprobit with time invariant dependent variableHey, I have a sample of start-ups and want to check if the probability of an Exit (IPO or M&A) …
Dropping duplicates randomlyHi I'd like to drop duplicates randomly instead of just the first duplicate observation. A snapsho…
Significance of the main effects when main effects aren't significant but interaction isDear Statalisters, Hi, I have a problem about interpreting significance of the main effects and int…
extracting data from numbersDear Statalists, I have an excel file with dates like 29.02.1980, 30.03.1980 and etc... I have appen…
Using frequency weights on graph bar to produce weighted averages.Hello. I am working with a dataset that has the number of births and number of preterm births in dif…
Subscribe to:
Post Comments (Atom)
0 Response to Analyst Forecast Dispersion
Post a Comment