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
Ellip (ellipse) issuesGreetings - my first post, so apologies for being ignorant of conventions, any directions/instructio…
graphing a change with xtlineHello, I have issues with the command to generate a graph which will show a change of my variable o…
Bar charts: Percent on y-axis, absolute count over each bar?Hi, I'm making a bunch of barcharts, some using graph, some using catplot, like this: Code: grap…
I am shocked that Stata may not understand variable names literallyI have this simplest dataset. var new 0 1 Then I type tab va then it should throw me an error sa…
can we order the variables after -egen- ? Code: egen progsvness=rowmean(techAdvt prodAdvt) order progsvness,a(prodAdvt) the cod…
Subscribe to:
Post Comments (Atom)
0 Response to Transform daily standard deviation of residuals to monthly standard deviation of residuals
Post a Comment