Announcement

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

  • using gsample to stratify and cluster at the same time

    Hello, I'm trying to use the gsample function to sample villages from a household-level data set, stratified by 2 parameters (remote, which is a 0/1 variable, and region, which has 9 categories). When I used the function to sample household by the stratifying criteria, it worked great:

    set seed 475
    gsample 5, wor strata(remote region)


    when I added the command to cluster around villages (locid), I started getting strange results --- specifically, no matter how I change the seed, mostly the same villages are chosen as clusters. Even though there are 116 villages in the data set evenly distributed across regions. This version also only worked when I left out the wor option to sample without replacement.

    set seed 475
    gsample 5, cluster(locid) strata(remote region)


    I tried another method of collapsing the data set down to villages and sampling villages directly, but I got an error message that the number of observations was too small for the sampling categories I need.

    I would greatly appreciate any advice on how to do this! Maybe there's something wrong in how a wrote out the command, or maybe there's a different function that will better fit my needs?


  • #2
    Welcome to Statalist, Noora!

    Make sure to review the Statalist FAQ, especially sections 9-12. Section 12 is the most important. Section 12.3 tells you to copy commands and results from your results window or log between CODE delimiters. See William Lisowski's post #2 here which is a fine summary and example of good practice.

    To help us answer your question, using the collapsed data, show a table of the number of villages, classified by region and remote,
    Code:
    tab region remote
    Also, how many households are in the 116 villages and what's the minimum and maximum number?
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      If you don't have village sizes, rough counts of those that are "large" and "small" would be helpful.
      Steve Samuels
      Statistical Consulting
      [email protected]

      Stata 14.2

      Comment

      Working...
      X