Announcement

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

  • Multilevel models and fixed effect inclusion xtmixed i.country

    Hi Statlisters,
    I wanted to assess the impact of compliance with IMF conditions on firm sales growth. My sample covers 36 countries with an IMF program between 2006 and 2016. The years are not the same for all countries because the start years of IMF programs differ across countries. Only 11 of 36 countries have more than one program. Since I have two levels, country level variables and firm level variables, I use the multilevel model with the xtmixed.


    For countries with one program, I will have one compliance rate but different growth rates of the firms within the country - one growth rate for each firm.
    As for countries that have 2 programs I have two compliance rate, and different growth rates for each program.
    ************************************************** ****
    I use the following variables
    countrylevel variables are : cr_pr(compliance) nb_cond_prg s_avgee pstartGDPgrowth lpop
    firm level variable are : glsales_short(firms sales growth) lsales_start FDI_s exporters_s state_s size
    *******************************************
    continuous variables : cr_pr nb_cond_prg s_avgee pstartGDPgrowth lpop glsales_short lsales_start size
    dummy variables : FDI_s exporters_s state_s

    the command I used is:

    xtmixed glsales_short cr_pr nb_cond_prg lsales_start FDI_s exporters_s state_s size s_avgee pstartGDPgrowth lpop i.country || country:, mle variance

    I included a fixed effect to control for unobserved country variables and all country coefficients appeared and significant. My supervisor told me that it was not possible to have fixed effects for countries with only one program because I only have one country-level observation for those countries. But at the same time Stata allows to include fixed effects at country-level.

    My questions are ?

    Is it possible to include a fixed effect in the estimation of a multilevel model?
    and if not, why does stata allow me to do so?

    Thank you in advance,

  • #2
    I don't quite understand the logic your supervisor is using: the fact that some countries have singleton observations does not preclude having i.country as a variable. Even if all countries have singleton observations, you can still include i.country--but in this case it will be colinear with the constant term, and Stata will omit it for you. But you don't face that situation since you say you have multiple firms within country, each with its own observation.

    BUT, there is another, different, and important reason why you should not include i.country. It is that by having both i.country in the fixed effects and having a random intercept at the country: level, you are creating a bizarre model that may be unidentifiable, and if it is identifiable, the identifiability hinges on the constraint that the random effects be sampled from a normal distribution. Yes, Stata allows you to do this. But trying to estimate such a model will often lead to non-convergence; and even when it does converge, the results are uninterpretable.

    Given that you chose a multi-level model to account for firm effects, you need to stick with the random effect, and drop i.country.

    That said, I don't see a firm-level in your model as shown.

    Comment


    • #3
      Dear Clyde,

      Thank you very much for you answer.

      I think my supervisor meant that stata should have ommited the country fixed effects.
      I chose a multilevel model to control for country effects on firm performance. My dependent variable is a firm-level variable and other variables such as: firm size (size), whether the firm is an exporter (exporters_s) and wether the firm is foreign owened (FDI_s)
      However, since I have singleton observation per firm in a given country, I did not include firm fixed effects.

      Do you have any recommandtions that allows me to take control for country fixed effects ?

      Thank you very much,
      Zeineb

      Comment


      • #4
        The random effect at the country level that you already have in the model is an adjustment for unobserved country-level effects. It is not "perfect" the way that a fixed effect for country would be, but it does part of the job. The usual practice with multi-level models to "fill in the gap" is to include as many important country-level covariates as you reasonably can given the size of your data set. But there is no "perfect" solution to this in the framework of random-effects models.

        That said, it isn't clear to me why you want a multi-level model in the first place. It seems your unit of observation is the firm, and you are very concerned about unobserved effects of country. So why not just use a fixed effects model with country as the grouping variable? That will completely adjust for any observed or unobserved country-level effects that are invariant across firms. And as there is no room for any other level in your model (as best I can tell from your descriptions so far), I see no role for a multi-level model.

        Comment


        • #5
          Dear Clyde,

          thank you for your answer, I got your point.

          However, even I use an estimation with Fixed Effect as follows :

          reg glsales_short cr_pr nb_cond_prg lsales_start FDI_s exporters_s state_s size s_avgee pstartGDPgrowth lpop i.country

          Even with this specification, the country coefficients are estimated and not omitted.

          The question of how it is possible to include country fixed effects when I only have one compliance rate per country remains unresolved for me. Could you please explain to me?
          ?

          Please find attached the database with company sales growth and compliance rate as an example of my database.

          Thanks,
          Zeineb
          Attached Files

          Comment


          • #6
            Providing example data would be helpful, but not as an attachment. Like many others, I do not download attachments from people I don't know. Please show the example data using the -dataex- command. If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

            Also, please explain what your variables are. From what you have written so far, I have no information as to which variable in your model is the compliance rate.

            Comment


            • #7
              Dear Clyde,

              I'm really sorry I attached a file.

              As for the description of my variables: I have both country-level variables and firm-level variables.

              My dependent variable is a company level variable which is the sales growth rate and my variable of interest is the compliance rate (this is a percentage calculated as a ratio of the total number of conditions the country has met to the total number of conditions per program). The sales growth of the companies is calculated according to the years of the program.

              I use the following variables

              country-level variables are :

              - cr_pr (the compliance rate, my variable of interest)
              - nb_cond_prg (number of conditions per program)
              - s_avgee (quality of institutions)
              - pstartGDPgrowth (GDP growth)
              - lpop (population log)

              firm-level variable are :

              - glsales_short (company's sales growth, dependent variable)
              - lsales_start (the sales log of the firm at the beginning of the program)
              - FDI_s (dummy variable indicating whether the firm is foreign-owned)
              - exporters_s (dummy variable indicating if the company is an exporter)
              - state_s (dummy variable indicating if the firm is partially state-owned)
              - size (size of the firm calculated from the logarithm of the total number of employees)


              Here is a snapshot of my data,
              Code:
              * Example generated by -dataex-. To install: ssc install dataex
              clear
              input str40 countryname float(exporters_s state_s FDI_s lsales_start glsales_short s_avgee pstartGDPgrowth nb_cond_prg cr_pr) long sector_ms float lpop long country float size
              "Albania" 0 0 0 10.444658    .332814 -.064022 1.7744868 64 .859375 2 14.88036 1   1.94591
              "Albania" 0 0 0 16.590273   .1208848 -.064022 1.7744868 64 .859375 2 14.88036 1 4.6821313
              "Albania" 0 0 0 15.519832 -.19273943 -.064022 1.7744868 64 .859375 2 14.88036 1  2.995732
              "Albania" 0 0 0 13.308762  -.1547739 -.064022 1.7744868 64 .859375 2 14.88036 1  2.564949
              "Albania" 0 0 0 14.550053  -.0577102 -.064022 1.7744868 64 .859375 2 14.88036 1  3.583519
              "Albania" 0 0 0  19.09558  -.3131794 -.064022 1.7744868 64 .859375 2 14.88036 1  3.871201
              "Albania" 0 0 0  13.72306  .25709167 -.064022 1.7744868 64 .859375 2 14.88036 1 3.8066626
              "Albania" 0 0 0  13.59454 -.24964534 -.064022 1.7744868 64 .859375 1 14.88036 1  2.995732
              "Albania" 0 0 0 12.341778  .26434863 -.064022 1.7744868 64 .859375 1 14.88036 1  3.218876
              "Albania" 0 0 0 14.980835 -.17349985 -.064022 1.7744868 64 .859375 1 14.88036 1  3.218876
              "Albania" 1 0 0  13.44039  .13153544 -.064022 1.7744868 64 .859375 1 14.88036 1 4.6051702
              "Albania" 0 0 0 12.747243  .27260253 -.064022 1.7744868 64 .859375 1 14.88036 1  3.912023
              "Albania" 0 0 0 15.049828 -.23251697 -.064022 1.7744868 64 .859375 1 14.88036 1   5.69036
              "Albania" 0 0 0 13.034925   .2130676 -.064022 1.7744868 64 .859375 1 14.88036 1  3.135494
              "Albania" 0 0 1 15.114367   .1865256 -.064022 1.7744868 64 .859375 1 14.88036 1  3.496508
              "Albania" 0 0 0  13.44039   .2660503 -.064022 1.7744868 64 .859375 1 14.88036 1  3.218876
              "Albania" 0 0 1 12.747243  .09366992 -.064022 1.7744868 64 .859375 1 14.88036 1 3.0910425
              "Albania" 0 0 0   13.0672  .07216019 -.064022 1.7744868 64 .859375 1 14.88036 1 1.7917595
              "Albania" 0 0 0  11.68785   .2896392 -.064022 1.7744868 64 .859375 1 14.88036 1 2.1972246
              "Albania" 0 0 0  13.44039   .2896273 -.064022 1.7744868 64 .859375 1 14.88036 1   1.94591
              end
              label values sector_ms sector_ms
              label def sector_ms 1 "Manufacturing", modify
              label def sector_ms 2 "Services", modify
              label values country country
              label def country 1 "Albania", modify
              Would it be correct if I use this following command :

              reg glsales_short cr_pr nb_cond_prg lsales_start FDI_s exporters_s state_s size s_avgee pstartGDPgrowth lpop i.country, cluster(country)

              Thank you very much dear Clyde. I really appreciate your help.

              Zeineb

              Comment


              • #8
                Yes, this seems appropriate, with two caveats:

                1. The use of cluster robust variance estimation is appropriate only if you have enough different countries in your data set. There is no universal agreement on how many is "enough," but pretty much everyone would say that fewer than 10 is not enough, and more than 50 is plenty. In between, it's more controversial.

                2. In your example data, the variable state_s, which you state is a firm-level variable 0 for every observation. Perhaps that is just a coincidence among the firms that you selected in your example. But do check that you have that variable correct: it should vary among firms, but be constant within countries.

                Finally, if you are not interested in the specific country effects, you can get a cleaner output by doing this as:
                Code:
                encode countryname, gen(country)
                xtset country
                xtreg glsales_short cr_pr nb_cond_prg lsales_start FDI_s exporters_s state_s size s_avgee pstartGDPgrowth lpop, fe cluster(country)
                The results will be the same as your -reg- command, except that the country coefficients will be omitted, resulting in a shorter and easier-to-read- set of regression results. Evidently, if you want to see the country coefficients, then stick with your -reg- approach.

                Comment


                • #9
                  Thank you very much dear Clyde for your help and reactivity.
                  Zeineb

                  Comment

                  Working...
                  X