Announcement

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

  • Calculating Percent Change of Prevalence with CI [Survey Data]

    Hello there,

    I am trying to calculate the prevalence rate of medication use in a series of cross-sectional surveys that have been merged. The variable for prescription use is binary, so I used the "mean" function to calculate the prevalence. However, I want to calculate the percent change between 2011 & 2003. I can do it using the "di" command, however this doesn't produce a confidence interval (and I am unsure if this is the right command to get the percent change using survey data). I know I can use lincom to get the CI of the difference between the two years. Any help is appreciated!

    Sample:

    svy: mean rxuse, over (year)
    di [rxuse]2011/[rxuse]2003-1

    lincom [rxuse]2011-[rxuse]2003

  • #2
    Try this:

    Code:
    // LINEAR DIFFERENCE MODEL
    svy: glm rxuse ibn.year, nocons link(log) family(binomial)
    
    // CALCULATE RATIO
    nlcom exp(_b[2011.year] - _b[2003.year])

    Comment


    • #3
      Thank you! That worked!

      Comment


      • #4
        I realize that this is an old thread, but it has some real value for my work. I am not very familiar with the method that Clyde recommended for the percent change. When I applied Clyde's method and compared it to the "di" version, I was left with a question. In the "di" version, the percent change was subtracted from 1. Does this need to occur with Clyde's version as well? A quick answer to that question and I am on my way.

        Comment


        • #5
          The code shown in #2 calculates the ratio of prevalence in 2003 to prevalence in 2001. If you are interested in the percent change, then you would subtract 1 from that and multiply the result by 100.

          Comment


          • #6
            Thank you very much this is a great help.

            Comment


            • #7
              Thank you for bringing up this topic.

              I tried both codes and now I have two quick questions.

              1. Could you please help interpret the results I got?
              2. Also, I need both crude and age standardized rate of change. Can age variable be included in the code?

              I'm including both methods. The codes are as follows:

              Code:
              . di [stunted]2015/[stunted]2006-1
              -.39301068
              
              . lincom [stunted]2015-[stunted]2006
              
               ( 1)  - [stunted]2006 + [stunted]2015 = 0
              
              ------------------------------------------------------------------------------
                      Mean |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       (1) |  -.0742029   .0130313    -5.69   0.000    -.0998022   -.0486037
              ------------------------------------------------------------------------------
              
              . svy: glm stunted ibn.year, nocons link(log) family(binomial)
              (running glm on estimation sample)
              
              Survey: Generalized linear models
              
              Number of strata   =        22                  Number of obs     =      5,737
              Number of PSUs     =       553                  Population size   = 5,736.8231
                                                              Design df         =        531
              
              ------------------------------------------------------------------------------
                           |             Linearized
                   stunted |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                      year |
                     2006  |  -1.667033   .0575035   -28.99   0.000    -1.779995   -1.554071
                     2015  |  -2.166277   .0628857   -34.45   0.000    -2.289812   -2.042742
              ------------------------------------------------------------------------------
              
              . nlcom exp(_b[2015.year] - _b[2006.year])
              
                     _nl_1:  exp(_b[2015.year] - _b[2006.year])
              
              ------------------------------------------------------------------------------
                   stunted |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                     _nl_1 |   .6069893   .0517234    11.74   0.000     .5056133    .7083654
              ------------------------------------------------------------------------------

              Comment


              • #8
                Hello,
                How would the code in #2 be applied to non-svy data?

                Comment

                Working...
                X