Hello,
I´m trying to obtain monthly standard deviation of residuals as a proxy for monthly idiosyncratic risk. We analyse 30 german Companies for the Year 2019. Therefore I computed the residuals by using "Fama French Five Factor Model" and calculated the daily standard deviation of residuals.
By using the following Code:
gen mofd = mofd(date)
rangestat(reg) tr MktRF SMB HML RMW CMA, interval (mofd 0 0) by (permno)
gen residual = tr - b_cons - b_MktRF * MkrRF- b_SMB* SMB- b_HML* HML - RMW * b_RMW - CMA * b_CMA
(tr is the daily excess return of a company; MktRF,SMB,HML,RMW,CMA are the independend variable of the FF Model)
egen monthly_sd_resid = sd(residual), by (mofd permno)
Now i obtained the daily standard deviation of residuals. In the next step I want to calculate the monthly data. So i would multiply the daily standard deviation with the square root of the number of trading days in the corresponding month. (square Root of N,with N=trading days of that month)
By using the code:
collapse (sd) SD_Monthly = residual, by (permno mofd)
I simply obtained the daily standard deviation on a monthly basis again. But I need this value multiplied by the square root of trading days of this month to get the monthly SD.
In the Attachment you can find the data I was referring to.
Any help would be highly appreciated. Thank you
Johannes Noever
Related Posts with Transform daily standard deviation of residuals to monthly standard deviation of residuals
using macro variables in loopDear all, I am writing to ask for help in using macro variables in loops. My code is something as …
Two-Sample KS testGood day, I have a sample of European countries and I'm analyzing bank profitability for EU banks w…
tabulate multiple variables with percentageHi, I need make table of age, sex, salary, hh_icnome by occupation in one table with only % figures…
Remove firms if fiscal year-end changesHello everyone, I have a question: for my research it's is relevant that there are no fiscal years-…
How to identify the "case" corresponding to the min value obtain from summary statisitcs?Hello I have run the following summary stats and obtained the following: . . sum a_buy_gas_elec_ap…
Subscribe to:
Post Comments (Atom)
0 Response to Transform daily standard deviation of residuals to monthly standard deviation of residuals
Post a Comment