Hello,
I would like to confirm whether I generate a variable in a proper way. The definition is as follows:
DISP=forecast dispersion measured as the standard deviation of stock price-deflated analyst forecasts issued within 90 days before earnings announcements.
My code:
sort gvkey fiscal_year fiscal_month
by gvkey fiscal_year: gen mean_forecast = mean(value)
gen DISP = (value-mean_forecast)/prcc_f
Should I/ how do I category the ones issued within 90 days before earnings announcements?
Thank you
Related Posts with query about stata code
sfcross commandhi i am using stata and "sfcross command" for calculating profit efficiency with cross sectional dat…
When to divide in subpopulations, using the margins command (AME) in a logit model?My goal is to compare the AMEs between two subpopulations of my sample in a logit model. However, th…
sfcross commandhi i am using stata and "sfcross command" for calculating profit efficiency with cross sectional dat…
Test for heteroscedasticity and autocorrelation after SUREG command (seemingly unrelated regression)Dear community, I have run a SUREG model and wanted to get some diagnositic tests such as test of h…
Loops to switch between different sub-foldersWhat is wrong with commands in this Stata do-file? I am trying to open all batch files that are in s…
Subscribe to:
Post Comments (Atom)
0 Response to query about stata code
Post a Comment