Announcement

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

  • Store the fixed effects (FE) coefficients after a dummy FE regression

    Hi everyone,

    I am struggling with Stata to store the estimates of some fixed effects (FE) that I obtain after a regression of the following type:
    reg y i.individual i.region i.year, cluster(region)

    I would like to save the estimates of the individual FE in order to graph the distribution of those FE. I guess that I first need to store the estimates; if so, can someone explain me how to do that?

    Thanks in advance!
    Last edited by Tête de noeud; 02 Jun 2015, 06:38.

  • #2
    Hello "Tête de noeud",

    First, I suppose it's a nickname, if I recall my French lessons. Please re-register with your real name and family name (just by clicking on the "contack us" button and presenting the information).

    Second, I think that - xtreg - instead of - regress - will provide what you are longing for.

    Best,

    Marcos
    Best regards,

    Marcos

    Comment


    • #3
      Yes, please re-register with your real name. To amplify on what Marcos suggested, you can do the following

      Code:
      xtset individual
      xtreg y i.region i.year, cluster(region) fe
      predict individual_effect, u
      The variable individual_effect will be created and will contain the individual-level fixed-effect for each observation.

      Comment


      • #4
        Thanks a lot to both of you! It works, indeed.

        (Sorry, I didn't know I had to register under my real (full) name.)

        Comment


        • #5
          you do not HAVE to register under your real name - but many of us appreciate it; I have no doubt that some people do not register under their real name but they at least use a believable name and thus they never receive such requests

          Comment


          • #6
            Originally posted by Clyde Schechter View Post
            Yes, please re-register with your real name. To amplify on what Marcos suggested, you can do the following

            Code:
            xtset individual
            xtreg y i.region i.year, cluster(region) fe
            predict individual_effect, u
            The variable individual_effect will be created and will contain the individual-level fixed-effect for each observation.
            Hi, i have the same problem. I think this method works well when one estimate fixed effects model, but if just using fixed effects for something ( I mean just dummies in the regression, which is different from FE model), then the results tend to be different. Running FE model and then saving dummies is no the same as running simple regression with dummies, and saving then these coefficients on dummies. I'm still struggling how to do in the latter case.

            Comment


            • #7
              Kate:
              welcome to the list.
              As we cannot know your data, it would be very helpful if you could post what you typed and what Stata gave you back (as per FAQ). Thanks.
              Last edited by Carlo Lazzaro; 04 Nov 2015, 05:58.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Hi,
                Another efficient way to store the estimates of FE, in particular if you have high dimensional FE, is to use the command
                Code:
                reg2hdfe
                with the options
                Code:
                fe1(new varname) fe2(new varname)
                Code:
                search reg2hdfe
                Best, Josh

                Comment


                • #9
                  Hi Carlo, Clyde, Marcos

                  I tried the regression that Clyde recommended for estimating the co efficient of an FE model and it worked just fine. But also I am running a regression with sevral fixed effects; individual, company, audit firm. y = bX + þYeart + þClienti + þFirmj + þAuditor + eit (Bertrand and Schoar 2003). In order to measure the impact of say individual fixed effects, I am required to subtract the r squared of the model with all fixed effects from the model without individual fixed effects. This will tell how much including the individual fixed effects added to the explanatory variable. X are control variables.

                  I then link the estimated individual effects to the characteristics of individual auditors by the following model:d = a + Z + e


                  How do I go about this please?

                  Comment


                  • #10
                    It's not clear to me whether the "individuals" whose fixed effects you are interested in here are the clients or the auditors. For the sake of illustration, I'll assume it's the auditors. You can do something like this:

                    Code:
                    regress y x year i.client i.firm i.auditor
                    local r2_with = e(r2)
                    
                    regress y x year i.client i.firm if e(sample)
                    local r2_without = e(r2)
                    
                    display "Change in R2 = " %4.3f =`r2_with' - `r2_without'
                    As for the modeling those fixed effects, you would be better off getting them from the approach shown in #3 or that in #8 then trying to get them out of these two regressions.

                    All of that said, I don't understand why you would be doing this. It seems, if anything, like something that would be better done with a structural equations model or something like that. Perhaps this would be clear to anyone who has read the Bertrand and Schoar reference you cite. But do note that the reference you have provided is not helpful. It may be that everyone in your discipline would automatically recognize it and know where to find it. But this is a multi-disciplinary international forum, and what is folklore in your field may be unheard of in others. I, for one, have no idea what Bertrand and Schoar 2003 refers to, and your reference gives me insufficient information to find it were I interested in learning about it. On this forum you should always provide complete reference information.

                    Comment


                    • #11
                      Hi Clyde - here is the full reference of the article I'm looking at; Gul, F. A., et al. (2013). "Do Individual Auditors Affect Audit Quality? Evidence from Archival Data." The Accounting Review 88(6): 1993-2023. Gul modeled his after Betrand and Schoar (2003) - Bertrand, M., and A. Schoar. 2003. Managing with style: The effect of managers on firm policies. The Quarterly Journal of Economics 118 (4): 1169–1208.

                      Comment


                      • #12
                        Thank you. I will see if my institution makes those journals available to me.

                        Comment


                        • #13
                          Hi everyone,

                          I have to run a regression in the spirit of the one in the first post (reg y i.individual i.region i.year, cluster(region)), mine is reg y i.supervisor i.salesperson i.period, r and I want to store the supervisor FE so I did what you suggested and run:

                          xtset supervisor
                          xtreg y i.salesperson i.period, r fe
                          predict supervisor_effect, u
                          Which is fine. The problem comes when I do another excercise to compare the results (estimates) and see if the estimates are the same. So I run:

                          xi: reg i.supervisor i.salesperson i.period, r
                          parmest, format(estimate min95 max95 %8.2
                          f p %8.1e) saving(estimation.dta)
                          My problem is when I compare both estimation the coefficients for period are the same, but the ones for supervisor don't (and the same for salesperson). So I have the next questions, why these differences? Which method is better or more correct, the first one or the second one? (considering that I want to run the regression of the esitmates of the supervisors fixed things on different variables)

                          hanks and regards!
                          Last edited by Jose Ruiz; 08 Aug 2019, 14:39.

                          Comment


                          • #14
                            When you use -xi: reg...- you are implicitly selecting a particular supervisor to be the omitted category for the supervisor variable. But -xtreg- has its own way of representing the supervisor effects: this can result in different constant terms and supervisor effects. In particular, the u's all sum to zero, whereas the coefficients from -xi: reg i.supervisor...- will not. Then, if different supervisors have different numbers of observations with each salesperson, the salesperson coefficients can be affected as well.

                            Since none of these coefficients, in either model, is really meaningful, this doesn't matter. These coefficients are only meaningful when looked at in terms of differences between them. Those differences will be the same in both models. Also, predict xb will be the same either way.

                            Comment


                            • #15
                              Mr. Schechter,

                              Thanks for the reply, your comment was very helpful. In case that I didn't understand. In theory the predicted vaule for both models will be the "same". So if I do a ttest of the mean there will be no differences (neverless that graphically they didn't look the same)?
                              What do you refer about "These coefficients are only meaningful when looked at in terms of differences between them"? I understood the phrase but not how can I performi it in Stata.

                              Thanks again!

                              Comment

                              Working...
                              X