<?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 to test the difference between two results are different from zero in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534205#M146540</link>
    <description>&lt;P&gt;Change your data organisation to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;group value&lt;/P&gt;
&lt;P&gt;a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&lt;/P&gt;
&lt;P&gt;... etc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and call &lt;STRONG&gt;proc ttest&lt;/STRONG&gt; with &lt;EM&gt;group&lt;/EM&gt; as the class variable and &lt;EM&gt;value&lt;/EM&gt; as the var variable.&lt;/P&gt;</description>
    <pubDate>Sat, 09 Feb 2019 23:45:19 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2019-02-09T23:45:19Z</dc:date>
    <item>
      <title>How to test the difference between two results are different from zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534203#M146538</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two columns of observations, and the numbers of observations are different, what I want to do is to test whether the difference between their average value are different from zero, (using t test) how could i do it?&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; b&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&amp;nbsp;&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;/P&gt;&lt;P&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/P&gt;&lt;P&gt;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;15&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 23:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534203#M146538</guid>
      <dc:creator>Songchan</dc:creator>
      <dc:date>2019-02-09T23:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to test the difference between two results are different from zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534205#M146540</link>
      <description>&lt;P&gt;Change your data organisation to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;group value&lt;/P&gt;
&lt;P&gt;a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&lt;/P&gt;
&lt;P&gt;... etc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and call &lt;STRONG&gt;proc ttest&lt;/STRONG&gt; with &lt;EM&gt;group&lt;/EM&gt; as the class variable and &lt;EM&gt;value&lt;/EM&gt; as the var variable.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 23:45:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534205#M146540</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-02-09T23:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to test the difference between two results are different from zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534210#M146544</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cc01a; set temp03; keep wml; run;
data cc01b; set btemp03; keep wml1;run;
data cc01; merge cc01a cc01b; run;
data cc02; set cc01;
     diff_wml=wml-wml1;
run;

proc means data=cc02 n mean t probt;
     var diff_wml;
	 output out=cc03 n=size mean=m t=tval probt=pvalue;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I did in this way, but the final result for diff_wml was different from the difference between (average wml - average wml1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Songchan&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 00:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534210#M146544</guid>
      <dc:creator>Songchan</dc:creator>
      <dc:date>2019-02-10T00:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to test the difference between two results are different from zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534211#M146545</link>
      <description>&lt;P&gt;As stated by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt; , you need to re-organize the data as he suggested and then use PROC TTEST.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC MEANS will not produce the result you want in this case.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 00:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534211#M146545</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-10T00:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to test the difference between two results are different from zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534212#M146546</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply. But how could I reorganize the data in that way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SC.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 00:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534212#M146546</guid>
      <dc:creator>Songchan</dc:creator>
      <dc:date>2019-02-10T00:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to test the difference between two results are different from zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534220#M146551</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/230936"&gt;@Songchan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Exactly as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;proposes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input a b;
  datalines;
1 3
2 7 
;
run;

data reorg(keep=group value);
  set have;
  group='a';
  value=a;
  output;
  group='b';
  value=b;
  output;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Feb 2019 00:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534220#M146551</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-02-10T00:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to test the difference between two results are different from zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534225#M146556</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have a lot of observations in each column, what I need to do?&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 00:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534225#M146556</guid>
      <dc:creator>Songchan</dc:creator>
      <dc:date>2019-02-10T00:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to test the difference between two results are different from zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534229#M146560</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/230936"&gt;@Songchan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;what I need to do&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;You need to post representative sample data so we can understand what you're dealing with.&lt;/P&gt;
&lt;P&gt;Post sample data in the form of a "data have" step as I've done and then show us how the desired result should look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"&lt;EM&gt;If I have a lot of observations in each column&lt;/EM&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A table has rows (observations) and columns (variables). For this reason your statement doesn't make sense.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 00:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534229#M146560</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-02-10T00:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to test the difference between two results are different from zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534234#M146562</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is what my data looks like, i need to test whether (average wml - average wml1) is different from zero.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 00:59:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534234#M146562</guid>
      <dc:creator>Songchan</dc:creator>
      <dc:date>2019-02-10T00:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to test the difference between two results are different from zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534249#M146573</link>
      <description>&lt;P&gt;You need to append your datasets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This assumes your input data set name is HAVE, and your variable names are Var1, var2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to add parenthesis to the Keep variable list.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want;
Set have (in=a keep=var1)
      Have (in=b drop=var1 rename=var2=var1);

If a then group=‘A’;
Else group=‘B’;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/230936"&gt;@Songchan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this is what my data looks like, i need to test whether (average wml - average wml1) is different from zero.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 03:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-test-the-difference-between-two-results-are-different/m-p/534249#M146573</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-10T03:17:31Z</dc:date>
    </item>
  </channel>
</rss>

