Announcement

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

  • -dstdize- when popvar is not integer

    I am using -dstdize- with Stata 13.1 to compute age-standardized mortality rates with CI.

    My popvar is the exposure, person-years, which is not an integer. In Stata I get the error message "<popvar > must have nonnegative integer values". But I don't see why this restriction should be necessary. I have now made my own version of the dstdize.ado-file. My version skips the following lines of code in the original ado-file:

    capture assert `pop' >=0 & int(`pop')==`pop' if `touse'
    if _rc {
    di in red `"`pop' must have nonnegative integer values"'
    exit 499
    }

    This way, the non-integer popvar is accepted, and rates and their CIs look OK. From the formulas for the standardized rate SR and its standard error se(SR) I can't see any problems with relaxing the integer restriction, but mayby I am overlooking something here?

    (Of course negative values are also accepted in my version of the command. That is probably not so good, but easy to fix).

    Any thoughts?

    Jørgen

  • #2
    I've never looked at this problem, but just make sure that you rename any modified version of a Stata program and move the copy to your own fraction of the adopath. That way, you won't lose changes if Stata updates the original and everyone remains clear on what is what (not least yourself, if you want to compare results). Also, you are now in charge!

    Comment


    • #3
      Exactly. It is the first time I do anything like this, but my version of the command is named -dstdize_mv- and the corresponding ado-file i stored like you suggest (in my case in "c:\ado\personal/").

      Comment


      • #4
        Jørgen:
        You are right; there is no need for popvar to be integer. I met the problem before and just multiplied numbers in the using dataset by 1000; it is the relative distribution that matters. ir (epitab command) had the same restriction some years ago, but it was corrected. You should send a message to Tech Support about it.

        Comment


        • #5
          Jørgen:
          I got it slightly wrong; it is the denominator in your own dataset, not the using dataset, that gives rise to the error message, and actually, in the manual's Sweden/Panama example, the using file has non-integer weights. It is your use of the popvar name that confused me; the manual says: "Weights used in the standardization are given by popvar".

          But you are still right; the restriction is unnecessary.

          Comment


          • #6
            Svend:
            Making a suggestion to the Tech Support was my first thought, and now that I've got some support from the Statalist I'll go ahead and do it

            Comment


            • #7
              I had exactly the same problem but with istdize. The person-time variable was a float variable. I fixed it as Jørgen commented and worked perfectly. I attach the .ado with the modified version of istdize in case somebody else is in the same situation.
              Attached Files

              Comment


              • #8
                Hello,

                Can someone follow up with this to determine if Tech Support fixed the nonintegar issue? I am getting this error and multiplying the population variable by 1000 does not fix it. If this has been fixed do I just need to update Stata to benefit from this change? Thank you.

                Comment

                Working...
                X