<?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: The Single-Factor Within-Subjects Design in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/The-Single-Factor-Within-Subjects-Design/m-p/151035#M7946</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With two time points, and no other factors, either random or fixed, un and ar(1) will give the same results.&amp;nbsp; Note that the entries in the matrix may not be the same, but the two matrices are congruent (I think that is the correct word for matrices that are the same except for a scalar factor).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Mar 2014 17:01:25 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2014-03-21T17:01:25Z</dc:date>
    <item>
      <title>The Single-Factor Within-Subjects Design</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-Single-Factor-Within-Subjects-Design/m-p/151032#M7943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am analyzing a single factor within subject design dataset where&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. subjects were measured at baseline and follow-up (2 time points only). Here is a small subset of the data, where test is 1=baseline and 2=follow-up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data within_subject;&lt;/P&gt;&lt;P&gt;input id test outcome;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 1 3&lt;/P&gt;&lt;P&gt;1 2 2&lt;/P&gt;&lt;P&gt;2 1 4&lt;/P&gt;&lt;P&gt;2 2 3&lt;/P&gt;&lt;P&gt;3 1 9&lt;/P&gt;&lt;P&gt;3 2 7&lt;/P&gt;&lt;P&gt;4 1 4&lt;/P&gt;&lt;P&gt;4 2 2&lt;/P&gt;&lt;P&gt;5 1 1&lt;/P&gt;&lt;P&gt;5 2 0.5&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used proc mixed to test for baseline to post difference (syntax show below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc mixed data=within_subject;&lt;/P&gt;&lt;P&gt;class test;&lt;/P&gt;&lt;P&gt;model outcome=test;&lt;/P&gt;&lt;P&gt;repeated /subject=id type=ar(1);&lt;/P&gt;&lt;P&gt;lsmeans test;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this data has only 2 time points, my understanding is that I will get the same result by using a paired t-test. Of course for paired t-test I will need to structure my data as a wide datafile instead of a person-time datafile as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data t_test;&lt;/P&gt;&lt;P&gt;input id test1 test2;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 3 2 &lt;/P&gt;&lt;P&gt;2 4 3&lt;/P&gt;&lt;P&gt;3 9 7&lt;/P&gt;&lt;P&gt;4 4 2&lt;/P&gt;&lt;P&gt;5 1 0.5&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The paired t-test code is shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc ttest data=t_test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; paired test1*test2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got the same result using both codes but just wanted to confirm with the SAS experts that both approach have the same correlation structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pronabesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2014 20:26:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-Single-Factor-Within-Subjects-Design/m-p/151032#M7943</guid>
      <dc:creator>pronabesh</dc:creator>
      <dc:date>2014-03-20T20:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: The Single-Factor Within-Subjects Design</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-Single-Factor-Within-Subjects-Design/m-p/151033#M7944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you should get the same.&amp;nbsp; You could use type=un in proc mixed if you want unequal variances and a covariance for the pre and post.&amp;nbsp; It doesn't matter in proc ttest, as the variable that is actually fit is the difference, and the assumptions all fall on the difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Mar 2014 13:35:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-Single-Factor-Within-Subjects-Design/m-p/151033#M7944</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-03-21T13:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: The Single-Factor Within-Subjects Design</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-Single-Factor-Within-Subjects-Design/m-p/151034#M7945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for confirming that Steve. I got the same results using unstructured and first order auto-regressive. Is it correct to assume that with 2 time points ar(1) has the same correlation structure as un?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As always, that you so much for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pronabesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Mar 2014 15:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-Single-Factor-Within-Subjects-Design/m-p/151034#M7945</guid>
      <dc:creator>pronabesh</dc:creator>
      <dc:date>2014-03-21T15:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: The Single-Factor Within-Subjects Design</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-Single-Factor-Within-Subjects-Design/m-p/151035#M7946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With two time points, and no other factors, either random or fixed, un and ar(1) will give the same results.&amp;nbsp; Note that the entries in the matrix may not be the same, but the two matrices are congruent (I think that is the correct word for matrices that are the same except for a scalar factor).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Mar 2014 17:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-Single-Factor-Within-Subjects-Design/m-p/151035#M7946</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-03-21T17:01:25Z</dc:date>
    </item>
  </channel>
</rss>

