<?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: paired t-test for a group of variables in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/paired-t-test-for-a-group-of-variables/m-p/273139#M14388</link>
    <description>&lt;P&gt;Thank you, Rick!&lt;/P&gt;</description>
    <pubDate>Wed, 25 May 2016 21:00:06 GMT</pubDate>
    <dc:creator>fengyuwuzu</dc:creator>
    <dc:date>2016-05-25T21:00:06Z</dc:date>
    <item>
      <title>paired t-test for a group of variables</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/paired-t-test-for-a-group-of-variables/m-p/273126#M14385</link>
      <description>&lt;P&gt;I have data in the following structure:&lt;/P&gt;
&lt;P&gt;ID var1 var2 var3 when&lt;/P&gt;
&lt;P&gt;1 10 15 20 After&lt;/P&gt;
&lt;P&gt;1 9 14 18 Before&lt;/P&gt;
&lt;P&gt;2 12 17 21 After&lt;/P&gt;
&lt;P&gt;2 11 17 20 Before&lt;/P&gt;
&lt;P&gt;3 10 16 23 After&lt;/P&gt;
&lt;P&gt;3 11 15 22 Before&lt;/P&gt;
&lt;P&gt;4 8 18 24 After&lt;/P&gt;
&lt;P&gt;4 9 17 23 Before&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;If I want to do a paired t-test for each variable, it seems I need to create 3 datasets, one for each variable.&lt;/P&gt;
&lt;P&gt;Is there simpler way to do it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 20:16:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/paired-t-test-for-a-group-of-variables/m-p/273126#M14385</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2016-05-25T20:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: paired t-test for a group of variables</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/paired-t-test-for-a-group-of-variables/m-p/273130#M14386</link>
      <description>&lt;P&gt;You would need to create one data set with the structure of:&lt;/P&gt;
&lt;P&gt;Id BeforeVar1 AfterVar1 BeforeVar2 AfterVar2 BeforeVar3 AfterVar3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then the syntax would be:&lt;/P&gt;
&lt;P&gt;Proc ttest data=have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Paired BeforeVar1 * AfterVar1&amp;nbsp; &amp;nbsp; BeforeVar2 * AfterVar2 &amp;nbsp; BeforeVar3 * AfterVar3;&lt;/P&gt;
&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 20:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/paired-t-test-for-a-group-of-variables/m-p/273130#M14386</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-25T20:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: paired t-test for a group of variables</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/paired-t-test-for-a-group-of-variables/m-p/273131#M14387</link>
      <description>&lt;P&gt;I think the simpler way to to combine each pair of rows. Basically moving from a "long form" of data that hass 3 measurements to a "wide form" that has 6 measurements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you strategically name the "before"&amp;nbsp; and "after" variables, you can run all three analyses with a single PROC TTEST call:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have2;
input ID 
      after_var1  after_var2 after_var3
      before_var1 before_var2 before_var3;
datalines;
1 10 15 20 9 14 18
2 12 17 21 11 17 20
3 10 16 23 11 15 22
4 8 18 24  9 17 23 
;

proc ttest data=have2;
paired (after:):(before:);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 May 2016 20:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/paired-t-test-for-a-group-of-variables/m-p/273131#M14387</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-05-25T20:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: paired t-test for a group of variables</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/paired-t-test-for-a-group-of-variables/m-p/273139#M14388</link>
      <description>&lt;P&gt;Thank you, Rick!&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 21:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/paired-t-test-for-a-group-of-variables/m-p/273139#M14388</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2016-05-25T21:00:06Z</dc:date>
    </item>
  </channel>
</rss>

