<?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 Rerun T-test without an Observation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248595#M46705</link>
    <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running a t-test on a set of observations. There is one observation that is a massive outlier and I wanted to rerun the test without this observation. However, I don't want to go through the rigmarole of completely deleting the data point. Is there a way to get SAS to run the t-test without a certain observation?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
    <pubDate>Mon, 08 Feb 2016 00:32:22 GMT</pubDate>
    <dc:creator>RahulM</dc:creator>
    <dc:date>2016-02-08T00:32:22Z</dc:date>
    <item>
      <title>Rerun T-test without an Observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248595#M46705</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running a t-test on a set of observations. There is one observation that is a massive outlier and I wanted to rerun the test without this observation. However, I don't want to go through the rigmarole of completely deleting the data point. Is there a way to get SAS to run the t-test without a certain observation?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 00:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248595#M46705</guid>
      <dc:creator>RahulM</dc:creator>
      <dc:date>2016-02-08T00:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Rerun T-test without an Observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248596#M46706</link>
      <description>&lt;P&gt;If you have some way to uniquely identify the observation then yes, use a WHERE statement in your proc ttest.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typically a WHERE statement can be included in almost all Procs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Where obs_id = 10;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Feb 2016 00:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248596#M46706</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-08T00:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rerun T-test without an Observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248598#M46707</link>
      <description>&lt;P&gt;So do I include a statement after the WHERE statement to ask SAS to remove it from the analysis? Or do I simply include that in the proc and it will run without observation 10&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC TTEST data=ctpeat3;&lt;BR /&gt;CLASS CTPPP;&lt;BR /&gt;var eatv;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Reeza, you're a beast.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 00:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248598#M46707</guid>
      <dc:creator>RahulM</dc:creator>
      <dc:date>2016-02-08T00:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rerun T-test without an Observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248599#M46708</link>
      <description>&lt;P&gt;For anyone wondering, I just managed to do this by adding the following to my T-test procedure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WHERE pt_no NE 10;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 01:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248599#M46708</guid>
      <dc:creator>RahulM</dc:creator>
      <dc:date>2016-02-08T01:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Rerun T-test without an Observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248600#M46709</link>
      <description>&lt;P&gt;Do you observation IDs?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You our include the WHERE in your proc and it will automatically exclude it from analysis.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
PROC TTEST data=ctpeat3;
Where obs ne 10;;
CLASS CTPPP;
var eatv;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Feb 2016 01:07:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248600#M46709</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-08T01:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rerun T-test without an Observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248630#M46717</link>
      <description>&lt;P&gt;Hey Reeva,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you exclude multiple observations using this method? It seems where statements can't be combined with an OR statement, is that right?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 07:19:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248630#M46717</guid>
      <dc:creator>RahulM</dc:creator>
      <dc:date>2016-02-08T07:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rerun T-test without an Observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248724#M46735</link>
      <description>&lt;P&gt;If I may step in here, logical operators such as AND, OR, NOT&amp;nbsp;&lt;EM&gt;are&lt;/EM&gt; commonly used in WHERE statements. As always in programming, you have to use the correct syntax, though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: Let's say, you want to exclude a patient if they have patient number 10 or 13. In SAS, the OR operator &lt;EM&gt;must&lt;/EM&gt; &lt;EM&gt;not&lt;/EM&gt; be placed between the numbers 10 and 13 like it's possible in human language, but it must be placed between two expressions which evaluate as true or false:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where not (pt_no=10 or pt_no=13);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is logically equivalent to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where pt_no ne 10 and pt_no ne 13;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But typically, this would be written (again equivalently) using the IN operator:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where pt_no not in (10, 13);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or even shorter:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where pt_no ~in (10 13);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(The abbreviation of NOT as tilde (~) might not available on all keyboards, but you can use the caret (^) instead. The comma is optional in lists used with the IN operator. These lists may contain more than two values.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You wrote&amp;nbsp;that the observation&amp;nbsp;to be excluded was a "massive outlier." In this case it could be an alternative to replace the "hard-coded" condition on PT_NO by a condition on the measurement variable(s) which characterize the data point as an extreme outlier (e.g. &lt;FONT face="courier new,courier"&gt;where 10 &amp;lt;= bmi &amp;lt;= 60;&lt;/FONT&gt;).&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 20:12:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rerun-T-test-without-an-Observation/m-p/248724#M46735</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-08T20:12:22Z</dc:date>
    </item>
  </channel>
</rss>

