Announcement

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

  • Multilevel Poisson

    I am working on multilevel Poisson. I faced a problem with the svy command when I ran mepoisson. As I am working with the DHS dataset. I have calculated level-1 and level-2 weights according to the DHS report 27. Thereafter, I ran the mepisson command. But mepisson does not support svy. I have also followed the Stata manual for multilevel Poisson modelling to create the command mentioned below. If anyone could, please help me in this matter. Is my mepoison command correct?


    * Create a constant cluster-level weight
    bysort v001: egen wt2_05_constant = mean(wt2_05)

    mepoisson children_born i.dv_any_violence i.region v012 i.education i.residence ///
    lom_prof_community ///
    [pweight=wt1_05] || v001:, pweight(wt2_05_constant) irr vce(robust)

  • #2
    if you go to
    Code:
    help svy_estimation
    you will see that -mepoisson- is supported

    maybe you are using an old version of Stata? if so, you need to tell us

    Comment


    • #3
      Dear Rich,

      Thank you for your quick response. I am using Stata 17.

      I don't understand why my command is not working. The correct way that DHS report 27 is guided is

      * Set the survey design using the alpha 0.5 weights
      svyset v001, weight(wt2_05) strata(v023) , singleunit(centered) || _n, weight(wt1_05)

      svy: mepoisson children_born i.dv_any_violence i.residence v012 i.education ///
      lom_prof_community || v001:


      But after running this command, I received the following error:

      * Set the survey design using the alpha 0.5 weights
      svyset v001, weight(wt2_05) strata(v023) , singleunit(centered) || _n, weight(wt1_05)
      note: stage 1 is sampled with replacement; further stages will be ignored for variance estimation.

      Sampling weights: <none>
      VCE: linearized
      Single unit: centered
      Strata 1: v023
      Sampling unit 1: v001
      FPC 1: <zero>
      Weight 1: wt2_05
      Strata 2: <one>
      Sampling unit 2: <observations>
      FPC 2: <zero>
      Weight 2: wt1_05

      svy: mepoisson children_born i.dv_any_violence i.residence v012 i.education ///
      > lom_prof_community || v001:
      (running mepoisson on estimation sample)

      weights in variable wt2_05 not constant within groups defined by: v001
      an error occurred when svy executed mepoisson
      r(198);


      Please guide me to solve this issue
      Last edited by Khawar Afreen; 01 Jul 2026, 01:04. Reason: I have also let you know that I changed the dependent varaible according to the logit for checking my weights varaible. In melogit, the command svy is working with melogit with these weights.

      Comment


      • #4
        sorry, but I don't understand what your data are like at all; I am also having trouble understanding what you are trying to do; please read and follow the advice in the FAQ

        Comment


        • #5
          Dear Rich,

          I am using the DHS dataset. v001 is PSU; weight (wt1_05) is level one weight; and weight (wt1_05) is level two weight, which are calculated according to the guidelines of the DHS report. I am applying a multilevel mixed-effect Poisson.
          Below is the guideline for the multilevel Poisson Stata manual with the svy command, which works for level 3 weights. There is no code for multilevel Poisson with svy for two-level weights.

          Two-level random-intercept model from a two-stage sampling design with PSUs identified by psu
          using PSU-level and observation-level sampling weights wvar2 and wvar1, respectively
          mepoisson y x [pweight=wvar1] || psu:, pweight(wvar2)

          Add secondary sampling stage with units identified by ssu having weights wvar2 and PSU-level
          weights wvar3 for a three-level random-intercept model
          mepoisson y x [pw=wvar1] || psu:, pw(wvar3) || ssu:, pw(wvar2)

          Same as above, but svyset data first
          svyset psu, weight(wvar3) || ssu, weight(wvar2) || _n, weight(wvar1)
          svy: mepoisson y x || psu: || ssu:

          Comment

          Working...
          X