<?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: SAS code to exclude observations that are out of order in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-code-to-exclude-observations-that-are-out-of-order/m-p/893381#M44262</link>
    <description>&lt;P&gt;Please, I have a follow up question. What if I want only the order where the number 1 comes first i.e. 101010?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Sep 2023 19:58:31 GMT</pubDate>
    <dc:creator>UcheOkoro</dc:creator>
    <dc:date>2023-09-08T19:58:31Z</dc:date>
    <item>
      <title>SAS code to exclude observations that are out of order</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-code-to-exclude-observations-that-are-out-of-order/m-p/893373#M44259</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Please, I need help excluding observations from a variable that are out of order. For each ID, the order should be 010101 or 101010.&amp;nbsp; If the order is 001101, we exclude the repeated value, so it becomes 0101. The following is my sample data.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.CLASS(label='Student Data');
 input ID$3. Wgtloss;
 datalines;
222 0
222 1
222 1
222 0
222 0
222 0
223 1
223 1
223 1
223 0
223 0
223 1
224 1
224 1
224 0
224 1
224 0
224 0
 ;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Sep 2023 18:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-code-to-exclude-observations-that-are-out-of-order/m-p/893373#M44259</guid>
      <dc:creator>UcheOkoro</dc:creator>
      <dc:date>2023-09-08T18:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code to exclude observations that are out of order</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-code-to-exclude-observations-that-are-out-of-order/m-p/893377#M44260</link>
      <description>&lt;P&gt;Seems like a simple application of BY group processing.&amp;nbsp; Use the NOTSORTED keyword on the BY statement to form the groups.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 input ID :$3. Wgtloss;
datalines;
222 0
222 1
222 1
222 0
222 0
222 0
223 1
223 1
223 1
223 0
223 0
223 1
224 1
224 1
224 0
224 1
224 0
224 0
;

data want;
  set have;
  by id wgtloss notsorted ;
  if first.wgtloss;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;PRE&gt;Obs    ID     Wgtloss

  1    222       0
  2    222       1
  3    222       0
  4    223       1
  5    223       0
  6    223       1
  7    224       1
  8    224       0
  9    224       1
 10    224       0
&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Sep 2023 19:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-code-to-exclude-observations-that-are-out-of-order/m-p/893377#M44260</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-08T19:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code to exclude observations that are out of order</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-code-to-exclude-observations-that-are-out-of-order/m-p/893379#M44261</link>
      <description>&lt;P&gt;Thank you so much for your assistance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 19:41:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-code-to-exclude-observations-that-are-out-of-order/m-p/893379#M44261</guid>
      <dc:creator>UcheOkoro</dc:creator>
      <dc:date>2023-09-08T19:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code to exclude observations that are out of order</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-code-to-exclude-observations-that-are-out-of-order/m-p/893381#M44262</link>
      <description>&lt;P&gt;Please, I have a follow up question. What if I want only the order where the number 1 comes first i.e. 101010?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 19:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-code-to-exclude-observations-that-are-out-of-order/m-p/893381#M44262</guid>
      <dc:creator>UcheOkoro</dc:creator>
      <dc:date>2023-09-08T19:58:31Z</dc:date>
    </item>
  </channel>
</rss>

