Dear, all,
Can you help me calculate annual Volatility and Idiosyncratic Volatility from monthly CRSP data?
Annual volatility: The annualized standard deviation of monthly stock returns over the previous year.
Idiosyncratic Volatility: The standard deviation of the residual from a regression of monthly stock returns on the CRSP value‐weighted market portfolio return
thanks in advance
* Example generated by -dataex-. For more info, type help dataex
clear
input double permno long date double(ret vwretd)
10000 9496 . .04306149
10000 9527 .c .009830249000000001
10000 9555 -.2571428716182709 .07250131
10000 9586 .36538460850715637 .053886830000000004
10000 9616 -.09859155118465424 -.007903121
10000 9646 -.22265625 .05084652
10000 9677 -.005025125574320555 .01424398
10000 9708 -.08080808073282242 -.059700130000000004
10000 9737 -.6153846383094788 .06618293
10000 9769 -.05714285746216774 -.07901992000000001
10000 9800 -.24242424964904785 .04930472
10000 9828 .05999999865889549 .01509305
10000 9861 -.37735849618911743 -.02638714
10000 9891 -.21212121844291687 .1284987
10000 9919 0 .047921820000000004
10000 9951 -.38461539149284363 .02366445
10000 9981 -.0625 -.01699554
10000 10010 -.06666667014360428 .005122664000000001
10000 10042 . .04365455
10001 9496 . .04306149
10001 9527 .c .009830249000000001
10001 9555 .020408162847161293 .07250131
10001 9586 .025200003758072853 .053886830000000004
10001 9616 .009900989942252636 -.007903121
10001 9646 -.009803921915590763 .05084652
10001 9677 -.013069307431578636 .01424398
10001 9708 -.010204081423580647 -.059700130000000004
10001 9737 .07216494530439377 .06618293
10001 9769 -.003076923545449972 -.07901992000000001
10001 9800 .03921568766236305 .04930472
10001 9828 .056603774428367615 .01509305
10001 9861 .014999999664723873 -.02638714
10001 9891 -.0357142873108387 .1284987
10001 9919 -.07407407462596893 .047921820000000004
10001 9951 .03680000081658363 .02366445
10001 9981 -.03921568766236305 -.01699554
10001 10010 -.0714285746216774 .005122664000000001
10001 10042 .051428571343421936 .04365455
10001 10073 .021276595070958138 .04424724
10001 10104 .0833333358168602 .0371465
10001 10134 -.02230769209563732 -.02077283
10001 10164 .019999999552965164 -.2253613
10001 10195 -.029411764815449715 -.07227181
10001 10226 -.03353535383939743 .07032388
10001 10255 .06382978707551956 .04487472
10001 10286 .07999999821186066 .051691270000000004
10001 10317 -.07629629969596863 -.01659768
10001 10346 .030612245202064514 .01099253
10001 10378 .019801979884505272 .0004473087
10001 10408 -.01203883532434702 .05145697
10001 10437 .029999999329447746 -.007272285000000001
10001 10470 .029126213863492012 -.02800578
10001 10500 -.021132076159119606 .03720373
10001 10531 .03921568766236305 .01764535
10001 10561 0 -.01641086
10001 10591 -.021132076159119606 .02107066
10001 10623 .019607843831181526 .06610128
10001 10651 .03846153989434242 -.01644182
10001 10682 .017777778208255768 .02146452
10001 10710 .07407407462596893 .04820698
10001 10743 -.03448275849223137 .03933567
10001 10773 .017142856493592262 -.004855535
10001 10804 .0357142873108387 .07712836
10001 10835 .27586206793785095 .022126
10001 10864 -.027027027681469917 -.0014733320000000002
10001 10896 .07042253762483597 -.02928516
10001 10926 .03947368264198303 .01781615
10001 10955 .037974681705236435 .01829401
10001 10988 -.018518518656492233 -.07011361
10001 11016 -.006289307959377766 .01489994
10001 11046 .012658228166401386 .02414776
10001 11077 0 -.028283060000000002
10001 11108 -.012658228166401386 .0889347
10001 11137 .014102564193308353 -.004192862
10001 11169 .025641025975346565 -.009391909
10001 11200 -.05000000074505806 -.0919028
10001 11228 .04078947380185127 -.05384421
10001 11261 -.012820512987673283 -.01249875
10001 11291 0 .06574162
10001 11322 .00129870162345469 .02951084
10001 11353 .01315789483487606 .04908338
10001 11381 .012987012974917889 .07584751
10001 11409 -.011538460850715637 .02892205
10001 11442 .03947368264198303 .0033108020000000003
10001 11473 0 .04073652
10001 11501 .07848101109266281 -.04402354
10001 11534 -.0357142873108387 .04677859
10001 11564 .1358024626970291 .026806780000000002
10001 11595 .013043479062616825 -.01097861
10001 11626 .1304347813129425 .017847000000000002
10001 11655 .13461539149284363 -.03729085
10001 11687 -.0067796604707837105 .1067822
10001 11718 -.0517241396009922 -.0011635480000000001
10001 11746 -.20000000298023224 .013355210000000001
10001 11778 .08181818574666977 -.02369942
10001 11808 .010638297535479069 .01341432
10001 11837 .010526316240429878 .006407138000000001
10001 11869 -.007708333432674408 -.0192581
10001 11900 .06382978707551956 .03989972
10001 11931 .03999999910593033 -.02081892
end
format %td date
Can you help me calculate annual Volatility and Idiosyncratic Volatility from monthly CRSP data?
Annual volatility: The annualized standard deviation of monthly stock returns over the previous year.
Idiosyncratic Volatility: The standard deviation of the residual from a regression of monthly stock returns on the CRSP value‐weighted market portfolio return
thanks in advance
* Example generated by -dataex-. For more info, type help dataex
clear
input double permno long date double(ret vwretd)
10000 9496 . .04306149
10000 9527 .c .009830249000000001
10000 9555 -.2571428716182709 .07250131
10000 9586 .36538460850715637 .053886830000000004
10000 9616 -.09859155118465424 -.007903121
10000 9646 -.22265625 .05084652
10000 9677 -.005025125574320555 .01424398
10000 9708 -.08080808073282242 -.059700130000000004
10000 9737 -.6153846383094788 .06618293
10000 9769 -.05714285746216774 -.07901992000000001
10000 9800 -.24242424964904785 .04930472
10000 9828 .05999999865889549 .01509305
10000 9861 -.37735849618911743 -.02638714
10000 9891 -.21212121844291687 .1284987
10000 9919 0 .047921820000000004
10000 9951 -.38461539149284363 .02366445
10000 9981 -.0625 -.01699554
10000 10010 -.06666667014360428 .005122664000000001
10000 10042 . .04365455
10001 9496 . .04306149
10001 9527 .c .009830249000000001
10001 9555 .020408162847161293 .07250131
10001 9586 .025200003758072853 .053886830000000004
10001 9616 .009900989942252636 -.007903121
10001 9646 -.009803921915590763 .05084652
10001 9677 -.013069307431578636 .01424398
10001 9708 -.010204081423580647 -.059700130000000004
10001 9737 .07216494530439377 .06618293
10001 9769 -.003076923545449972 -.07901992000000001
10001 9800 .03921568766236305 .04930472
10001 9828 .056603774428367615 .01509305
10001 9861 .014999999664723873 -.02638714
10001 9891 -.0357142873108387 .1284987
10001 9919 -.07407407462596893 .047921820000000004
10001 9951 .03680000081658363 .02366445
10001 9981 -.03921568766236305 -.01699554
10001 10010 -.0714285746216774 .005122664000000001
10001 10042 .051428571343421936 .04365455
10001 10073 .021276595070958138 .04424724
10001 10104 .0833333358168602 .0371465
10001 10134 -.02230769209563732 -.02077283
10001 10164 .019999999552965164 -.2253613
10001 10195 -.029411764815449715 -.07227181
10001 10226 -.03353535383939743 .07032388
10001 10255 .06382978707551956 .04487472
10001 10286 .07999999821186066 .051691270000000004
10001 10317 -.07629629969596863 -.01659768
10001 10346 .030612245202064514 .01099253
10001 10378 .019801979884505272 .0004473087
10001 10408 -.01203883532434702 .05145697
10001 10437 .029999999329447746 -.007272285000000001
10001 10470 .029126213863492012 -.02800578
10001 10500 -.021132076159119606 .03720373
10001 10531 .03921568766236305 .01764535
10001 10561 0 -.01641086
10001 10591 -.021132076159119606 .02107066
10001 10623 .019607843831181526 .06610128
10001 10651 .03846153989434242 -.01644182
10001 10682 .017777778208255768 .02146452
10001 10710 .07407407462596893 .04820698
10001 10743 -.03448275849223137 .03933567
10001 10773 .017142856493592262 -.004855535
10001 10804 .0357142873108387 .07712836
10001 10835 .27586206793785095 .022126
10001 10864 -.027027027681469917 -.0014733320000000002
10001 10896 .07042253762483597 -.02928516
10001 10926 .03947368264198303 .01781615
10001 10955 .037974681705236435 .01829401
10001 10988 -.018518518656492233 -.07011361
10001 11016 -.006289307959377766 .01489994
10001 11046 .012658228166401386 .02414776
10001 11077 0 -.028283060000000002
10001 11108 -.012658228166401386 .0889347
10001 11137 .014102564193308353 -.004192862
10001 11169 .025641025975346565 -.009391909
10001 11200 -.05000000074505806 -.0919028
10001 11228 .04078947380185127 -.05384421
10001 11261 -.012820512987673283 -.01249875
10001 11291 0 .06574162
10001 11322 .00129870162345469 .02951084
10001 11353 .01315789483487606 .04908338
10001 11381 .012987012974917889 .07584751
10001 11409 -.011538460850715637 .02892205
10001 11442 .03947368264198303 .0033108020000000003
10001 11473 0 .04073652
10001 11501 .07848101109266281 -.04402354
10001 11534 -.0357142873108387 .04677859
10001 11564 .1358024626970291 .026806780000000002
10001 11595 .013043479062616825 -.01097861
10001 11626 .1304347813129425 .017847000000000002
10001 11655 .13461539149284363 -.03729085
10001 11687 -.0067796604707837105 .1067822
10001 11718 -.0517241396009922 -.0011635480000000001
10001 11746 -.20000000298023224 .013355210000000001
10001 11778 .08181818574666977 -.02369942
10001 11808 .010638297535479069 .01341432
10001 11837 .010526316240429878 .006407138000000001
10001 11869 -.007708333432674408 -.0192581
10001 11900 .06382978707551956 .03989972
10001 11931 .03999999910593033 -.02081892
end
format %td date
Comment