Announcement

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

  • Right way of sorting before asreg (reproducability or random), Are out of sample FM slopes reproducable?

    Every time I run the following code I get different results (altough similar) for the out of sample predictive model. And a different number of observations. I do not get the same issue with the in-sample FM slopes.

    For instance,

    Code:
    xtset permno date
    
    asreg yearly_return ROA, newey(17) window(date -120 -1)

    My first guess was that this was due to random sorting or something similar.

    For in sample slopes I do not get the same issue.

    Any intuition behind this?
    Last edited by Julien Maas; 01 Dec 2023, 08:14.

  • #2
    Note.

    I think I found the solution.


    Since I am doing cross sectional regressions I can simply sort based on the date and permno, to always start with the same sorting and get consistent results.

    Code:
    sort date permno 
     asreg yearly_return ROA, newey(17) window(date -120 -1)

    Comment

    Working...
    X