Announcement

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

  • melogit individual and country level

    Hi everyone,

    I want to run a multilevel Regression (individual and Country Level) using melogit estimating the effect of Immigration on labour market Outcomes in 28 EU countries
    Code:
    melogit depvar income age gender ethnic_back skill ///
      || isocntry:  immigration GDP_pc
    This is one of my baseline Equation.
    depvar income age gender ethnic_back skill are all individual characteristics, while immigration GDP_pc are Country Level characteristics.
    Basically my Question if I have introduced the Country characteristics at the Right spot in the Formular.

    Further If I want to allow for random slopes/coefficients I would Change the model in the following way
    Code:
    melogit depvar income age gender ethnic_back skill ///
    || isocntry: immigration GDP_pc income age gender ethnic_back skill
    Is that correct or am I making a mistake.

    Thank you for any support!

    Best Jay

  • #2
    I'm not that familiar with these models, but your last command looks strange : you allow the effects of the person-characteristics to vary between countries but not between people. Perhaps you want:
    Code:
     melogit depvar income age gender ethnic_back skill ///
    || isocntry: immigration GDP_pc  || person_id:  income age gender ethnic_back skill
    Last edited by Steve Samuels; 26 Jul 2018, 16:43.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      There is another problem with your model. You have specified a random slope on immigration and GDP_pc*, but you have failed to include them in the fixed-effects (bottom level) of the model--which is a mis-specified model. So, adding to Steve Samuels' refinements, it should be:

      Code:
      melogit depvar income age gender ethnic_back skill immigration GDP_pc ///
      || isocntry: immigration GDP_pc || person_id: income age gender ethnic_back skill
      Every variable specified as a random slope must also appear in the fixed-effects portion of the model. Otherwise, you are implicitly stipulating that the mean slope on these variables is zero, which is rarely if ever what you want.

      Let me also just point out that adding these random coefficients to the model massively increases the time it will take for Stata to estimate the model, and may lead to convergence problems as well. If you have good scientific reasons for including these random slopes in your model and will actually use the variances of those slopes in your interpretation of it, then fine, as long as you have the patience. But if you're just putting them in out of a vaguely felt desire to make your model as general as possible, be warned that you may pay a very steep price for this. If your data set is large, estimating a model like this one could take days or weeks. Remember that random slopes are cross-level interaction terms, and like all other interaction terms, they are difficult to estimate, often estimated with rather poor precision, and soak up degrees of freedom. Like all interaction terms, they really should be used only when there is good reason to believe they are needed. The default should be to exclude, rather than include them.

      (*) Did you do that intentionally? Or did you mistakenly think that because immigration and GDP_pc are attributes of countries that you need to put them after isocntry: in the command? That is a commonly made error. The variables listed after some_variable: should be those for which you want to estimate random slopes with variation at the some_variable level. The level of the model at which a variable is defined is completely irrelevant to where you list it in the command. All​​​​​​​ variables should be listed in the "fixed effects" (bottom level) portion. And only those for which you wish to fit random slopes get listed in other levels. When you do want a random slope, you list it at the level at which the slope varies, which may be higher, lower, or the same as the level at which the variable is defined. Level of definition and level of random slopes are completely independent of each other.

      Comment


      • #4
        Thank you Steve and Clyde.
        @Clyde No I have mistakenly omitted the countyry Level variables in the fixed effect portion of the model! Accordingly your answer and hint was 100% needed and on point!
        The random slopes are included as we want to allow for country differences in slopes of the individual variables.
        Accordingly, I do not think that I need random slopes for the Country Level indicators.
        However, as we are interesed in Country Level differences of the individual variables, would`nt be the appropriate model of the following structure ?
        Code:
        melogit depvar income age gender ethinc_back skill Immigration GDP_pc ///
        || isocntry: income age gender ethnic_back skill
        Or do I Need to allow for random slopes on the individual Level even tough I´m not interested in These slopes.

        Thank you again, you guys already helped me a lot!

        Best Jay

        Comment


        • #5
          However, as we are interesed in Country Level differences of the individual variables, would`nt be the appropriate model of the following structure ?
          Code:
          melogit depvar income age gender ethinc_back skill Immigration GDP_pc ///
          || isocntry: income age gender ethnic_back skill
          Yes, this is a correct model for the purpose you state.

          Comment


          • #6
            Noting that you have 28 countries, I suggest that you be cautious in drawing conclusions about 'country effects': see https://doi.org/10.1093/esr/jcv059 (open access)

            Comment


            • #7
              Stephen Jenkins makes a good point. Your inferences about country-level variation are based only on an N of 28, so they will not be very precise.

              Comment

              Working...
              X