<?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: Select minimum Sample of cases to QC all conditions : use arrays? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Select-minimum-Sample-of-cases-to-QC-all-conditions-use-arrays/m-p/432573#M281803</link>
    <description>&lt;P&gt;A different approach entirely ... take some real data and create the conditions you want to check.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data checkthis;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;if _n_=1 then do;&lt;/P&gt;
&lt;P&gt;var1=.;&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;var1=5;&lt;/P&gt;
&lt;P&gt;hhincome = 75000;&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;else if _n_=2 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;* create some additional conditions to check;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jan 2018 00:01:21 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-01-31T00:01:21Z</dc:date>
    <item>
      <title>Select minimum Sample of cases to QC all conditions : use arrays?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-minimum-Sample-of-cases-to-QC-all-conditions-use-arrays/m-p/432540#M281802</link>
      <description>&lt;P&gt;Task: select a minimum sample of cases that taken together, provide at least one example of all&amp;nbsp;specified conditions, for QC&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;I might want to find at least one case where var1 is&amp;nbsp;nonmissing.&lt;/P&gt;&lt;P&gt;I might need to see at least one case where variable, HHincome &amp;gt; 50,000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Purpose/context:&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on an application that displays on the computer, information about a single person, with values populated by background datasets.&amp;nbsp; In order to verify that everything is working properly, I have to eye-ball at least one example that shows me that a date, for example, is displaying in the correct format, and at least one example that proves that a second email is showing up. If these are rare, I might have to look at two different cases.&amp;nbsp; But I have at least 100&amp;nbsp;variables or conditions of interest that occur rarely, and for reasons I won't get into, it is impractical to view/document over a hundred examples.&lt;/P&gt;&lt;P&gt;I was thinking that I could set up a series of arrays that keep track of which cases can be observed to verify that each condition is addressed. I could then analyze the info in the arrays to come up with a sample of cases that taken together, make if possible to do a complete QC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does that make sense? Do you have other ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 22:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-minimum-Sample-of-cases-to-QC-all-conditions-use-arrays/m-p/432540#M281802</guid>
      <dc:creator>TimWright</dc:creator>
      <dc:date>2018-01-30T22:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select minimum Sample of cases to QC all conditions : use arrays?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-minimum-Sample-of-cases-to-QC-all-conditions-use-arrays/m-p/432573#M281803</link>
      <description>&lt;P&gt;A different approach entirely ... take some real data and create the conditions you want to check.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data checkthis;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;if _n_=1 then do;&lt;/P&gt;
&lt;P&gt;var1=.;&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;var1=5;&lt;/P&gt;
&lt;P&gt;hhincome = 75000;&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;else if _n_=2 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;* create some additional conditions to check;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 00:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-minimum-Sample-of-cases-to-QC-all-conditions-use-arrays/m-p/432573#M281803</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-01-31T00:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select minimum Sample of cases to QC all conditions : use arrays?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-minimum-Sample-of-cases-to-QC-all-conditions-use-arrays/m-p/432751#M281804</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Astounding,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestion led to the following strategy for identifying cases that meet 3 infrequent conditions:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data qc;&lt;BR /&gt;set rcls;&lt;BR /&gt;if purpose_appt ne '' then do; qc1=1; output;end;&lt;BR /&gt;if purpose_gen ne '' then do;qc2=1; output;end;&lt;BR /&gt;if contact_mode =6 then do;qc3=1; output;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc print data=qc;&lt;BR /&gt;var sid2018 qc1 qc2 qc3 purpose_appt purpose_gen contact_mode ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Output&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs sid2018 qc1 qc2 qc3 purpose_appt purpose_gen Contact_Mode12345 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;0107730020&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Appointment&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0107730030&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Appointment&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0109620010&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;General info&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0109620010&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Appointment&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0109620010&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Appointment&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This shows me that&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;&lt;SPAN&gt;0109620010 would be a good choice for review because it satisfies two of the conditions&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.0109620010 is also needed because condition 2 is not met in case&amp;nbsp;0109620010(or any other cases for that matter)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. no need to check obs1, obs2, or obs4.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is a great strategy for finding examples that meet conditions of interest for relatively rare conditions. It is exactly the type of thing I need.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 14:37:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-minimum-Sample-of-cases-to-QC-all-conditions-use-arrays/m-p/432751#M281804</guid>
      <dc:creator>TimWright</dc:creator>
      <dc:date>2018-01-31T14:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select minimum Sample of cases to QC all conditions : use arrays?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-minimum-Sample-of-cases-to-QC-all-conditions-use-arrays/m-p/432764#M281805</link>
      <description>I just noticed that 0109620010 is listed twice. I would take a second step to dedup it, keeping just the last line for each case.</description>
      <pubDate>Wed, 31 Jan 2018 14:46:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-minimum-Sample-of-cases-to-QC-all-conditions-use-arrays/m-p/432764#M281805</guid>
      <dc:creator>TimWright</dc:creator>
      <dc:date>2018-01-31T14:46:30Z</dc:date>
    </item>
  </channel>
</rss>

