Announcement

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

  • Factor Variables and Fama-MacBeth Regression

    Dear all,

    I wan to run a Fama-MacBeth style cross-sectional regression. The dependent variable in these regressions will be the the month-t return to stock i, Ri,t .The independent variables are dummies that indicate whether stock i is held (either so-called long or short) in month t as part of one of two strategies. In addition, I want to control for market capitalization. I want the following regression to be estimated:

    Rit = bo,jt + b1 sizei,t-1 + b3MOM_Winneri,t-1 + b4MOM_loseri,t-1 + b552W_Winneri,t-1 + bM652W_Loseri,t-1 + eit

    where MOM_Winneri,t-1 equals 1 if stock i’s past performance over a certain period is in the top 30% when measured by a specific performance criterion, and is zero otherwise. The dummy MOM_Loseri,t-1 equals 1 if stock i’s past performance over a certain period is in the bottom 30% and is zero otherwise. A similar logic applies for the 52W dummies. I know that I need to use factor variables in my regression, otherwise Stata will automatically omit my dummies. By definition, there is multicollinearity as stocks cannot satisfy both dummies within MOM and within 52W.


    So I used the following code after splitting my sample up in deciles:


    Code:
    gen dummy_nearness12mhigh = 1 if nearness12mhigh_a == 4 | nearness12mhigh_a == 5 | nearness12mhigh_a == 6 | nearness12mhigh_a == 7
    replace dummy_nearness12mhigh = 2 if nearness12mhigh_a == 10 | nearness12mhigh_a == 9 | nearness12mhigh_a == 8 
    replace dummy_nearness12mhigh = 3 if nearness12mhigh_a == 1 | nearness12mhigh_a == 2 | nearness12mhigh_a == 3 
    
    gen dummy_momentum12m = 1 if momentum12m_a == 4 | momentum12m_a == 5 | momentum12m_a == 6 | momentum12m_a == 7
    replace dummy_momentum12 = 2 if momentum12m_a == 10 | momentum12m_a == 9 | momentum12m_a == 8
    replace dummy_momentum12 = 3 if momentum12m_a == 1 | momentum12m_a == 2 | momentum12m_a == 3
    Next, I downloaded the user-written command xtfmb.

    HTML Code:
    tsset permno time
           panel variable:  permno (unbalanced)
            time variable:  time, 1964m1 to 2016m12, but with gaps
                    delta:  1 month
    
    . by permno: xtfmb return ln_size i.dummynearness12mhigh i.dummymomentum12m, verbose
    
    --------------------------------------------------------------------------------------------------------------------------------------------------
    -> permno = 10006
    factor variables and time-series operators not allowed
    r(101);
    Can anyone explain me what I exactly doing wrong? How can I solve this error

    Thank you in advance!

  • #2
    The user-written xtfmb command apparently has not been updated to support factor variable notation. You will have to create traditional dummy (0/1) variables to use with xtfmb.

    Comment

    Working...
    X