<?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 Re: Proc surveyfreq in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139305#M1318</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would appreciate if you can just let me know briefly how, or refer me to any link. Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Sep 2014 21:24:51 GMT</pubDate>
    <dc:creator>Hani</dc:creator>
    <dc:date>2014-09-10T21:24:51Z</dc:date>
    <item>
      <title>Proc surveyfreq</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139302#M1315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I am carrying out a national survey, with stratified sampling. To account for this, I am going to use the "proc surveyfreq", but I am wondering how to figure out the weights that I should use.&lt;/P&gt;&lt;P&gt;I would appreciate any feedback, help, links or anything that might help me figure it out.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 20:41:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139302#M1315</guid>
      <dc:creator>Hani</dc:creator>
      <dc:date>2014-09-10T20:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc surveyfreq</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139303#M1316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this you have to calculate your weight variable depending on stratification factors.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:22:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139303#M1316</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-09-10T21:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc surveyfreq</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139304#M1317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you generate your sample? Basically for each record within a strata your weight would be the inverse of the probability of select which is often population//samplesize assuming a simple random sample within each strata. If you did something else it gets more entertaining.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you used Proc Surveyselect to generate the sample the weights would be in the resulting data by default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After you have that weight per strata attach it to your data. Easiest might be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table weighteddata as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.*, b.Surveyweight&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from surveydata as a left join weights as b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on a.stratum=b.stratum;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;Assuming: surveydata is your response data set; weights has a variable Surveyweight calculated for each stratum;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; your stratum variable is named stratum;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139304#M1317</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-09-10T21:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc surveyfreq</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139305#M1318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would appreciate if you can just let me know briefly how, or refer me to any link. Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139305#M1318</guid>
      <dc:creator>Hani</dc:creator>
      <dc:date>2014-09-10T21:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc surveyfreq</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139306#M1319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Somewhere you need to have a description of your sample frame(population) and determine how many possible respondents there were. Use proc means or summary to count or sum as appropriate with a CLASS statement of your stratum variable.&lt;/P&gt;&lt;P&gt;Do the same thing with the sample data set.&lt;/P&gt;&lt;P&gt;Match/merge the two datasets by the stratum variable.&lt;/P&gt;&lt;P&gt;Calculate the weight for the strata as: SurveyWeight = populationtotal/sampletotal;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139306#M1319</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-09-10T21:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc surveyfreq</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139307#M1320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have to adjust your sample counts based on census data. If you are taking gender and age_group as startification factors then use somthing like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if gender='M' and age_group='18-25' then wt=1.2;&lt;/P&gt;&lt;P&gt;if gender='F' and age_group='18-25' then wt=1.3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wt is the weight variable&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139307#M1320</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-09-10T21:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc surveyfreq</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139308#M1321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That isn't an easy statistical question. It depends on how the sample was chosen. I've seen an entire university course dedicated entirely on how to properly create samples and weights and the corresponding analysis, which all need to line up properly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consult a statistician or whomever determined the stratified sampling method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139308#M1321</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-10T21:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc surveyfreq</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139309#M1322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the detailed response. Yes, it was a simple random sample within each strata. No, I didn't use the proc surveyselect. So, if I understand it correctly, the weight of the subjects in each strata will be the total population divided by the sample size from this strata?? Am I right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139309#M1322</guid>
      <dc:creator>Hani</dc:creator>
      <dc:date>2014-09-10T21:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc surveyfreq</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139310#M1323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all, I think I will be able to figure it out from here.&lt;/P&gt;&lt;P&gt;Appreciate it.&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 22:35:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Proc-surveyfreq/m-p/139310#M1323</guid>
      <dc:creator>Hani</dc:creator>
      <dc:date>2014-09-10T22:35:23Z</dc:date>
    </item>
  </channel>
</rss>

