Announcement

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

  • Multiple fixed effects regression without omitted category and with coefficients storage

    Hello everyone.

    I am new to Stata and this is my first post on Statalist. I’m still learning how to use the software, and Statalist has been extremely helpful so far! However, I’m in a situation in which previous lists’ answers haven’t been able to help me advance.

    For context, I am using Stata 12 in a Windows 8 PC in a firewalled server. I am not able to install packages at will, and need to request these installations (that take a very long time to be processed, as in weeks). Therefore, I have a strong preference for non community-contributed commands. I’m afraid I cannot provide data samples, also due to the firewall on protected data.

    I have a database on 12th grade students’ math and reading test scores and other covariates for five consecutive years. I also have information on the schools (school_id) and classrooms (class_id) these students are enrolled in, the principal (principal_id) leading the school in that particular year and math and reading teachers (math_id and read_id) teaching these 12th grade classrooms. There are also school, teacher and principal covariates. This database has 203K observations and around 160 available variables, most of which I will not use.

    I wish to run a regression with multiple fixed effects. My objetive here is to obtain the principal fixed effect, which will be the dependent variable in a later step of my research. I have several questions on what is the best way to approach this.

    The simpler regression I inted to run is of math test scores against school controls and principal, school and math teacher fixed effects. Currently, I have the following approach:

    Code:
    xi: reg math_score `school_controls` i.principal_id i.school_id i.math_id, vce(robust) noomit
    where `school_controls` are variables to control for time-varying school effects (12 variables).

    The below questions are currently hauting me:
    1. Since the fixed effect coefficients for all principal_id categories (every principal) are my parameters of interest, I do not want any principal to me omitted. I understand both the -xi:- prefix and the -noomit- suffix accomplish this. Is this approach correct?
    2. I am not using the -xtreg,fe- as I understand this would include fixed effects for students, which is what uniquely identifies the panel I have. This is why I am not using the -xt- class commands (as in -xtset- and -xtreg-). Should I reconsider the -xt- class commands?
    3. I would like to save these principal fixed effects coefficients (around 1000 distinct principals). Ideally, I'd have a dataset with all pincipal_id and their respective FE coefficients from the regression. How could I store these coefficients with the respective principal_id in the same database used for the regression, or in another with just these two information? (I have found many answers recommending outreg2, and even though I have requested it to be installed, Idoubt it will be available to me anytime soon).
    I apologise for not being able to provide a clearer explanation with data examples. If any clarification on these questions, the database or the code being used is needed, please do feel free to ask!
    Thank you in advance!

  • #2
    Murilo:
    welcome to this forum.
    I'd consder the community-contributed module -reghdfe-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      Thank you for your reply!
      I have requested the installation of the -reghdfe- module. Due to the firewalled server, this is estimated to take quite some time. Would you happen to have a suggestion without a community-contributed module?
      Thank you once again.

      Comment


      • #4
        Murilo:
        as far as I know, the community-contributed module -reghdfe- is the only resource for what you're after.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          One option you can use is to implement the method yourself.
          I have my own command (ssc) regxfe that also comes with its own paper that describes the algorithm for estimating this type of models. In the paper I also point ou at an earlier paper (( by the author of poisson fe) that gives you an equally detailed description of the method with a manual implementation.
          Hth
          Fernando

          Comment


          • #6
            Dear Carlo,
            Thank you once again for your answer. I will see what I can do speed things up on my end regarding -reghdfe- then.

            Dear Fernando,
            Thank you for your help. Could you please link this paper so I can have a look (in case its allowed)?

            Comment


            • #7
              Of course
              This is one of them. Should be the easier to implement
              Guimar˜aes, P., and P. Portugal. 2010. A simple feasible procedure to fit models with high-dimensional fixed effects. Stata Journal 10: 628–649.
              https://journals.sagepub.com/doi/pdf...867X1101000406
              and here is mine:
              https://journals.sagepub.com/doi/pdf...867X1501500318

              Comment


              • #8
                Dear Fernando,
                Thank you very much! I'll have a look at both papers.

                Comment


                • #9
                  Hi Carlo Lazzaro,

                  I am using the following command for my panel data estimation:

                  reghdfe y x1 x2 x3 x4, absorb(bank year bank*year) vce(cluster bank); where I declare my dataset as xtset bank year, yearly.

                  Does it make sense if I consider bank, year and their interaction together as fixed effects? Many previous studies drop bank and year individual fixed effects before including their interaction.

                  Many thanks for considering my request.


                  Kind Regards,
                  Woahid

                  Comment


                  • #10
                    Woahid:
                    it depends on what regressions aim at measuring.
                    Personally, I would not consider the interaction, unless you have sound theoretical reasons to leave it in.
                    That said, if the literature in your reserach field focuses on the interaction only (whose fixed effect I'd try difficult to explain), there might be a good methodological reason to follow this second approach.
                    In sum, it is always a matter of tribal rules!
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Hi Carlo Lazzaro,

                      Thank you so much for your prompt response.


                      Kind regards,
                      Woahid

                      Comment

                      Working...
                      X