<?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 How to compare the characteristics of participants included and exclude in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-the-characteristics-of-participants-included-and/m-p/866661#M342272</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this message finds you well. I am trying to&amp;nbsp;the characteristics of the participants included and exclude. Here are my inclusion criteria. How could I get the dataset that I excluded? Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data elsa02;&lt;BR /&gt;set elsa01;&lt;/P&gt;
&lt;P&gt;if age1&amp;lt;50 or age2&amp;lt;50 then delete;&lt;/P&gt;
&lt;P&gt;if sight_persist=. then delete;&lt;BR /&gt;if hear_persist=. then delete;&lt;/P&gt;
&lt;P&gt;if (cesd1&amp;gt;=0 or cesd2&amp;gt;=0);&lt;BR /&gt;if missing(cesd1) then cesd1=cesd2;&lt;BR /&gt;if missing(cesd2) then cesd2=cesd1;&lt;/P&gt;
&lt;P&gt;if cesd3=. and cesd4=. and cesd5=. and cesd6=. and cesd7=. and cesd8=. and cesd9=. then delete;&lt;BR /&gt;if n(of cesd3-cesd9)&amp;lt;2 then delete;&lt;/P&gt;
&lt;P&gt;if (cesd1&amp;gt;=3 or cesd2&amp;gt;=3) then delete;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 01:59:09 GMT</pubDate>
    <dc:creator>nwang5</dc:creator>
    <dc:date>2023-03-28T01:59:09Z</dc:date>
    <item>
      <title>How to compare the characteristics of participants included and exclude</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-the-characteristics-of-participants-included-and/m-p/866661#M342272</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this message finds you well. I am trying to&amp;nbsp;the characteristics of the participants included and exclude. Here are my inclusion criteria. How could I get the dataset that I excluded? Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data elsa02;&lt;BR /&gt;set elsa01;&lt;/P&gt;
&lt;P&gt;if age1&amp;lt;50 or age2&amp;lt;50 then delete;&lt;/P&gt;
&lt;P&gt;if sight_persist=. then delete;&lt;BR /&gt;if hear_persist=. then delete;&lt;/P&gt;
&lt;P&gt;if (cesd1&amp;gt;=0 or cesd2&amp;gt;=0);&lt;BR /&gt;if missing(cesd1) then cesd1=cesd2;&lt;BR /&gt;if missing(cesd2) then cesd2=cesd1;&lt;/P&gt;
&lt;P&gt;if cesd3=. and cesd4=. and cesd5=. and cesd6=. and cesd7=. and cesd8=. and cesd9=. then delete;&lt;BR /&gt;if n(of cesd3-cesd9)&amp;lt;2 then delete;&lt;/P&gt;
&lt;P&gt;if (cesd1&amp;gt;=3 or cesd2&amp;gt;=3) then delete;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 01:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-the-characteristics-of-participants-included-and/m-p/866661#M342272</guid>
      <dc:creator>nwang5</dc:creator>
      <dc:date>2023-03-28T01:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare the characteristics of participants included and exclude</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-the-characteristics-of-participants-included-and/m-p/866683#M342281</link>
      <description>&lt;P&gt;Haven't tried this, but for each DELETE, add en explicit output:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;then do;
   output excluded;
   delete;
end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Another option could be to join elsa01 with elsa02 using a NOT IN( ) condition.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 07:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-the-characteristics-of-participants-included-and/m-p/866683#M342281</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-03-28T07:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare the characteristics of participants included and exclude</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-the-characteristics-of-participants-included-and/m-p/866684#M342282</link>
      <description>&lt;P&gt;I think your program can be rewritten as (not tested):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data elsa02 excluded;
set elsa01;

if age1&amp;lt;50 or age2&amp;lt;50 or 
   sight_persist=. or
   hear_persist=. or
   not (cesd1&amp;gt;=0 or cesd2&amp;gt;=0) or
   n(of cesd3-cesd9)&amp;lt;2 or
   (cesd1&amp;gt;=3 or cesd2&amp;gt;=3) then 
  output excluded;
else do;
  if missing(cesd1) then cesd1=cesd2;
  if missing(cesd2) then cesd2=cesd1;
  output elsa02;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Explanation: I changed the subsetting IF to a condition preceded by NOT: "not (cesd1&amp;gt;=0 or cesd2&amp;gt;=0)&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The line&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if cesd3=. and cesd4=. and cesd5=. and cesd6=. and cesd7=. and cesd8=. and cesd9=. then delete;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is not necessary, as it is covered by the "&lt;SPAN&gt;n(of cesd3-cesd9)&amp;lt;2" condition.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 07:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-the-characteristics-of-participants-included-and/m-p/866684#M342282</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2023-03-28T07:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare the characteristics of participants included and exclude</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-the-characteristics-of-participants-included-and/m-p/866686#M342283</link>
      <description>&lt;P&gt;Combine your conditions into a single IF:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data
  elsa02
  excluded
;
set elsa01;
if
  (cesd1 &amp;lt; 0 and cesd2 &amp;lt; 0)
  or age1 &amp;lt; 50 or age2 &amp;lt; 50
  or sight_persist = . or hear_persist = .
  or n(of cesd3-cesd9) &amp;lt; 2
  or cesd1 &amp;gt;= 3 or cesd2 &amp;gt;= 3
then output exclude;
else do;
  if missing(cesd1) then cesd1 = cesd2;
  if missing(cesd2) then cesd2 = cesd1;
  output elsa02;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Mar 2023 07:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-the-characteristics-of-participants-included-and/m-p/866686#M342283</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-28T07:57:40Z</dc:date>
    </item>
  </channel>
</rss>

