Announcement

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

  • difference in proportions using svy

    Hello,

    I have datasets from 2 household surveys conducted in the same area 3 years apart. The sampling design (stratified cluster sample) was the same for both surveys, but sampling was independent so as to get representative estimates at each timepoint (ie not a panel survey). I would like to be able to report the difference in proportions (and 95% CI) for a binary variable for subgroup A from time 1 to time 2.

    I have pooled and svyset the data. Is svy: proportion followed by lincom an acceptable approach for this? eg:

    svyset hh2 [pw=std_enfwt], strata(district_ord)
    svy, subpop(fev): proportion care, over(zone phase)
    lincom _subpop_2-_subpop_1

    I usually see lincom used to combine coefficients or means. Not clear from stata help whether it can be used for proportions as well.

    many thanks





  • #2


    Welcome to Statalist, Melinda!


    Just to confirm, you are saying that there was no sampling stage before household selection in either survey, for example a prior sampling of census blocks. Correct?

    One preliminary: Your svyset statement is incorrect, but the error will only increase standard errors, not induce bias. With two independent surveys, as you describe, you need to create a new stratum that incorporates survey year, which I suppose is "phase", and use that.

    Code:
    . gen newstrat = group(phase district_ord)
    . svyset hh2 [pw=std_enfwt], strata(newstrat)
    I always suggest that before posting to Statalist about a command, you first check the Help and linked Manual entries to see if they will answer your question, whether lincom can be used with estimates other than means. If you had done this you would have immediately found that the answer is "Yes".

    If you'd then run your command as written, you would have received the message:

    Code:
    . _subpop_2 not found
    You might have then looked further at the Manual entry and found a section on Multi-Equation Models with an example (from mlogit) where the output looks a lot like that from svy prop. The text states:


    lincom also works with multiple-equation models. The only difference is how you refer to the coefficients. Recall that for multiple-equation models, coefficients are referenced using the syntax

    [eqno]varname

    where eqno is the equation number or equation name and varname is the corresponding variable name for the coefficient; see [U] 13.5 Accessing coefficients and standard errors and [R] test for details.
    Here's an example of how this this translates to svy prop with the over option. (By the way, I encourage you to learn how to format code and output in the forum with the # button.. It makes posts much more readable. See:http://www.statalist.org/forums/help...ntent_advanced.


    Code:
    . sysuse auto, clear
    . recode rep78  1/2=5
    . svyset _n
    
     svy: prop rep78, over(foreign)
    
    Survey: Proportion estimation
    
    Number of strata =       1          Number of obs    =      69
    Number of PSUs   =      69          Population size  =      69
                                        Design df        =      68
    
          _prop_1: rep78 = 3
          _prop_2: rep78 = 4
          _prop_3: rep78 = 5
    
         Domestic: foreign = Domestic
          Foreign: foreign = Foreign
    
    --------------------------------------------------------------
                 |             Linearized
            Over | Proportion   Std. Err.     [95% Conf. Interval]
    -------------+------------------------------------------------
    _prop_1      |
        Domestic |      .5625   .0721273      .4173807    .6976567
         Foreign |   .1428571   .0769198      .0454221    .3685949
    -------------+------------------------------------------------
    _prop_2      |
        Domestic |      .1875   .0567495      .0988857    .3267313
         Foreign |   .4285714    .108781      .2361242     .645355
    -------------+------------------------------------------------
    _prop_3      |
        Domestic |        .25   .0629579      .1457113    .3944648
         Foreign |   .4285714    .108781      .2361242     .645355
    --------------------------------------------------------------
    
    . lincom  [_prop_1]Foreign - [_prop_2]Foreign
    
     ( 1)  [_prop_1]Foreign - [_prop_2]Foreign = 0
    
    ------------------------------------------------------------------------------
      Proportion |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             (1) |  -.2857143   .1538396    -1.86   0.068    -.5926963    .0212678
    ------------------------------------------------------------------------------
    Last edited by Steve Samuels; 19 Jul 2014, 15:36.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment

    Working...
    X