Announcement

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

  • Fixed Effects Regression

    I have a regression model and I have to investigate the effect in different cases (with/without time trend, fixed effects).
    I want to run 6 different cases:
    Time trend Corporate fixed effects Year fixed effects
    Case 1 Yes No No
    Case 2 No No No
    Case 3 Yes Yes No
    Case 4 Yes No Yes
    Case 5 No Yes No
    Case 6 No No Yes
    I think that I have the following codes:
    Case 1:
    regress nettotoegevoegdewaarde schulden omzet arbeidsintensiteit aantalwerknemers BBPgroei loonkost

    Case 3:
    xtreg nettotoegevoegdewaarde schulden omzet arbeidsintensiteit aantalwerknemers BBPgroei loonkost, fe

    Case 4:
    xtreg nettotoegevoegdewaarde i.year schulden omzet arbeidsintensiteit aantalwerknemers BBPgroei loonkost

    Are these codes correct?

    Are these the 6 most important cases to investigate or should I add/delete something more?

    The main question is: how can i run a model without a time trend?

    Thanks in advance.
    Last edited by Joachim Vanderheyden; 23 Apr 2019, 01:38.

  • #2
    Joachim:
    I'm not clear with the core of your question.
    If you're not interested in time trend, you can:
    - simply omit -timevar- altogether;
    - consider -i.time- as a predictor.
    As an aside, time trend can well be not linear; hence, if interested, you should check whether evidence of non-linear (say, squared) relationship between time as a continuous predictor and regressand exists with your data:
    Code:
    c.time##c.time
    Eventually, predictor that are usually time-invariant (such as -i.industry) are wiped out by the -fe- machinery.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      I want it without the time trend to check if the results are robust. Therefore I need to find out how I can run fixed effects models without time trends.

      Comment


      • #4
        Joachim:
        simply omit -timevar- altogether.
        As an aside: robustness with respect to what? If time has actually a role as a predictor in data generating process, if you omit it, your results are biased.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thank you. I have to check it from my supervisor to check if the variable debt is in all the cases significant.

          Comment


          • #6
            Joachim:
            have you already checked (via -hausman-) that -fe- actually outperforms -re- specification for your data?
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Yes I have run the hausman test and it gives me the result that I need to use fe instead of re.

              Comment


              • #8
                Joachim:
                great!
                The first half of the journey is made, then!
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Are the codes below correct with the accompanying explanation?

                  1) regress y x1 x2 x3 x4 x5 x6

                  Time trend: No
                  Corporate FE: No
                  Year FE: No



                  2) xtreg y x1 x2 x3 x4 x5 x6, fe

                  Time trend: No
                  Corporate FE: Yes
                  ​​​​​​​Year FE: No


                  3) xtreg y x1 x2 x3 x4 x5 x6 c.year, fe

                  Time trend: Yes
                  Corporate FE: Yes
                  ​​​​​​​Year FE: No


                  4) xtreg y x1 x2 x3 x4 x5 x6 i.year, fe

                  Time trend: Yes
                  Corporate FE: Yes
                  ​​​​​​​Year FE: No


                  I also need a specification with year FE. Is is the following code to run that specification?
                  xtreg y x1 x2 x3 x4 x5 x6 c.year#i.name_n

                  I have a dataset of 2000 companies, do I have to add 2000 dummies to run that specification? If I have to do that, how can i add that quickly?

                  Comment


                  • #10
                    Joachim:
                    code 1) Ok;
                    code 2) Ok if your data were
                    Code:
                    xtset firm year
                    code 3) Ok if your data were
                    Code:
                    xtset firm year
                    and you're interested in linear realtionship between time and regressand
                    code 4) No. Code 4) includes firm -fe- and year -fe- if your data were
                    Code:
                    xtset firm year
                    Your last code (that I fail to get) will not do what you think it will do, as it simply interact time as a continuous predictor with a categorical variable (and omits the so called conditional maion effect of both of them).
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Carlo:
                      Thank you for clarifying this.
                      the next step I want to do is adding year FE.

                      Are the following codes correct?

                      1) xtreg x1 x2 x3 x4 x5 x6 c.year#i.firm

                      Time trend: Yes
                      Corporate FE: No
                      Year FE: Yes


                      2) xtreg x1 x2 x3 x4 x5 x6 c.year#i.firm, fe

                      Time trend: Yes
                      Corporate FE: Yes
                      Year FE: Yes

                      If i want ro tun these codes, then I get the next error:

                      matsize too small
                      You have attempted to create a matrix with too many rows or columns or attempted to fit a model with too many
                      variables. You need to increase matsize; it is currently 400. Use set matsize; see help matsize.

                      If you are using factor variables and included an interaction that has lots of missing cells, either increase
                      matsize or set emptycells drop to reduce the required matrix size; see help set emptycells.

                      If you are using factor variables, you might have accidentally treated a continuous variable as a categorical,
                      resulting in lots of categories. Use the c. operator on such variables.
                      r(908);

                      I think that the problem is that I use Stata version IC. Will it be possible to run these codes in Stata SE of MP. I have the data of 2000 companies over a period of 5 years.

                      Comment


                      • #12
                        Joachim:
                        Code:
                        xtreg x1 x2 x3 x4 x5 x6 c.year##c.year
                        I would tweak your first code a bit, just to explore if the relationship between the regressand and time trend is linear or quadratic.
                        Your code 2) complicates things, as you have already included -firm- groupwise effect via -xtset-.
                        I still fail to get why you're changing from -fe- to -re- specification and back again.
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #13
                          Carlo:
                          1) I intend to investigate the linear trend with the 1set code. do I still have to change it?

                          2) I change from fe to re because I have to test different specifications from my supervisor. I have to check the different speciifcations to check if my results are robuust.
                          Is the 2nd code correct to have a model with a time trend, with corporate FE and with year FE? Or want should the code be to run that model?

                          Comment


                          • #14
                            Joachim:
                            1)
                            Code:
                            xtreg x1 x2 x3 x4 x5 x6 c.year
                            for the linear time trend
                            2)
                            Code:
                            xtreg x1 x2 x3 x4 x5 x6 c.year i.firm i.year, fe
                            for something that I would not sponsor.
                            Kind regards,
                            Carlo
                            (Stata 19.0)

                            Comment


                            • #15
                              Carlo:
                              1) I have that code but can I add something to make that code also with year FE? So I mean that code " xtreg x1 x2 x3 x4 x5 x6 c.year " plus something so it will be also have year FE?

                              2) I can not run that code. I get error r(908).
                              Explanation:
                              matsize too small
                              You have attempted to create a matrix with too many rows or columns or attempted to fit a model with too many
                              variables. You need to increase matsize; it is currently 400. Use set matsize; see help matsize.

                              If you are using factor variables and included an interaction that has lots of missing cells, either increase
                              matsize or set emptycells drop to reduce the required matrix size; see help set emptycells.

                              If you are using factor variables, you might have accidentally treated a continuous variable as a categorical,
                              resulting in lots of categories. Use the c. operator on such variables.

                              Comment

                              Working...
                              X