<?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 Subsetting data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Subsetting-data/m-p/143062#M38057</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two variables; the second dependent upon the answer of the first. There are 5 variables (Q1) each with its own severity scale (Q2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q1. Do you have the symptom? y/n/don't know/refused (1/2/88/99) &lt;/P&gt;&lt;P&gt;--&amp;gt; If a participant answered Y(1) to Q1, they should go to Q2. &lt;/P&gt;&lt;P&gt;Q2. Severity: 1/2/3/4/88/99&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to make a data set with no inappropriate missing data (where 'missing'=./don't know/refused). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far, I have been able to subset my data for Q1: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data newdata; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set olddata; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if cmiss (of var1 var2 var3 var4 var5) then delete; &lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked well and the expected number of observations were removed. However, I am unsure of how to move forward. If I ask SAS to remove the missing observations from Q2, then all those that answered N(2) to Q1 (and therefore, have appropriately missing data in Q2) would be removed. I only want to remove those individuals who answered Y(1) to Q1 and subsequently have missing data for Q2 (Q2 is conditioned on Q1). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any direction would be appreciated. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Jul 2014 20:02:45 GMT</pubDate>
    <dc:creator>toneill</dc:creator>
    <dc:date>2014-07-30T20:02:45Z</dc:date>
    <item>
      <title>Subsetting data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Subsetting-data/m-p/143062#M38057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two variables; the second dependent upon the answer of the first. There are 5 variables (Q1) each with its own severity scale (Q2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q1. Do you have the symptom? y/n/don't know/refused (1/2/88/99) &lt;/P&gt;&lt;P&gt;--&amp;gt; If a participant answered Y(1) to Q1, they should go to Q2. &lt;/P&gt;&lt;P&gt;Q2. Severity: 1/2/3/4/88/99&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to make a data set with no inappropriate missing data (where 'missing'=./don't know/refused). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far, I have been able to subset my data for Q1: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data newdata; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set olddata; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if cmiss (of var1 var2 var3 var4 var5) then delete; &lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked well and the expected number of observations were removed. However, I am unsure of how to move forward. If I ask SAS to remove the missing observations from Q2, then all those that answered N(2) to Q1 (and therefore, have appropriately missing data in Q2) would be removed. I only want to remove those individuals who answered Y(1) to Q1 and subsequently have missing data for Q2 (Q2 is conditioned on Q1). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any direction would be appreciated. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 20:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Subsetting-data/m-p/143062#M38057</guid>
      <dc:creator>toneill</dc:creator>
      <dc:date>2014-07-30T20:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Subsetting-data/m-p/143063#M38058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set newdata;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if q1=1 and q2 in (88,99) then delete;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 20:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Subsetting-data/m-p/143063#M38058</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-07-30T20:13:07Z</dc:date>
    </item>
  </channel>
</rss>

