Announcement

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

  • What is the Test for Under-Dispersion in STATA?

    We are trying to fit a zero-weighted binomial model to our data set. The model is strongly supported by theory. In that context, we shall be grateful for any help on some of our problems:
    (1) Like the way one can formally test for overdispersion in count data, can one test for underdispersion as well? If yes, what test and how to do that in STATA?
    2) We would like to test whether zero-weighted binomial regression model is indeed a better model for our data set than the simple binomial regression model. Both AICs and BICs suggest that the zero-weighted model is the better one. However, can one test in STATA whether all the "inflation" parameters are zero jointly? If that test rejects the null hypothesis, can one then also comment that the zero-weighted model is a necessity here?

  • #2
    A small correction. The model which we have is Zero inflated binomial regression. We need guidance on the following:
    1) Is there a test for under-dispersion in STATA
    2) Can one test in STATA whether all the "inflation" parameters are zero jointly? If that test rejects the null hypothesis, can one then also comment that the zero-weighted model is a necessity here?

    Comment


    • #3
      Originally posted by Shashank Shukla View Post
      A small correction. The model which we have is Zero inflated binomial regression. . . .
      1) Is there a test for under-dispersion in STATA
      I don't know what a zero-inflated binomial model is, but if you're interested in examing underdispersion in a binomial model, then maybe you can look at the upper confidence bound in something like the following.

      .ÿ
      .ÿversionÿ16.0

      .ÿ
      .ÿclearÿ*

      .ÿ
      .ÿsetÿseedÿ`=strreverse("1524638")'

      .ÿ
      .ÿmatrixÿdefineÿMÿ=ÿJ(1,ÿ5,ÿ0.5)

      .ÿmatrixÿdefineÿCÿ=ÿJ(5,ÿ5,ÿ-0.15)

      .ÿforvaluesÿiÿ=ÿ1/2ÿ{
      ÿÿ2.ÿÿÿÿÿmatrixÿdefineÿC[`i',ÿ`i']ÿ=ÿ1
      ÿÿ3.ÿ}

      .ÿovbdÿ,ÿstub(rsp)ÿmeans(M)ÿcorr(C)ÿn(250)ÿclear
      (obsÿ250)

      .ÿ
      .ÿgenerateÿintÿpidÿ=ÿ_n

      .ÿquietlyÿreshapeÿlongÿrsp,ÿi(pid)ÿj(tim)

      .ÿ
      .ÿ*
      .ÿ*ÿBeginÿhere
      .ÿ*
      .ÿprogramÿdefineÿbootem,ÿrclass
      ÿÿ1.ÿÿÿÿÿÿÿÿÿversionÿ16.0
      ÿÿ2.ÿÿÿÿÿÿÿÿÿsyntax
      ÿÿ3.ÿ
      .ÿÿÿÿÿÿÿÿÿxtgeeÿrspÿi.tim,ÿi(newpid)ÿfamily(binomial)ÿlink(logit)ÿcorr(exchangeable)
      ÿÿ4.ÿÿÿÿÿÿÿÿÿestatÿwcorrelation
      ÿÿ5.ÿÿÿÿÿÿÿÿÿtempnameÿRÿrho
      ÿÿ6.ÿÿÿÿÿÿÿÿÿmatrixÿdefineÿ`R'ÿ=ÿr(R)
      ÿÿ7.ÿÿÿÿÿÿÿÿÿscalarÿdefineÿ`rho'ÿ=ÿ`R'[1,ÿ2]
      ÿÿ8.ÿÿÿÿÿÿÿÿÿreturnÿscalarÿrhoÿ=ÿ`rho'
      ÿÿ9.ÿend

      .ÿ
      .ÿbootstrapÿrhoÿ=ÿr(rho),ÿreps(50)ÿcluster(pid)ÿidcluster(newpid):ÿbootem
      (runningÿbootemÿonÿestimationÿsample)

      Bootstrapÿreplicationsÿ(50)
      ----+---ÿ1ÿ---+---ÿ2ÿ---+---ÿ3ÿ---+---ÿ4ÿ---+---ÿ5ÿ
      ..................................................ÿÿÿÿ50

      BootstrapÿresultsÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿ1,250
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿReplicationsÿÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ50

      ÿÿÿÿÿÿcommand:ÿÿbootem
      ÿÿÿÿÿÿÿÿÿÿrho:ÿÿr(rho)

      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(Replicationsÿbasedÿonÿ250ÿclustersÿinÿpid)
      ------------------------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿObservedÿÿÿBootstrapÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNormal-based
      ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
      -------------+----------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿrhoÿ|ÿÿ-.1423329ÿÿÿ.0086542ÿÿÿ-16.45ÿÿÿ0.000ÿÿÿÿ-.1592948ÿÿÿÿ-.125371
      ------------------------------------------------------------------------------

      .ÿestatÿbootstrap,ÿall

      BootstrapÿresultsÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿ1,250
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿReplicationsÿÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ50

      ÿÿÿÿÿÿcommand:ÿÿbootem
      ÿÿÿÿÿÿÿÿÿÿrho:ÿÿr(rho)

      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(Replicationsÿbasedÿonÿ250ÿclustersÿinÿpid)
      ------------------------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿObservedÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿBootstrap
      ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿCoef.ÿÿÿÿÿÿÿBiasÿÿÿÿStd.ÿErr.ÿÿ[95%ÿConf.ÿInterval]
      -------------+----------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿrhoÿ|ÿÿ-.14233287ÿÿÿ.0000755ÿÿÿÿ.0086542ÿÿÿ-.1592948ÿÿÿ-.125371ÿÿÿ(N)
      ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-.158442ÿÿ-.1258217ÿÿÿ(P)
      ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-.158442ÿÿ-.1258217ÿÿ(BC)
      ------------------------------------------------------------------------------
      (N)ÿÿÿÿnormalÿconfidenceÿinterval
      (P)ÿÿÿÿpercentileÿconfidenceÿinterval
      (BC)ÿÿÿbias-correctedÿconfidenceÿinterval

      .ÿ
      .ÿexit

      endÿofÿdo-file


      .


      The user-written command -ovbd- is available from SSC. Note that it requires the user-written command -ridder-, too.

      Comment


      • #4
        You may wish to read this thread.
        Best regards,

        Marcos

        Comment


        • #5
          Many thanks Marcos for sharing the thread.

          Comment

          Working...
          X