Announcement

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

  • estimated samples using svy command

    I am working with survey data that use multi-stage sampling and I'm applying the svy command to calculate simple proportions:

    svy: proportion education

    The variable "education" has 5 levels and I would like to view data on the estimated sample size of each level of the variable that is calculated using the svy command.

    "ereturn list" provides the entire sample size for all 5 levels combined, but I would like to view the estimated sample sizes by level.

    Many thanks for any help.

  • #2
    You'd have to go back to tab education without svy features. The number of observations at each level is hardly any longer relevant if you have complex survey data; your effective sample size is usually lower than the nominal sample size, so the latter is of relatively little use.
    -- Stas Kolenikov || http://stas.kolenikov.name
    -- Principal Survey Scientist, Abt SRBI
    -- Opinions stated in this post are mine only

    Comment


    • #3
      Here is a klutzy way. There is probably something better.

      Code:
      sysuse nhanes2f, clear
      svy: total race, over(race)
      estat size, obs size
      
      . estat size, obs size
      
              White: race = White
              Black: race = Black
              Other: race = Other
      
      ----------------------------------------------------------------------
                   |             Linearized
              Over |      Total   Std. Err.              Obs            Size
      -------------+--------------------------------------------------------
      race         |
             White |   1.03e+08    2915673              9051       102865695
             Black |   2.24e+07    2917629              1086        11189236
             Other |    8906184    3756481               200         2968728
      ----------------------------------------------------------------------
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        Richard and "skolenik",

        Thank you both very much for the help and comments.

        Richard, the code you provided did indeed provide the sample sizes by level of the education variable, though the samples sizes under "Obs" are no different from what I get using the "tab" command with svy. So I don't think that that code is providing me with the effective sample size. In the past, I have usually just provided the nominal sample size when reporting data using svy, so perhaps I can just do that. But I thought it might be clearer to readers to present the effective sample sizes given that that is what Stata is using to calculate the proportions.

        Thank you both again very much.

        Comment


        • #5
          Obs is the unweighted sample size, while Size is the weighted size, i.e. the estimated population size for the group. If you don't want either of those, what is your definition of "effective sample size?" Is your idea that, say, a sample of 10000 collected by complex sampling is only about as good as a sample of 5000 collected via simple random sampling?
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          Stata Version: 17.0 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Does estat effects give you something like what you want? See, for example, p. 8 of http://www.stata.com/manuals13/svyestat.pdf
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            Stata Version: 17.0 MP (2 processor)

            EMAIL: [email protected]
            WWW: https://www3.nd.edu/~rwilliam

            Comment


            • #7
              Richard,

              Thank you so much for these additional comments. This is extremely helpful. I didn't realize the "size" was the weighted size. My definition of "effective sample size" is the sample size that Stata uses to calculate proportions based on the sampling weights and strata I provide in the svyset command.

              I expected to see effective sizes that were smaller than the nominal size. I suppose I should just report the nominal sample sizes because it seems, at "skolenik" noted, it is hard to interpret the effective sample size.

              Thank you again for taking the time to provide your input. It is much appreciated!

              Comment

              Working...
              X