Announcement

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

  • svyset no population members

    hi guys!

    quick question: when using svyset (w/out the sub-population option) what is the reason for ´strata being omitted because they contain no population members´ given that i have no missing info on any of my variables. this situation results in about 25% less observation being used.

    thanks,
    natalia

  • #2
    We might be able to answer the question if, as FAQ,# 12 asks, you show code, all results (e.g. from svdes) and other supporting data. When you repost, be sure to put these between CODE delimiters, described in that FAQ
    Last edited by Steve Samuels; 13 May 2016, 08:55.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Apologizes. Hopefully I got it this time around.

      Code:
      svyset[pweight=weight], strata(strata) psu(orgareaid)
      
      ​svydescribe
      
      Survey: Describing stage 1 sampling units
      
      pweight: weight
                VCE: linearized
        Single unit: missing
           Strata 1: strata
               SU 1:orgareaid
              FPC 1: <zero>
      
      
                                            #Obs per Unit
                                    ----------------------------
      Stratum    #Units     #Obs      min       mean      max  
      --------  --------  --------  --------  --------  --------
             1         5        17         1       3.4         6
             2         4         9         2       2.3         3
             3         5        19         1       3.8         8
             4         5        15         2       3.0         6
             5         4        19         1       4.8        11
             6         3         6         1       2.0         4
             7         5        14         1       2.8         4
             8         5        20         1       4.0        10
             9         5        31         4       6.2         8
            10         5        18         2       3.6         5
            11         4        12         1       3.0         9
            12         5        24         2       4.8        10
            13         5        17         2       3.4         7
            14         5        17         1       3.4         7
            15         5        25         3       5.0         9
            16         5        25         1       5.0         8
            17         5        25         2       5.0         8
            18         3         5         1       1.7         3
            19         5        29         2       5.8        10
            20         5        21         3       4.2         7
            21         4        25         4       6.3        11
            22         5        31         2       6.2         9
            23         5        24         1       4.8        10
            24         5        27         3       5.4         9
            25         4        16         2       4.0         7
            26         5        20         2       4.0         8
            27         5        14         1       2.8         4
            28         5        18         2       3.6         5
            29         5        17         3       3.4         4
            30         5        16         1       3.2         6
            31         5        18         1       3.6         7
            32         5        24         3       4.8         7
            33         5        20         1       4.0         7
            34         4        21         2       5.3        10
            35         5        27         3       5.4         9
            36         5        22         3       4.4         6
            37         5        16         2       3.2         5
            38         5        24         2       4.8         7
            39         5        25         1       5.0        12
            40         5        12         1       2.4         4
            41         5        29         5       5.8         7
            42         5        32         2       6.4        10
            43         5        31         4       6.2         8
            44         5        29         2       5.8        12
            45         5        34         4       6.8         9
            46         5        24         3       4.8         8
            47         5        20         1       4.0         8
            48         5        24         2       4.8         9
            49         5        32         3       6.4        10
            50         5         8         1       1.6         4
            51         5        17         2       3.4         5
            52         5        23         2       4.6         7
            53         5        22         2       4.4         7
            54         5        21         2       4.2         6
            55         4        15         1       3.8         7
            56         4        15         1       3.8         9
            57         3        14         2       4.7         7
            58         5        31         2       6.2         9
            59         5        17         2       3.4         4
            60         5        29         4       5.8         7
            61         5        17         2       3.4         5
            62         5        33         3       6.6        12
            63         5        27         2       5.4         9
            64         5        27         4       5.4         7
            65         5        16         1       3.2         8
            66         4        13         2       3.3         7
            67         5        24         2       4.8         8
            68         5        19         1       3.8         7
            69         5        27         3       5.4         8
            70         5        32         4       6.4         9
            71         5        22         2       4.4         7
            72         5        23         3       4.6         6
            73         4        12         1       3.0         4
            74         5        28         3       5.6         8
            75         5        16         2       3.2         4
            76         5        25         3       5.0        11
            77         5        20         1       4.0         6
            78         5        20         1       4.0         6
            79         5        23         2       4.6         6
            80         4        12         1       3.0         6
            81         5        23         1       4.6         9
            82         5        25         3       5.0         8
            83         5        27         2       5.4         7
            84         3        14         3       4.7         7
            85         4        14         2       3.5         5
            86         5        18         3       3.6         5
            87         5        31         3       6.2        12
            88         5        28         1       5.6        10
            89         5        21         2       4.2         9
            90         5        24         4       4.8         6
            91         5        17         3       3.4         4
            92         5        13         1       2.6         5
            93         5        28         4       5.6         7
            94         5        20         1       4.0         6
            95         5        28         2       5.6         8
            96         5        14         1       2.8         7
            97         8        53         2       6.6        17
            98         5        24         3       4.8         6
            99         4        15         2       3.8         5
           100         5        31         3       6.2        10
           101         4        22         4       5.5         9
           102         5        21         1       4.2        10
           103         5        31         4       6.2         9
           104         4        17         1       4.3         6
           105         5        18         3       3.6         4
           106         5        10         1       2.0         4
           107         5        27         4       5.4         8
           108         5        21         1       4.2         8
           109         5        25         2       5.0         7
           110         5        16         1       3.2         8
           111         5        16         2       3.2         4
           112         5        26         1       5.2         9
           113         5        22         1       4.4         9
           114         5        22         2       4.4         9
           115         5        16         2       3.2         4
           116         4        17         1       4.3         9
           117         5        27         1       5.4         9
           118         4        23         4       5.8         7
           119         5        20         2       4.0         7
           120         5        23         1       4.6        10
           121         5        23         2       4.6         6
           122         5        28         2       5.6        10
      --------  --------  --------  --------  --------  --------
           122       588      2627         1       4.5        17

      Comment


      • #4
        Thanks for using CODE delimiters. Results of svydes is just one of the things I asked you for Reread the FAQ, including the first sentence of section 12.1. I asked you for all results and commands related to the error. Copy and paste from your log or the results window, omitting nothing. You do have some strata with small numbers of observations, which you might investigate.
        Last edited by Steve Samuels; 13 May 2016, 10:35.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment


        • #5
          i remember copy-pasting an example illustrating the number of observations difference the as well, but then fussing around I probably deleted it. Here goes. Unfortunately I cannot provide access to the data.


          Code:
          
          tab marstat
          
           partnering |
               status |      Freq.     Percent        Cum.
          ------------+-----------------------------------
            partnered |      2,041       77.69       77.69
                  sdw |        172        6.55       84.24
                never |        414       15.76      100.00
          ------------+-----------------------------------
                Total |      2,627      100.00
          
          . svy: tab marstat, column
          (running tabulate on estimation sample)
          
          Number of strata   =        97                  Number of obs      =      2086
          Number of PSUs     =       468                  Population size    = 2872781.4
                                                          Design df          =       371
          
          ----------------------
          partnerin |
          g status  |     column
          ----------+-----------
           partnere |      .7117
                sdw |      .0682
              never |      .2201
                    |
              Total |          1
          ----------------------
            Key:  column    =  column proportions
          
          Note: 25 strata omitted because they contain no population members.
          Last edited by natalia malancu; 13 May 2016, 10:53.

          Comment


          • #6
            Thanks. This is a clear demonstration. Does the problem occur with other outcomes as well? Is your Stata up to date? If not, update and see if the problem recurs.

            In any case, you may have discovered a bug .Send the 2,627 observations to StataCorp ([email protected]) with just "marstat" and the design variables, enough to reproduce the problem. If necessary, mask the data , for example by renumbering of Strata and PSUs. Just make sure that the problem persists in the modified data before you send it in. Support will also want to know your Stata version and OS and computer details,. Give a link to this post (http://www.statalist.org/forums/foru...lation-members) and let us know what they say.

            After running the svy: tab, I think you can identify the missing strata with:
            Code:
            svydes if e(sample)
            Then compare to the one above. It would be very interesting if a renumbering of the strata led to a differing number of those left out of the analysis.
            Last edited by Steve Samuels; 13 May 2016, 11:23.
            Steve Samuels
            Statistical Consulting
            [email protected]

            Stata 14.2

            Comment


            • #7
              stata (13) is up to date and the problem occurs with all other outcomes - I constantly get a return of just 2086 observations. I will try to change the machine and see if the problem recurs.

              If it does I'll proceed as you suggested.

              thank you

              Comment


              • #8
                update: bug there is not, limited knowledge on my part there is.

                When all the observations in a stratum have zero pweights, the stratum is omitted. To check for that:

                Code:
                count if weight == 0
                Code:
                922
                bysort strata: egen sum_wt = total(weight)
                count if sum_wt == 0
                541
                I'm still trying to figure how many more cases I am expected to lose when running a multivariate analysis on my sample, but that is not a question for stata technical

                Comment


                • #9
                  Thanks for letting us know. I'm surprised that svydes doesn't report missing weights.
                  Steve Samuels
                  Statistical Consulting
                  [email protected]

                  Stata 14.2

                  Comment


                  • #10
                    I guess it's because they are not missing, but just have a value of zero.

                    Comment


                    • #11
                      You're right, of course.
                      Steve Samuels
                      Statistical Consulting
                      [email protected]

                      Stata 14.2

                      Comment


                      • #12
                        You are right. If weights or any other survey characteristics like psu's or strata are missing, svydes does report the number.
                        Steve Samuels
                        Statistical Consulting
                        [email protected]

                        Stata 14.2

                        Comment

                        Working...
                        X