Hi all,
I am attempting to create Idiosyncratic, and Systematic risk variables outlined in the steps below.
"A firm's idiosyncratic risk is the standard deviation of residuals from a regression of its daily excess stock returns (raw returns less the riskless rate) on the market factor (i.e., the value-weighted market return less the riskless rate).3 One firm-year observation of idiosyncratic risk is computed using firm-specific daily stock returns from one calendar year."
"Systematic Risk = A firm's systematic risk is the standard deviation of the predicted value from the above regression used to define idiosyncratic risk."
I currently have the following code;
*Calculate Beta
gen mofd = mofd(stata_date)
gen year = year(stata_date)
ssc install asreg
bys gvkey : asreg excess_return mkt_fct, wind(mofd 24)
*Or change window
bys gvkey : asreg excess_return mkt_fct, wind(year 1)
rename _b_cons Beta
*Calculating Idosyncratic risk
bys gvkey : asreg excess_return mkt_fct, wind (mofd 24)
predict resid, resid
summ resid
egen IDIO_RISK = sd(resid), by(gvkey Year)
I am struggling to reconcile the these monthly rolling window observations to one yearly firm observations. Whatsmore many of the observations appear to be negative which cannot be right.
Please let me know where I have gone wrong.
Cheers,
Flynn
I am attempting to create Idiosyncratic, and Systematic risk variables outlined in the steps below.
"A firm's idiosyncratic risk is the standard deviation of residuals from a regression of its daily excess stock returns (raw returns less the riskless rate) on the market factor (i.e., the value-weighted market return less the riskless rate).3 One firm-year observation of idiosyncratic risk is computed using firm-specific daily stock returns from one calendar year."
"Systematic Risk = A firm's systematic risk is the standard deviation of the predicted value from the above regression used to define idiosyncratic risk."
I currently have the following code;
*Calculate Beta
gen mofd = mofd(stata_date)
gen year = year(stata_date)
ssc install asreg
bys gvkey : asreg excess_return mkt_fct, wind(mofd 24)
*Or change window
bys gvkey : asreg excess_return mkt_fct, wind(year 1)
rename _b_cons Beta
*Calculating Idosyncratic risk
bys gvkey : asreg excess_return mkt_fct, wind (mofd 24)
predict resid, resid
summ resid
egen IDIO_RISK = sd(resid), by(gvkey Year)
I am struggling to reconcile the these monthly rolling window observations to one yearly firm observations. Whatsmore many of the observations appear to be negative which cannot be right.
Please let me know where I have gone wrong.
Cheers,
Flynn
Comment