Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculating monthly stock return volatility

    Hello,

    I have daily stock returns and want to calculate monthly stock return volatility from those on STATA but have no idea how to as i am fairly new to STATA. Any ideas?

    i came up with:

    bysort stock (month): gen return_variance = return_sd*return_sd

    but it's not working
    Last edited by Leonie Schneider; 19 Feb 2017, 17:34.

  • #2
    you can use:
    collapse (sd)return, by (month)

    Comment


    • #3
      Using collapse would delete all other variables and i need them for further analysis

      Comment


      • #4
        then use the following code to calculate the standard deviation :

        egen var = sd(return), by (stock month)

        Comment

        Working...
        X