Announcement

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

  • Ensuring correct specification of a multilevel model

    Hello!

    My initial goal was to estimate the following fixed-effects model:
    Code:
     xtreg Y_it i.week X_it, vce(robust) /// log(Y_it + 1) = b_0 + X_it + week_it + alpa_i + gamma_t + error_it 
    where Y_it is the log+1 transformed dependent variable representing university i in week t, X_it is the time-variant predictor of interest (proportion between 0 and 1), and week_it is a set of weekly dummies (plus unobserved unit- and time-effects and error).

    Now, the reviewer has asked me to add several control variables, such as university size_i and acceptance_rate_i (which are constant over time), and some measure of the population mobility on university campus. Since the data on mobility at the university level is not available, I collected county-level data for each of the universities. In my sample, the 118 universities are "nested" within 104 counties. Given that the weekly mobility_jt measure is at the different level, as far as I understand, it should be included in the model using appropriate (county) level, for example, using the following multilevel mixed effects approach:

    Code:
    xtmixed Y_it i.week X_it size_i acceptance_rate_i || FIPS: mobility_jt, vce(robust)
    Is my approach to including and estimating size_i, acceptance_rate_i, and mobility_jt correct? If so, then what is the equation that I am estimating using the aforementioned command?

    I would appreciate your feedback on this.

  • #2
    Not quite right. It should be
    Code:
    mixed Y_it i.week X_it size_i acceptance_rate_i mobility_jt || FIPS: , vce(robust)

    Note that -xtmixed- was renamed to -mixed- back as far at least as version 13.

    In the syntax for multilevel models it is important to understand that the level at which a variable is defined does not determine the level at which it appears in the syntax. The random effects part of the syntax is used only to specify the inclusion of random intercepts at those levels and random slopes at those levels. The variable itself always belongs in the fixed-effects part of the model, regardless of the level at which it is defined. When a variable is mentioned also in the random effects part of the model, that tells Stata to also include a random slope for that variable at that level--which is not what you are looking for.

    Comment


    • #3
      Clyde Schechter Thank you very much for your response and clarifications, Clyde. Please let me double-check, as far as I understand, my original equation in the multilevel form transforms to:
      Code:
       log(Y_it + 1) = b_0 + X_it + size_i + acceptance_rate_i + mobility_jt + week_it + alpa_i + gamma_t + error_it + b_0j
      where b_0j refers to the intercept of the dependent variable in county j. Is that correct?

      Comment


      • #4
        Correct.

        Comment

        Working...
        X