<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Weighted random stratified sampling in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225572#M11938</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies if this is a silly question, I am a relatively new SAS user currently running 9.3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset (CITIES) of around 20,000 cities, each with population size classification, climate type, and national GDP classification.Some cities in the dataset also have&amp;nbsp;data&amp;nbsp;on transport, health, etc, which I have summarised&amp;nbsp;into a single column called DataCoverage which&amp;nbsp;counts the columns with known data for each city.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to do further analysis on a sub-sample of cities, and I would like to randomly select them in a manner which reflects the existing proportions of the data. I have done:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc surveyselect data = CITIES out = samp1 method = srs sampsize=200 seed = 9876;&lt;BR /&gt;strata CLIMATE&amp;nbsp;POPULATION_CLASS GDP_CLASS&amp;nbsp;/ alloc=proportional;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would really like to do is select a subsample, which represents the proportions of the original dataset, but gives more weight to those with a larger DataCoverage (i.e. more known data, so I don't have to go find the data somewhere myself). Is such a thing possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
    <pubDate>Tue, 15 Sep 2015 13:37:27 GMT</pubDate>
    <dc:creator>jgtaylor</dc:creator>
    <dc:date>2015-09-15T13:37:27Z</dc:date>
    <item>
      <title>Weighted random stratified sampling</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225572#M11938</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies if this is a silly question, I am a relatively new SAS user currently running 9.3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset (CITIES) of around 20,000 cities, each with population size classification, climate type, and national GDP classification.Some cities in the dataset also have&amp;nbsp;data&amp;nbsp;on transport, health, etc, which I have summarised&amp;nbsp;into a single column called DataCoverage which&amp;nbsp;counts the columns with known data for each city.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to do further analysis on a sub-sample of cities, and I would like to randomly select them in a manner which reflects the existing proportions of the data. I have done:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc surveyselect data = CITIES out = samp1 method = srs sampsize=200 seed = 9876;&lt;BR /&gt;strata CLIMATE&amp;nbsp;POPULATION_CLASS GDP_CLASS&amp;nbsp;/ alloc=proportional;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would really like to do is select a subsample, which represents the proportions of the original dataset, but gives more weight to those with a larger DataCoverage (i.e. more known data, so I don't have to go find the data somewhere myself). Is such a thing possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2015 13:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225572#M11938</guid>
      <dc:creator>jgtaylor</dc:creator>
      <dc:date>2015-09-15T13:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted random stratified sampling</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225610#M11941</link>
      <description>&lt;P&gt;If you can provide a numeric variable that represents data coverage, with larger meaning more coverage, you might be able to get this with a PPS selection using that variable for the SIZE.&lt;/P&gt;&lt;P&gt;Depending on how you are defining "reflects the existing proportions" you may need to look at setting sample sizes per strata.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2015 15:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225610#M11941</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-09-15T15:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted random stratified sampling</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225817#M11948</link>
      <description>&lt;P&gt;Thanks, I think this gets me close.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm defining&amp;nbsp;&lt;SPAN&gt;"reflects the existing proportions" as, for example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;If CITIES&amp;nbsp;with a Population_Class of &amp;lt;50K with GDP_Class of "LowerMiddle GDP" in CLIMATE "Temperate Humid" &amp;nbsp;comprise 5% of all cities in the world, then I want them to be 5% of my sampled dataset. The percent of each strata in the sample should reflect that in the original dataset.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have changed to:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc surveyselect data = CITIES&amp;nbsp;out = samp1 method = pps sampsize=200 seed = 9876;&lt;BR /&gt;strata CLIMATE&amp;nbsp;POPULATION_CLASS GDP_CLASS / alloc=proportional;&lt;BR /&gt;size DataCoverage;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a few problems, namely:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1) it's not giving me any cities with DataCoverage=0. It's ok to have some in order to maintain proportions, I just want to minimise them if possible&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2) Since DataCoverage isn't great, I am not getting a sample size of 200 (97, actually).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 12:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225817#M11948</guid>
      <dc:creator>jgtaylor</dc:creator>
      <dc:date>2015-09-16T12:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted random stratified sampling</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225870#M11952</link>
      <description>&lt;P&gt;The SIZE has to be non-zero in the basic use of surveyselect. Since we are using something that really isn't a population size counter then I would suggest add 1 to your datasource rate for all variables to get a 1 or greater and then at the end subtract the one out to get back to the original rank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also every record should have a datasource value or they would be excluded.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 15:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225870#M11952</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-09-16T15:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted random stratified sampling</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225997#M11957</link>
      <description>&lt;P&gt;Very clever! That seems to have done what I wanted it to. Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2015 07:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weighted-random-stratified-sampling/m-p/225997#M11957</guid>
      <dc:creator>jgtaylor</dc:creator>
      <dc:date>2015-09-17T07:36:46Z</dc:date>
    </item>
  </channel>
</rss>

