Announcement

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

  • Mixed effects/multilevel model

    Hi,

    I am attempting to estimate food security levels (individual responses from survey data) while my primary variables of interest are measured at the level of a 50km x 50km grid. Specifically, these variables at the grid level are: percent of each grid that has cell phone coverage and a dummy for whether the grid experienced riots. My survey covers individuals across 36 countries. Further, I have a measure of number of riots at the country level, which I would like to interact with the grid level measure of cell phone coverage (with the idea that the effect of a riot occurring somewhere else in the country may have an differential effect on food outcomes if the grid is more "connected").


    My data includes individual controls (gender and number of adults provided in the sample below), and grid level variables are constant for all individuals in the grid, and finally, the country riots measure is constant for all ind in the country. Here is a sample of my data where gid2014_dum is a dummy for whether riots occurred in a grid and percentage is the % of the grid with coverage.
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str7 respno byte(gender num_adult) float gid2014_dum double percentage float total_country
    "ALG1166" 2 6 0 99.99999996 569
    "ALG1167" 1 3 0 99.99999996 569
    "ALG1168" 2 4 0 99.99999996 569
    "ALG0369" 1 5 0 99.99999996 569
    "ALG0370" 2 6 0 99.99999996 569
    "ALG0371" 1 8 0 99.99999996 569
    end
    Given the nesting of individuals within grids and grids within countries, I want to estimate a multi-level model where I include the following variables from each level:
    Individual: gender num_adult
    Grid: Coverage%, riot dummy, other controls (agricultural land, night lights, etc.0
    Country: Country riots

    Would the correct specification be:
    mixed Y gender num_adult || country: country riots || grid: coverage riot dummy other grid controls

    or do the variables all enter as fixed effects with a random intercept for each country/grid?
    mixed Y gender num_adult coverage riot dummy other grid controls country riots || country: || grid:

    Thank You.




  • #2
    The second model is closer: it is a valid model. The first one is not a valid model at all except under certain highly implausible assumptions. (Both models look syntactically correct, so both will run without giving you an error message in Stata, but the first one's results will be nonsense.)

    But the second one does not quite do what you say you want. You said you want to interact the riots variable with the coverage variable. Your model doesn't incorporate that. As both the riots variable and the coverage variable are continuous the syntax would be like:

    Code:
    mixed Y gender num_adult c.coverage##c.riot dummy other grid controls country riots || country: || grid:

    Comment


    • #3
      Thank you, Clyde. Yes, I did forget to include the interaction terms, which I would actually like to include for both grid level and country level.

      Another question: would only including a random intercept for country (given how small the grids are, little reason to suspect random variation in grids in close proximity), ie. only:
      Code:
         
       mixed Y gender num_adult c.coverage##c.riot dummy other grid controls country riots || country:
      still be a feasible model- or would the standard errors on the grid levels be inflated/inaccurate with accounting for a gird level intercept?

      Comment


      • #4
        Well, if you omit the random effects on one level, that source of variation will be absorbed somewhere: it might get added in to a higher level, or it could get added into a lower level (residual). It's hard to say. My usual approach to this would be to run the model with all the levels that make any sense. Then look at what the variance at the level of grid and see if it looks really small (relative to country and residual level variance components and relative to the contributions of the fixed effects to predicted values). If it's tiny, then omitting it will make little difference and might give you a more parsimonious model to work with. But if it's appreciable, you'd be best advised to leave it in.

        Some people would suggest actually running it both with and without the grid level and then do a likelihood ratio test. I'm not a big fan of that approach, but it's not unreasonable if you're not comfortable with making judgments about the smallness of a component, and I do sometimes do this myself..

        Comment


        • #5
          Got it. I was also particularly concerned since some grids have as few as 1 observation.


          Many thanks for your advice.

          Comment

          Working...
          X