Announcement

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

  • #16
    Hello,

    I'm facing a similar problem in STATA at the moment when trying to run a panel fixed effects model.

    I'm trying to include state fixed effects, year fixed effects, and an interaction term capturing state-specific linear time trends. Currently, I'm using i.year (to capture year fixed effects), i.state (to capture state fixed effects), and c.year##i.state (to capture state-specific linear time trends). I initially tried using i.year##i.state to capture these trends but received a multicollinearity error message in STATA.

    I'm wondering:
    1) What is the difference between i. and c. (I was under the impression that c. provided the AVERAGE year effect, regardless of year...so I would think I want to use i.?)
    2) If I include i.year, i.state AND the interaction term c.year##i.state (or i.year##i.state if I can get it to work) will there be multicollinearity in my regression?

    Any advice would be much appreciated!

    Thanks,
    Becky













    Comment


    • #17
      Rebecca:
      welcome to this forum.
      1)your intuition about the difference between -c.- and -i.- is quite right. -c.- tells Stata (not STATA, please; see the FAQ. Thanks.) that the variable you're interested in is continuous, whereas with -i.- prefix Stata knows that the variable your interested in is categorical.
      2) you will possibly experience some variable omission due to the fact that -state- will not change within the same panel across years (ie, is a time-invaraint predictor) and, as such, the -fe- machinery will wipe it out.
      As an aside, for the future you will be probably better off with starting a new thread. Thanks.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #18
        Hi Carlo,

        Thank you so much for the welcome and quick response! That makes total sense. I guess my question now becomes interpretation.

        If I run the regression reg MRtotaldeath bup c.year##i.state, cluster(state) (where MRtotaldeath=opioid-related mortality rate and bup=access rate to a specific drug) and I want to control for (i) year fixed effects (ii) state fixed effects and (iii) state-specific linear time trends, should I still include i.state and i.year? As mentioned before, when I do include these variables, i.year is omitted anyway due to multicollinearity.

        Thank you so much, I appreciate your help!

        Becky

        Comment


        • #19
          When you include both c.year and i.year in the model, you will have two years omitted due to colinearity. One, typically the earliest year, is omitted because it is colinear with the constant term (as would happen with any set of indicators of a multi-category variable), and then another, usually the last year, because the year indicators are collectively colinear with c.year. But that is not a problem. Don't worry about it. No information is being lost: a redundancy that would deidentify the model is being eliminated.

          If you have reason to believe there is a linear trend over the years in your data, then you should include c.year. If you believe that there are important yearly shocks to the outcome, then you should include i.year. If you think both are present, and if it is important to your research goals to specifically estimate the linear trend, then use both c.year and i.year and don't worry about the colinearity message: it isn't a problem. If, however, you don't need to specifically estimate the linear trend, then it is simpler to omit c.year: the i.year indicators will in that case absorb the linear trend, and you will see that because the coefficients of the year indicators will themselves increase (or decrease as the case may be) in an approximately linear fashion, rather than being scattered around zero haphazardly.

          Comment


          • #20
            I see, thank you so much Clyde, this was very informative.

            Comment


            • #21
              Dear @Clyde Schechter and @Carlo Lazzaro, I am facing a similar problem with a panel VAR model. I want to add country-fixed effects, country-specific time trends and time-fixed effects in a panel VAR model. If I have 18 countries and 25 years dataset, did the codes below control for cross-country heterogeneity and contemporaneous residual correlation? May you please give me your suggestion. thanks
              pvar endogenous1 endogenous2 endogenous3 endogenous4 , instlags(1) fd td vce (robust)
              pvar endogenous1 endogenous2 endogenous3 endogenous4 , instlags(1) gmmstyle fd td vce (robust)

              Comment


              • #22
                Sorry, but I don't know VAR. Hopefully Carlo or somebody else will respond.

                Comment


                • #23
                  Gabriel:
                  sorry, but I ignore VAR stuff altogether.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #24
                    Hello
                    I am making a panel data model where I have the following regression:
                    xtreg Domestic_Health rDomestic_Health GPE_subindex i.Country # c.Year, fe vce (robust)

                    My question arises if when I use the interaction i.Country # c.Year do I need to put at the end of the regression faith or should I omit that and just like with i.Country # c.Year because with that I would already be using fixed effects?

                    Comment


                    • #25
                      Katherine:
                      I'm not sure I got your question right.
                      How you did -xtset- your data?
                      Is it -Country- your -panelid-?
                      In addition, if the interaction you mention should ever be included in the right-hand side of your regression equation, it shoud be coded as:
                      Code:
                      i.Country##i.time
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment


                      • #26
                        I am estimating the effect of women's participation in public health spending. My panel has 142 the period is 2006-2019. So I want to run with fixed effects, I understand that I would have to put faith at the end of my regression. In addition to this, I want to capture the time trend for each of the countries, so I put the interaction i.Country # c.Year. But my question arises if this way of estimating is correct:
                        xtreg Domestic_Health GPE_subindex GDP_PPP Polity2 Urbanization LendingBorrowing Population65 i.Country # c.Year, fe vce (robust)
                        ?

                        Kind regards,
                        Katherine

                        Comment


                        • #27
                          Katherine:
                          usually, in -xtreg,fe- -timevar- is included as a categorical predictor n the right-hand side of the regression equation.
                          That said, if, according to the literature in your research field this is a validated approach, the correct way to code the interaction you reported is:
                          Code:
                          i.Country##c.Year
                          As an aside, I do not understand what you mean by "faith" in a panel data regression context (do you mean something similar to "confidence"?).
                          Kind regards,
                          Carlo
                          (Stata 19.0)

                          Comment


                          • #28
                            By faith I mean that when xtreg is used it is placed after the estimate of fe to specify that it is a model with fixed effects. So could I use my interaction and fe at the same time?

                            Comment


                            • #29
                              Katherine:
                              the way you specified -fe- and non-default standard error after the comma is correct.
                              Kind regards,
                              Carlo
                              (Stata 19.0)

                              Comment


                              • #30
                                Thank you,

                                Another question with my interaction would be capturing a time trend for each of the countries, right?

                                Comment

                                Working...
                                X