Announcement

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

  • Multi-way clustering with poisson regression

    Good afternoon,
    I am trying to run a multi-level Poisson regression (3-level) and I am trying to understand how to implement a multi-way clustering. I've found there exist commands for OLS and non-linear models but I've not found any for count data. Is there any command to deal with this problem or should I use some specific procedures?
    Thanks

    Alessandro

  • #2
    Alessandro:
    do you mean a hierarchical regression model (-mixed-)?
    I would take a look at -egen-, -group- function, to create a multi-way cluster.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      I mean I have variables on three levels (country, cohort and individual) and I've found that a way to do multi-level analysis is by clustering for the three levels at once. But the problem is that vce(cluster clustervar) allows for only one variable at a time.

      Comment


      • #4
        Alesandro:
        set aside any nesting issue, you're correct about -vce(cluster clustervar)- machinery.
        You may want to try something along the following dope example:
        Code:
        use "http://www.stata-press.com/data/r14/nlswork.dta", clear
        egen A=group(idcode c_city south)
        probit c_city i.race, cluster( A)
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          Originally posted by Carlo Lazzaro View Post
          Alesandro:
          set aside any nesting issue, you're correct about -vce(cluster clustervar)- machinery.
          You may want to try something along the following dope example:
          Code:
          use "http://www.stata-press.com/data/r14/nlswork.dta", clear
          egen A=group(idcode c_city south)
          probit c_city i.race, cluster( A)
          It works. Thank you very much!

          Comment


          • #6
            Alessandro:
            being Italian (and graduated from the same university, unfortunately for me too many years ago) I should have not mistyped your given name.
            Sorry for this and happy that what above helped you out.
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment


            • #7
              just for the sake of correctness I want to point out that I'm fairly sure that this does not what is usually meant by "multi-way clustering". Your code simply creates a unique variable IDing individuals and with this clusters at the individual level.

              Comment

              Working...
              X