Announcement

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

  • Using past stock return

    Hi, i am supposed to use basic linear predictive regression model (shown below) to predict if the past return can be used to predict stock return. Data that i have provided is monthly stock price, dividends (12-month moving sums of dividends paid on the S&P 500 index).
    Click image for larger version

Name:	Skjermbilde.PNG
Views:	1
Size:	2.4 KB
ID:	1478873


    I have tried executing following commands:
    gen return = (100*(Index[_n]-Index[_n-1]+(D12/12))) / Index[_n-1]
    gen lagreturn = return [_n-1]
    reg return lagreturn

    I appreciate all help, as i'm new to statistic analysis. I can also provide more information and data if necessary.
    Last edited by Filip Pierzgalski; 15 Jan 2019, 03:54.

  • #2
    Everything that you have shown sounds about right.

    Just make sure as you are doing this that

    1. your data is appropriately sorted by your time variable.

    2. And that you understand how these "12-month moving sums of dividends paid on the S&P 500 index" are calculated. You need to make sure that you are not using future information in your predictive regression. E.g., the D12 for period t must include only dividend from t and earlier. (Otherwise you introduce forward looking bias in your predictive regression.)

    Comment


    • #3
      You'll increase your chances of a helpful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. It helps a lot if we understand your data structure, know exactly what your ran, exactly what Stata reported, and can replicate your problem. It isn't clear whether you are working on data from one firm or from a bunch of firms, and whether beta is assumed to be constant across firms.

      The equation you pasted in is a bit confusing - from the description you really have returns as the dv, and lagged returns as the independent variable, but your equation has r and X suggesting they're not the same variable.

      I suspect you have panel data (multiple firms' stocks over time). It is much easier and less likely to create problems if you xtset your data and use L. for lags. If you only have one firm, you use tsset. With your code, you could easily lag across firms - for the first observation, return[_n-1] could be the return for another firm. When you use L., Stata knows not to lag across firms. You can also include L. in the regress statement saving you the trouble of generating the lags before.

      Comment


      • #4
        Filip, what you are showing seems fine. However when I use operations for which ordering is crucial like in this case, I have the habit to make sure that the appropriate ordering has been applied, like this:

        Code:
        . sort yyyymm
        
        . gen indexgrowth = (100*(Index[_n]-Index[_n-1]+(D12/12))) / Index[_n-1]
        Further, I would follow this approach only if some reason I do not want to use Stata's time series operators. E.g., I would manually generate the lags, etc.

        However you seem later to want to use the time series capabilities of Stata. The it is better if you use them consistently throughout. Like this:


        Code:
        . gen date = ym(floor( yyyymm/100 ), mod( yyyymm, 100 ))
        
        . format date %tm
        
        . tsset date, monthly
                time variable:  date, 1871m2 to 1873m7
                        delta:  1 month
        
        . gen indexgrowthTS = (100*(Index-L.Index+(D12/12))) / L.Index
        (1 missing value generated)
        
        
        
        . summ indexgrowth indexgrowthTS in 2/l
        
            Variable |        Obs        Mean    Std. Dev.       Min        Max
        -------------+---------------------------------------------------------
         indexgrowth |         29    .8361012    1.877456  -4.717631   3.739754
        indexgrowt~S |         29    .8361012    1.877456  -4.717631   3.739754


        Comment

        Working...
        X