<?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: Generating a data set that includes zero counts in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Generating-a-data-set-that-includes-zero-counts/m-p/774606#M31229</link>
    <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 15 Oct 2021 19:26:29 GMT</pubDate>
    <dc:creator>EmilyAV</dc:creator>
    <dc:date>2021-10-15T19:26:29Z</dc:date>
    <item>
      <title>Generating a data set that includes zero counts</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Generating-a-data-set-that-includes-zero-counts/m-p/774599#M31226</link>
      <description>&lt;P&gt;I have a dataset organized as follows:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile id group1 $ group2 $;&lt;/P&gt;&lt;P&gt;datalines&lt;/P&gt;&lt;P&gt;1 a1 b1&lt;/P&gt;&lt;P&gt;2 a1 b2&lt;/P&gt;&lt;P&gt;3 a2 b1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Group1 contains 50 categories with no missing values.&lt;/P&gt;&lt;P&gt;Group2 contains 2 categories and some missing values.&lt;/P&gt;&lt;P&gt;I need to generate a dataset that includes counts for all combinations of group 1 and group 2, including an observation of 0 when group 2 has a missing value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been using proc freq as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data=have;&lt;BR /&gt;tables group1*group2 / crosslist missing out=want;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code displays the results that I'm looking for, but the generated dataset does not include observations where group1*group2 counts are missing. The result is not changed by using the missprint option. Is there another approach I might try?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 18:47:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Generating-a-data-set-that-includes-zero-counts/m-p/774599#M31226</guid>
      <dc:creator>EmilyAV</dc:creator>
      <dc:date>2021-10-15T18:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a data set that includes zero counts</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Generating-a-data-set-that-includes-zero-counts/m-p/774601#M31227</link>
      <description>&lt;P&gt;Use the SPARSE option in the TABLES statement of PROC FREQ&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 18:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Generating-a-data-set-that-includes-zero-counts/m-p/774601#M31227</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-15T18:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a data set that includes zero counts</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Generating-a-data-set-that-includes-zero-counts/m-p/774606#M31229</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 19:26:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Generating-a-data-set-that-includes-zero-counts/m-p/774606#M31229</guid>
      <dc:creator>EmilyAV</dc:creator>
      <dc:date>2021-10-15T19:26:29Z</dc:date>
    </item>
  </channel>
</rss>

