Announcement

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

  • Two-Way Clustering in Logistic Regression

    Hello users,

    I have data for about 15,000 9th graders. I am interested in running logistic models that investigate the impact of a number of independent variables (e.g., ses, grades) on student enrollment in a particular course in the 9th grade (1=enrolled, 0=not enrolled). Naturally, the likelihood of enrollment would be influenced by how these students were clustered both at the middle and high school levels and I would, therefore, like to account for that. Middle schools are not nested within high schools. I would like to run a fixed effects model that would consider these middle and high school clusters through an accurate estimation of the standard errors . However, I am not certain how to go about doing this. Could I accomplish this by simply using the code: logit y x, cluster(middleschool, highschool)? Any suggestions would be appreciated.

    Thanks!

  • #2
    Originally posted by Karisma Morton View Post
    Hello users,

    I have data for about 15,000 9th graders. I am interested in running logistic models that investigate the impact of a number of independent variables (e.g., ses, grades) on student enrollment in a particular course in the 9th grade (1=enrolled, 0=not enrolled). Naturally, the likelihood of enrollment would be influenced by how these students were clustered both at the middle and high school levels and I would, therefore, like to account for that. Middle schools are not nested within high schools. I would like to run a fixed effects model that would consider these middle and high school clusters through an accurate estimation of the standard errors . However, I am not certain how to go about doing this. Could I accomplish this by simply using the code: logit y x, cluster(middleschool, highschool)? Any suggestions would be appreciated.

    Thanks!
    Hi Karisma,
    I have the same problem (running a logistic regression with two-way clustered standard errors).
    Have you found a solution, yet? I'd love to help you, but unfortunately, I am also clueles. SO sorry!

    Comment


    • #3
      Hi, Karisma and Iris:
      I would run a cross-classified model or what Stata calls the "cross efffects" model. Stata 14's me.pdf manual has example 4 on p. 76 providing the type of analyses you need, along with code. I can't find the link on stata.com for version 14, however.

      Here's the code to fit a model with two effects; it's borrowed from Rabe-Hesketh's book (2nd volume), where this is explained in greater detail.


      use http://www.stata-press.com/data/r14/salamander

      meglm y wsm##wsf || _all: R.male || _all: R.female, family(bernoulli) link(logit) or



      I think there is also an example with survey weights.

      Now here's something neat and written up in the SJ. It's on the package felsdvreg, which fits high-dimensional fixed effects models. it looks darn cool but it's for continuous outcomes.
      Cheers,
      - Nate
      Last edited by Nathan E. Fosse; 09 Jul 2015, 06:57.
      Nathan E. Fosse, PhD
      [email protected]

      Comment


      • #4
        This thread is in the wrong forum. The Sandbox forum is for making test posts.


        Use this forum to make test posts, practice with the formatting features of the forum software, etc.
        Post in the General Forum. As it is, the majority of Statalist users are unlikely to see any of these posts.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment

        Working...
        X