Announcement

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

  • Fama Macbeth regression

    Hello

    I'm currently working on a paper and would like to perform a Fama-Macbeth regression.
    I was thinking of using the excess returns as dependent variables and the 5 fama French factors as the independent variables.
    The issue I have is that I don't know what to do. I have found the code that is necessary for the regression but somehow it doesn't work out for me.

    Can someone help me out? I will add an excel file with the data I have. Thank you in advance.
    Attached Files

  • #2
    Originally posted by Britt Blom View Post
    Hello

    I'm currently working on a paper and would like to perform a Fama-Macbeth regression.
    I was thinking of using the excess returns as dependent variables and the 5 fama French factors as the independent variables.
    The issue I have is that I don't know what to do. I have found the code that is necessary for the regression but somehow it doesn't work out for me.

    Can someone help me out? I will add an excel file with the data I have. Thank you in advance.
    To post your data sample please use dataex !

    Comment


    • #3
      Giorgio makes an excellent suggestion. I would add that you should reduce the size of your data sample to the extent possible. Alternatively, demonstrate your issue with one of the datasets Stata provides. Also, you need to be more specific. "I have found the code... but somehow it doesn't work out for me" is not likely to get you a helpful response. What code did you use, and what error message did you get?
      Devra Golbe
      Professor Emerita, Dept. of Economics
      Hunter College, CUNY

      Comment


      • #4
        The entire code I would like to use is:

        cd "/Users/brittb/Desktop"

        use youtubereturns.dta, clear

        merge m:m Month using youtubefactors.dta

        encode Company, gen(Symbol)

        format Month %tm

        xtset EReturn Month

        sort Symbol Month

        bys Symbol: asreg EReturn MktRF SMB HML RMW CMA

        drop _R2 _adjR2

        asreg EReturn _b_MktRF _b_SMB _b_HML _b_RMW _b_CMA, fmb

        However I receive the following error when executing "xtset EReturn Month"
        repeated time values within panel
        r(451);

        I also added the data files used
        Attached Files

        Comment


        • #5
          See this Stata FAQ on dealing with reported repeat time values within a panel. Also, you should read and heed the Statlist Forum FAQs. asreg is presumably the code contributed by Attuallah Shah. Identify it as such and say where you got it.
          Devra Golbe
          Professor Emerita, Dept. of Economics
          Hunter College, CUNY

          Comment


          • #6
            You run
            Code:
            xtset EReturn Month
            but EReturn - Excess Returns - is your dependent variable, not your panel identifier. I think perhaps you want
            Code:
            xtset Symbol Month
            because your data are, I am guessing, monthly observations of companies, so each Company is a panel.

            Comment

            Working...
            X