Announcement

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

  • Including both Industry and Country fixed effects

    Dear Stata Members
    I have seen the following model based on a paper

    Code:
    Delta Cashit= b0+ b1EPUit+ b2Cash flow from operationsit+  b3EPUit * Cash flow from operationsit +Controls+Country fixed effects+Industry fixed effects+Year fixed effects
    EPU denotes Economic policy uncertainty index developed by Baker et al 2016

    The data comprises of some 50 countries and 200,000 firms in total for the period 2000-2020.
    My doubts are as follows
    1) Can we include both industry fixed effects and country fixed effects since industry fixed effects subsume the power of country fixed effects? Is there an exception for this?
    2) There will case (mostly such cases will be prevalent) where each firm i in year t is assigned the same EPU value of year t. This means one cannot include year fixed effects (FEs) in the models where EPU is specified because the EPU variable is cross-sectionally invariant, hence year dummies will subsume all the explanatory power of PU(Duong et al 2020). So, can we add year dummies?
    3) Clustering is done at the country level. I think this is correct since we allow errors to be correlated for observations belonging to the same countries but not observations belonging to different countries.
    4) Is it not better to account for just firm dummies(no country or industry dummies or time dummies)?


    Any help in this regard will be highly helpful




  • #2
    Ial:
    let's assume that you're planning to use a panel data -fe- estimator:
    1) if -i.industry- and -i.countries- are time-invariant, they will be wiped out by the -fe- machinery and no coefficient will be returned.
    2) adding -i.time- in the rigt-hand side of -fe- regression equation is highlly recommended. You can check their joint significance via -testparm-;
    3) clustering machinery also depend on how data were -xtset-. Check whether clustering at -country- level is allowed.
    4) if you -xtset- your data with -firmid- as your -panelvar- you cannot add -i.firmid- among your predictors.

    As an aside, if you have panel data it is better to try one of the -xt- commands before going -regress-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo
      Thanks for the prompt reply.
      1)
      if -i.industry- and -i.countries- are time-invariant, they will be wiped out by the -fe- machinery and no coefficient will be returned.
      Based on the paper, I think they have used Panel data fe-estimator(though paper didnt mention this explicitly). Also, firms may change the industry affiliation but changing the domicile country is highly improbable I guess(I could be wrong also). So let us assume that firms(the lowest unit) may change industry(infrequently) but not countries. In that case one may use both right?
      2)
      adding -i.time- in the rigt-hand side of -fe- regression equation is highlly recommended
      But the variable of interest(EPU) as it is defined will be the same for all firms in each country for a given year. In that case is it okay to add time dummies?
      3)
      clustering machinery also depend on how data were -xtset-. Check whether clustering at -country- level is allowed.
      . I think they may set the id at country level to group observations- So clustering at the country will be okay, right?
      4)
      if you -xtset- your data with -firmid- as your -panelvar- you cannot add -i.firmid- among your predictors.
      - I couldnt understand this. What I meant was to ignore the country, and instead use the firm fixed effects by
      Code:
      encode companyname, gen(id) //we have 200,000 companies from all countries
      xtset id year
      xtreg depvar EPU, fe cluster(id) // cluster by firm
      
      or
      encode countries, gen(id) //we have 50 countries
      xtset id year
      xtreg depvar EPU, fe cluster(id) // cluster (countries)
      I am unsure whether second will work or not
      Last edited by lal mohan kumar; 23 Sep 2020, 04:38.

      Comment


      • #4
        Ial:
        1) yes, you can use both as predictors; perfect collinearity issues may come alive according to the way you -xtset- your data;
        2) I would all -i.year-. At worst, you can decide to get rid of them according to -testparm- outcome;
        3) if the authors set -country- as their -panelid-, clustering on -country- would be ok;
        4) I would consider -firm- (not _country) as the -panelid-:
        Code:
        xtset idfirm year
        xtreg depvar EPU <other predictors>, fe vce(cluster idfirm)
        The second way you -xtset- your data will have, as a possible consequence, the folowing error message from Stata: "repeated time values within panel".
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thanks Carlo,

          I would consider -firm- (not _country) as the -panelid-:
          Code:
          Code:
           
           xtset idfirm year xtreg depvar EPU <other predictors>, fe vce(cluster idfirm)
          As you suggested, proceed with firm fixed effects is a good idea

          Comment


          • #6
            Dear Carlo, I am following up this conversation because I have a similar doubt.
            My question is, when you code:

            Code:
             
             xtset idfirm year xtreg depvar EPU <other predictors>, fe vce(cluster idfirm)
            idfirm
            refer a concatenade of firmcountry or is firm only?

            Now, if you do

            Code:
             
             xtreg depvar EPU <other predictors>, fe vce(cluster idfirm)
            Where are you considering the Ecological Fallacy? I mean, should he use instead vce (cluster country)?

            What do you think about
            Code:
            xtset country
            ? I did the xtset country year and I received the message "repeated time values within panel".

            Thank you very much,

            Alejandro

            Comment


            • #7
              Alejandro:
              - -idfirm- refers to panel identificator only;
              - usually, standard errors are clustered at the -panelid- level; higher level clustering may be allowed (it basically depends on your data). I fail to get the link to ecological fallacy;
              - -xtset-ting your data with -panleid- only is perfectly legal as long as you do not plan to use time-series commands such as lags and leads.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Dear Carlo,
                Thank you so much for your answer, its clear for me.
                For now, I would like to ask you just two more question please,
                1) in what situation do you think I can use
                Code:
                xtset firm
                and when could I use
                Code:
                xtset country
                ?
                I understand that you said that depende on my data, but on what exactly of my data depends? My doubt is because as @lal asked before, I want to be sure that I am considering the fact that fimr level data is nested in different countries.
                2) I am trying to use a xttobit in my regressions, but when I try to use the -vce(cluster firm)- or the -vce(cluster country)- I received a message saying that vce command is not allowed.

                Thank you Carlo again for your help,

                Alejandro

                Comment


                • #9
                  Alejandro:
                  1) the issue rests on what is your -panelid-: firms or countries?
                  2) -xttobit- does not allow robust or clustered standard errors. You may want to consider the -bootstrap- option.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Dear Carlo, thank you so much for your answer.
                    the panelid should be your subject of study? If I am looking firms, should be firms right?
                    Thank you so much,

                    Alejandro.

                    Comment


                    • #11
                      Yes, if that is the case, -firms- as -panelid- is right.
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment


                      • #12
                        Dear Carlo, thank you very much.
                        I really appreaciate it.
                        Alejandro

                        Comment


                        • #13
                          Dear Carlo,

                          If you allowed me, I would like to ask you two more question please.
                          I am sorry for the basic question, I have been reading some papers, but you can find the papers supportuing all positions, I have been watching youtube videos and reading posts about it, but I am still not clear.
                          My question are:
                          1) what it is useful for and how it works the xtset please?
                          2) xttobit doesn't have the option fe, should I just think about using a
                          Code:
                          tobit DV IV i.year i.industry
                          , considering that I am studing firms nested in countries with time invariant moderator, and time invariant IV en some countries.

                          Thank you so much, I'll try not going back with any additional question.

                          Alejandro

                          Comment


                          • #14
                            I am really sorry, when I shoudn't use xtset or a xt command even having multiple firms, in multiple years in different countries?
                            Thank you in advance.

                            Comment


                            • #15
                              Alejandro:
                              1) - xtset- tells Stata that your dataset follows a panel structure. When -xtset-ting your data, -panelid- is manadatory, whereas -timevar- is not. This means that you can -xtset- your data with -panelid- only, but this comes at the cost that you cannot use time-series related commands, such as lags and leads. If (#14), your firms are nested within countries, you may want to consider -mixed-.
                              2) when a Stata command does not have an (erroneously expected) option, there's always a sound statistical reason for that.
                              In your case, you may want to try:
                              Code:
                              tobit DV IV i.year i.industry i.firm, vce(cluster firm)
                              Kind regards,
                              Carlo
                              (Stata 19.0)

                              Comment

                              Working...
                              X