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
Mediation problemHi all,I was investigating whether political identity would affect income through social networks, s…
Calculate number of days from selected date to the end of quarterDear All, If I have a table as below: ClinicID Visited Date 001 23Feb2021 002 15Apr2021 00…
What is the prediction model to predict the probability?In a paper, Dasgupta, 2019 used Difference-in-Difference approach to see whether anticollusion laws …
Generate a new variable and assigns 1 after a value increases in other variable.Dear Statalist users, I've been still struggling for a few hours after I tried several commands sea…
Temporary names and Mata matrix operationsDoes anyone know why the space after the row-join operator and before the tempname matrix matters in…
Subscribe to:
Post Comments (Atom)
0 Response to query about stata code
Post a Comment