<?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: How do I delete a certain observation? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499290#M132837</link>
    <description>&lt;P&gt;Are you looking for this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIBNAME perm 'D:\';&lt;BR /&gt;DATA Newsasdata (keep= Alchrc10 Alchrc9 cbrchyr chlev copdev ephev R_Maritl Age_p MracbpI2 sex hypev);&lt;BR /&gt;SET perm.nhis2012sampleadult;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;where copdev not in (7,9);&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Sep 2018 22:01:36 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-09-26T22:01:36Z</dc:date>
    <item>
      <title>How do I delete a certain observation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499285#M132833</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please view my output. I want to make my data-set to have only observations that responded yes (1) and No (2) based on COPD . And to delete the observations coded 7 and 9. Here's my code so far&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LIBNAME perm 'D:\';&lt;BR /&gt;DATA Newsasdata (keep= Alchrc10 Alchrc9 cbrchyr chlev copdev ephev R_Maritl Age_p MracbpI2 sex hypev);&lt;BR /&gt;SET perm.nhis2012sampleadult;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&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;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="COPD.PNG" style="width: 467px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23585iAB7E7B8254849EEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="COPD.PNG" alt="COPD.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 21:52:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499285#M132833</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2018-09-26T21:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a certain observation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499286#M132834</link>
      <description>&lt;P&gt;Post the sample of your dataset plz&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 21:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499286#M132834</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-26T21:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a certain observation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499289#M132836</link>
      <description>&lt;P&gt;I've posted the output and the code. I want to delete the observations that answered 7 and 9 from my entire dataset&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 21:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499289#M132836</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2018-09-26T21:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a certain observation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499290#M132837</link>
      <description>&lt;P&gt;Are you looking for this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIBNAME perm 'D:\';&lt;BR /&gt;DATA Newsasdata (keep= Alchrc10 Alchrc9 cbrchyr chlev copdev ephev R_Maritl Age_p MracbpI2 sex hypev);&lt;BR /&gt;SET perm.nhis2012sampleadult;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;where copdev not in (7,9);&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 22:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499290#M132837</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-26T22:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a certain observation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499294#M132839</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/236266"&gt;@ChuksManuel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please view my output. I want to make my data-set to have only observations that responded yes (1) and No (2) based on COPD . And to delete the observations coded 7 and 9. Here's my code so far&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIBNAME perm 'D:\';&lt;BR /&gt;DATA Newsasdata (keep= Alchrc10 Alchrc9 cbrchyr chlev copdev ephev R_Maritl Age_p MracbpI2 sex hypev);&lt;BR /&gt;SET perm.nhis2012sampleadult;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You may want to consider creating a new recoded variable with code similar to :&lt;/P&gt;
&lt;PRE&gt;data recode;
   set have;
   copd_recode = copd;
   if copd in (7,9) then call missing(copd_recode);
run;&lt;/PRE&gt;
&lt;P&gt;And use the recoded variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One reason is suppose you also want to see frequencies of another variable. If you actually remove the records then the counts for the other variables would be affected. By creating another variable with missing then the proc freq (or other procedures) will have the correct number of observations to use with the other variables. If you do something like copd_recode*sex with the recoded variable then their will be indications of missing values but the counts and percentages within the categories would be represented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if that data comes from BRFSS then I have seen &lt;STRONG&gt;lots&lt;/STRONG&gt; of recodes like that.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 22:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-delete-a-certain-observation/m-p/499294#M132839</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-26T22:11:44Z</dc:date>
    </item>
  </channel>
</rss>

