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
Creating New Variable based on Values of Another Variable (by group)Hello Stata Friends: I would like to make the values of one variable, each into their own new varia…
Formulas of the regs' standard errorsWhere can I find the formulas that the different vce() in the reg command use? The help file does no…
Merging_adviseHi statalist community, I need some help with merging File A has a unique ID File B has a unique I…
Placing a dot and a line segment on a graphHi, I'd love to get some help on drawling a dot (or a filled in circle) at (126, 0) and a line segme…
Most Common Medication Unweighted and WeightedHello, I'm currently working with NHANES data attempting to combine multiple survey years together …
Subscribe to:
Post Comments (Atom)
0 Response to Reversion mean after overreactions
Post a Comment