Announcement

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

  • Annualized Standard Deviation of Residuals from regression based on daily observations

    Hi all,
    I work with a panel dataset including about 3'000 companies (Variable: id) with daily observations (weekdays only) between 2000 to 2015 (Variable: Date). In order to approximate the unsystematic risk, I regress the daily returns of every company (for every year) on the Fama/French 3-Factor model to obtain the annualised root mean standard error (eg. standard deviation of residuals).

    So far I came up with the following code:

    Code:
    xtset id Date
    forval j = 2000/2015 {
    statsby rmse=e(rmse), by(id) saving(SD_Residuals, replace): regress Daily_Return MKT SML HML  if Year==`j'
    }
    However it takes incredibly long (a projected 45 hours), which is why I doubt that this is the correct or best solution. How can I make this code more efficient?

    Thanks very much!


  • #2
    Anyone still interested in this topic can find asreg extremely helpful, as asreg is fast and reports rmse among many other regression statistics in rolling as well as static windows.
    Code:
    ssc install asreg
    help asreg
    bys id year: asreg Daily_Return MKT SML HML, rmse
    More on asreg here https://fintechprofessor.com/stata-p...ions-in-stata/
    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
      i have the same problem and i have tried this code (bys ID year :asreg stock_return market_return, rmse ) however all the reported variables are of the same number(residuals, r squared, beta and so on)

      Comment


      • #4
        anyhelp??

        Comment

        Working...
        X