<?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: Insert missing strata into a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Insert-missing-strata-into-a-dataset/m-p/454824#M284227</link>
    <description>&lt;P&gt;There are quite a few ways and quite a few papers on this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you check here, you'll find several solutions that are applicable to your question:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://lexjansen.com/search/searchresults.php?q=including%20missing%20categories" target="_blank"&gt;https://lexjansen.com/search/searchresults.php?q=including%20missing%20categories&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Apr 2018 16:13:07 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-04-17T16:13:07Z</dc:date>
    <item>
      <title>Insert missing strata into a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-missing-strata-into-a-dataset/m-p/454819#M284226</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using SAS 9.4. I have a dataset of counts of mortality for about 1000 census tracts for a particular area. These counts are stratified on five age categories, three racial categories, sex and ethnicity (Hispanic vs not Hispanic). If there are any deaths in a given strata in a census tract within my time period of interest, the strata is listed. If 1-4 deaths occurred in that strata, the count is censored, and the count is marked as missing. If zero deaths occurred, the strata is not listed at all. I would like to insert rows for the absent "zero count" strata. The attached file is my full dataset. I have a simplified version of my dataset with just a few census tracts below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data mort;&lt;BR /&gt;input GEOID_data SEX RACE LIFESTAGE ETHNICITY Deaths;&lt;BR /&gt;datalines;&lt;BR /&gt;13013180103 1 1 5 1 .&lt;BR /&gt;13013180103 1 1 5 0 .&lt;BR /&gt;13013180103 1 1 6 0 9&lt;BR /&gt;13013180103 2 1 6 0 .&lt;BR /&gt;13013180103 2 3 6 0 .&lt;BR /&gt;13013180103 1 1 7 0 14&lt;BR /&gt;13013180103 2 1 7 0 8&lt;BR /&gt;13013180103 1 2 7 0 .&lt;BR /&gt;13013180103 2 2 7 0 .&lt;BR /&gt;13013180103 2 1 7 1 .&lt;BR /&gt;13013180103 1 1 8 0 23&lt;BR /&gt;13013180103 1 1 8 0 11&lt;BR /&gt;13013180103 2 1 8 0 10&lt;BR /&gt;13013180103 2 1 8 0 5&lt;BR /&gt;13013180103 1 2 8 0 .&lt;BR /&gt;13013180103 2 2 8 0 .&lt;BR /&gt;13013180103 2 1 9 0 47&lt;BR /&gt;13013180103 1 1 9 0 30&lt;BR /&gt;13013180103 1 2 9 0 .&lt;BR /&gt;13013180103 1 1 9 1 .&lt;BR /&gt;13013180104 1 1 5 0 .&lt;BR /&gt;13013180104 2 1 5 0 .&lt;BR /&gt;13013180104 2 1 6 0 .&lt;BR /&gt;13013180104 1 1 6 0 .&lt;BR /&gt;13013180104 2 2 6 0 .&lt;BR /&gt;13013180104 1 1 7 0 8&lt;BR /&gt;13013180104 2 1 7 0 .&lt;BR /&gt;13013180104 1 1 8 0 13&lt;BR /&gt;13013180104 2 1 8 0 6&lt;BR /&gt;13013180104 1 1 8 0 5&lt;BR /&gt;13013180104 2 1 8 0 .&lt;BR /&gt;13013180104 1 1 9 0 11&lt;BR /&gt;13013180104 2 1 9 0 10&lt;BR /&gt;13013180104 2 1 9 1 .&lt;BR /&gt;13013180104 1 1 9 1 .&lt;BR /&gt;13013180105 2 1 5 0 .&lt;BR /&gt;13013180105 1 1 5 0 .&lt;BR /&gt;13013180105 1 1 6 0 .&lt;BR /&gt;13013180105 2 1 6 0 .&lt;BR /&gt;13013180105 2 1 7 0 10&lt;BR /&gt;13013180105 1 1 7 0 7&lt;BR /&gt;13013180105 1 3 7 0 .&lt;BR /&gt;13013180105 1 1 8 0 11&lt;BR /&gt;13013180105 2 1 8 0 6&lt;BR /&gt;13013180105 2 1 8 0 5&lt;BR /&gt;13013180105 1 1 8 0 5&lt;BR /&gt;13013180105 1 1 9 0 22&lt;BR /&gt;13013180105 2 1 9 0 12&lt;BR /&gt;13013180105 2 2 9 0 .&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like every census tract to have all 60 possible combinations of lifestage, race, ethnicity and sex listed and to have strata that aren't currently listed have deaths=0.&amp;nbsp;How can I accomplish this?&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;</description>
      <pubDate>Tue, 17 Apr 2018 16:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-missing-strata-into-a-dataset/m-p/454819#M284226</guid>
      <dc:creator>lymcaliley</dc:creator>
      <dc:date>2018-04-17T16:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Insert missing strata into a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-missing-strata-into-a-dataset/m-p/454824#M284227</link>
      <description>&lt;P&gt;There are quite a few ways and quite a few papers on this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you check here, you'll find several solutions that are applicable to your question:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://lexjansen.com/search/searchresults.php?q=including%20missing%20categories" target="_blank"&gt;https://lexjansen.com/search/searchresults.php?q=including%20missing%20categories&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 16:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-missing-strata-into-a-dataset/m-p/454824#M284227</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-17T16:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Insert missing strata into a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-missing-strata-into-a-dataset/m-p/455022#M284228</link>
      <description>&lt;P&gt;Thanks for the link!&amp;nbsp;Problem solved.&amp;nbsp;For any others who may be doing the same thing I found this resource particularly helpful:&amp;nbsp;&lt;A href="http://support.sas.com/resources/papers/proceedings10/218-2010.pdf&amp;nbsp;" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings10/218-2010.pdf&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 04:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-missing-strata-into-a-dataset/m-p/455022#M284228</guid>
      <dc:creator>lymcaliley</dc:creator>
      <dc:date>2018-04-18T04:52:15Z</dc:date>
    </item>
  </channel>
</rss>

