Announcement

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

  • volatility of the firm's equity(annualized standard deviation)

    Dear All,

    Hope my msg finds you very well.

    I have a panel data 252 observations (daily ) (id, date,prc,ret and shrout) noting that ret=daily % change.
    Please , how i can generate/ calculate an annualized standard deviation .
    Please find below an example of data structure .

    Many thanks in advance
    gvkey date prc ret shrout
    1005 2-Jan-81 26.375 0.004762 906
    1005 5-Jan-81 26.875 0.018957 906
    1005 6-Jan-81 26 -0.03256 906
    1005 7-Jan-81 23.875 -0.08173 906
    1005 8-Jan-81 22.875 -0.04188 906
    1005 9-Jan-81 22.5 -0.01639 906
    1005 12-Jan-81 22.5 0 906
    1005 13-Jan-81 22.375 -0.00556 906
    1005 14-Jan-81 22.25 -0.00559 906
    1005 15-Jan-81 23.5 0.05618 906
    1005 16-Jan-81 25 0.06383 906
    1005 19-Jan-81 24.625 -0.015 906
    1005 20-Jan-81 24.25 -0.01523 906
    1005 21-Jan-81 24.375 0.005155 906
    1005 22-Jan-81 24.625 0.010256 906
    1005 23-Jan-81 24.75 0.005076 906
    1005 26-Jan-81 24.125 -0.02525 906
    1005 27-Jan-81 24.125 0 906
    1005 28-Jan-81 24 -0.00518 906
    1005 29-Jan-81 23.75 -0.01042 906
    1005 30-Jan-81 24 0.010526 906
    1005 2-Feb-81 17.875 -0.06901 1133
    1005 3-Feb-81 18.75 0.048951 1133
    1005 4-Feb-81 19.375 0.033333 1133
    1005 5-Feb-81 19.75 0.019355 1133
    1005 6-Feb-81 18.625 -0.05696 1133

  • #2
    Code:
    gen year = year(date)
    
    bys gvkey year: egen sd_daily = sd(ret)
    
    gen sd_annual = sqrt(252)*(sd_daily)
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #3
      Thank you Attaullah.

      Comment

      Working...
      X