<?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 other than proc ttest is there a way to apply two sample two sided t-test in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/other-than-proc-ttest-is-there-a-way-to-apply-two-sample-two/m-p/663397#M198025</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;my enterprise guide do not have sas/stat licence so proc ttest is not working, is there another procedure for two sample t-test. You can give the codes from testscores data. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way it is very annoying that one programme has many packages, we are trying to learn a programme here, everytime another obstacle comes along.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jun 2020 06:49:01 GMT</pubDate>
    <dc:creator>chinaski</dc:creator>
    <dc:date>2020-06-19T06:49:01Z</dc:date>
    <item>
      <title>other than proc ttest is there a way to apply two sample two sided t-test</title>
      <link>https://communities.sas.com/t5/SAS-Programming/other-than-proc-ttest-is-there-a-way-to-apply-two-sample-two/m-p/663397#M198025</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;my enterprise guide do not have sas/stat licence so proc ttest is not working, is there another procedure for two sample t-test. You can give the codes from testscores data. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way it is very annoying that one programme has many packages, we are trying to learn a programme here, everytime another obstacle comes along.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2020 06:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/other-than-proc-ttest-is-there-a-way-to-apply-two-sample-two/m-p/663397#M198025</guid>
      <dc:creator>chinaski</dc:creator>
      <dc:date>2020-06-19T06:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: other than proc ttest is there a way to apply two sample two sided t-test</title>
      <link>https://communities.sas.com/t5/SAS-Programming/other-than-proc-ttest-is-there-a-way-to-apply-two-sample-two/m-p/663407#M198029</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/135895"&gt;@chinaski&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/en_us/software/university-edition.html" target="_blank" rel="noopener"&gt;SAS University Edition&lt;/A&gt; includes SAS/STAT among other modules, so this would be a great option for learning purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, the two-sample t-test is simple enough to implement the formulas found in the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_ttest_details14.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;&amp;nbsp;in SAS/Base code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example including mean difference, pooled standard error, t-statistic and two-sided p-value:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class nway;
class sex;
var height;
output out=stats n=n mean=m std=s;
run;

data want(keep=d se t p);
set stats;
if _n_=1 then do; m1+m; n1+n; s1+s; end;
else do;
  d=m1-m;
  se=sqrt(((n1-1)*s1**2+(n-1)*s**2)/(n1+n-2)*(1/n1+1/n));
  t=d/se;
  p=1-probf(t**2,1,n1+n-2);
  output;
end;
format p pvalue.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;    d          se          t         p

-3.32111    2.28628    -1.45263    0.1645&lt;/PRE&gt;
&lt;P&gt;For comparison:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc ttest data=sashelp.class;
class sex;
var height;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Partial output (relevant numbers highlighted):&lt;/P&gt;
&lt;PRE&gt;The TTEST Procedure

Variable:  Height

Sex           Method             N        Mean     Std Dev     Std Err     Minimum     Maximum

F                                9     60.5889      5.0183      1.6728     51.3000     66.5000
M                               10     63.9100      4.9379      1.5615     57.3000     72.0000
Diff (1-2)    Pooled                   &lt;STRONG&gt;&lt;FONT color="#00CCFF"&gt;-3.3211&lt;/FONT&gt;&lt;/STRONG&gt;      4.9759      &lt;STRONG&gt;&lt;FONT color="#00CCFF"&gt;2.2863&lt;/FONT&gt;&lt;/STRONG&gt;
Diff (1-2)    Satterthwaite            -3.3211                  2.2883

Sex           Method               Mean       95% CL Mean        Std Dev      95% CL Std Dev

F                               60.5889     56.7315  64.4463      5.0183      3.3897   9.6140
M                               63.9100     60.3776  67.4424      4.9379      3.3965   9.0147
Diff (1-2)    Pooled            -3.3211     -8.1447   1.5025      4.9759      3.7339   7.4596
Diff (1-2)    Satterthwaite     -3.3211     -8.1551   1.5129

Method           Variances        DF    t Value    Pr &amp;gt; |t|

Pooled           Equal            17      &lt;STRONG&gt;&lt;FONT color="#00CCFF"&gt;-1.45&lt;/FONT&gt;      &lt;FONT color="#00CCFF"&gt;0.1645&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Jun 2020 08:48:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/other-than-proc-ttest-is-there-a-way-to-apply-two-sample-two/m-p/663407#M198029</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-06-19T08:48:36Z</dc:date>
    </item>
  </channel>
</rss>

