I'm studying overreactions in the BVSP index and I need to check if after these reactions the return (R) reverts to the mean and in how many days. I started now, but I didn't find practical material regarding mean reversion. Can anyone help me with any tips?
Command used to capture and calculate exaggerated reactions signaled by dummy:
clear
getsymbols ^BVSP, fy(1993) freq(d) yahoo clear price (adjclose)
rename period refdate
rename r__BVSP R
sort refdate
gen R_1 = R[_n-1]
gen R_2 = R[_n-2]
gen R_3 = R[_n-3]
gen R_4 = R[_n-4]
gen R_5 = R[_n-5]
egen R_avg5 = rowmean (R_1 R_2 R_3 R_4 R_5)
egen R_sd5 = rowsd(R_1 R_2 R_3 R_4 R_5)
gen avg_sd2_5 = R_avg5 + (2 * R_sd5)
gen R_abs = .
gen R_n = R
drop R
replace R_abs = abs(R_n)
rename R_abs R
gen d_R_5 = 1 if R > avg_sd2_5
replace d_R_5 = 0 if R < avg_sd2_5
drop R
rename R_n R
Greetings
Related Posts with Reversion mean after overreactions
time variable mistakeHi, I have a balanced panel data set with data, for each cross-section, up until 2016 (i=10, t=147)…
gologit2 suddenly having problems in Stata 15I have sent this problem to Stata tech support. I will be amazed if anyone on the list can help me b…
Linear panel data: imposing MA(6) correlation errorsHello Statalist! I'm doing an exercise from Microeconometrics Using Stata, by Cameron and Trivedi, E…
R squared - Negative binomialHello everyone! I am currently performing some negative binomial regressions (xtnreg) with my pan…
Checking for Hetro in Longitudinal (Panel) DataGood Day, I am trying to check for hetro issue in my longitudinal data where the N is large and P is…
Subscribe to:
Post Comments (Atom)
0 Response to Reversion mean after overreactions
Post a Comment