<?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: Can't Figure Out Repeated Measures ANOVA Syntax in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34074#M8272</link>
    <description>Hi Bob,&lt;BR /&gt;
&lt;BR /&gt;
In your design, are Base, T1-T4 the same time points for treatments A, B, and Sham? Or the times are treatment specific (15 different time points): &lt;BR /&gt;
&lt;BR /&gt;
Base_a&lt;BR /&gt;
Base_b&lt;BR /&gt;
Base_sham&lt;BR /&gt;
T1_a&lt;BR /&gt;
T1_b&lt;BR /&gt;
T1_sham&lt;BR /&gt;
T2_a&lt;BR /&gt;
T2_b&lt;BR /&gt;
T2_sham&lt;BR /&gt;
...

Message was edited by: statsplank</description>
    <pubDate>Mon, 21 Mar 2011 02:53:19 GMT</pubDate>
    <dc:creator>statsplank</dc:creator>
    <dc:date>2011-03-21T02:53:19Z</dc:date>
    <item>
      <title>Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34069#M8267</link>
      <description>Hi SAS Community!&lt;BR /&gt;
&lt;BR /&gt;
I have done a fair bit of macro programming with SAS and lots of straight-forward analyses, but nothing complex and now I am a overwhelmed. Perhaps you can help? I have an experimental design:&lt;BR /&gt;
&lt;BR /&gt;
* Treatments: A, B, Sham &lt;BR /&gt;
* Parameters: just one&lt;BR /&gt;
* Measurements: baseline, T1 - T4 &lt;BR /&gt;
&lt;BR /&gt;
-&amp;gt; so one parameter measured before and then four times after each intervention&lt;BR /&gt;
&lt;BR /&gt;
Each subject was exposed to all three treatments (different days) so the treatments and the measurements are repeated. (If that's the correct way to say it).&lt;BR /&gt;
&lt;BR /&gt;
I want to know whether treatment modulates the parameter and how it relates to time, so I thought a two-way repeated measures ANOVA would do be a nice start, followed by Tukey post-hoc test to see if A and B are dif from each other, or just sham. I suppose I could use Dennet post hoc test instead since sham is involved.&lt;BR /&gt;
&lt;BR /&gt;
I may also want to do a separate model with an interaction term. &lt;BR /&gt;
&lt;BR /&gt;
What would be the complete SAS syntax for this? I can structure the data as needed (e.g. wide or stacked) but right now I have it like this:&lt;BR /&gt;
&lt;BR /&gt;
SubjectID Intervention Timepoint Value&lt;BR /&gt;
===============================&lt;BR /&gt;
1             A                Base         8&lt;BR /&gt;
1             A                T1             19&lt;BR /&gt;
1             A                T2             12&lt;BR /&gt;
1             A                T3             19&lt;BR /&gt;
1             A                T4             13&lt;BR /&gt;
1             B                Base         13&lt;BR /&gt;
1             B                T1             19&lt;BR /&gt;
1             B                T2             11&lt;BR /&gt;
1             B                T3             10&lt;BR /&gt;
1             B                T4              9&lt;BR /&gt;
1             Sham         Base           2    &lt;BR /&gt;
1             Sham         T1 3&lt;BR /&gt;
1             Sham         T2 5&lt;BR /&gt;
1             Sham         T3 3 &lt;BR /&gt;
1             Sham         T4 4&lt;BR /&gt;
2             A               Base&lt;BR /&gt;
...&lt;BR /&gt;
etc.&lt;BR /&gt;
&lt;BR /&gt;
I was thinking something like&lt;BR /&gt;
&lt;BR /&gt;
proc glm&lt;BR /&gt;
     class intervention timepoint;&lt;BR /&gt;
     model value = intervention timepoint;&lt;BR /&gt;
     means group / cldiff tukey;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
But this is not repeated measures. And I don't even know if this is right. Can you please advise? I can restructure the data however needed, the main thing is I need to do two-way repeated measure anova on the given experiment design. &lt;BR /&gt;
Thanks!&lt;BR /&gt;
-Bob

Message was edited by: Bob291032</description>
      <pubDate>Sat, 19 Mar 2011 23:19:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34069#M8267</guid>
      <dc:creator>Bob291032</dc:creator>
      <dc:date>2011-03-19T23:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34070#M8268</link>
      <description>This page is helpful and should answer your questions, but your code is missing a REPEATED statement:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glm_sect036.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glm_sect036.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Mark</description>
      <pubDate>Sun, 20 Mar 2011 14:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34070#M8268</guid>
      <dc:creator>mfisher</dc:creator>
      <dc:date>2011-03-20T14:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34071#M8269</link>
      <description>Thank you for replying, but that doesn't really address my questions:&lt;BR /&gt;
&lt;BR /&gt;
What do you think about using a two-way repeated measures ANOVA for the scenario I outlined? I had heard some discussion of using mixed effects models but it was over my head. &lt;BR /&gt;
&lt;BR /&gt;
What is the syntax for a two-way repeated measures ANOVA? I've ran the code for one-way but I am confused how to to two way. For instance, do I want something like:&lt;BR /&gt;
&lt;BR /&gt;
Base T1 T2 T3 T4 = intervention&lt;BR /&gt;
&lt;BR /&gt;
OR &lt;BR /&gt;
&lt;BR /&gt;
Value = intervention time&lt;BR /&gt;
&lt;BR /&gt;
Thanks.&lt;BR /&gt;
-Bob</description>
      <pubDate>Sun, 20 Mar 2011 17:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34071#M8269</guid>
      <dc:creator>Bob291032</dc:creator>
      <dc:date>2011-03-20T17:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34072#M8270</link>
      <description>The topic of repeated measures is large and complex, and I don't think the discussion forum can really address all the issues that you need to consider (since you admit that you don't know too much about the subject). The approach to repeated measures in GLM is very different from the mixed-model approach (such as in MIXED or GLIMMIX, or even GENMOD). I recommend you read:&lt;BR /&gt;
&lt;A href="http://www.ats.ucla.edu/stat/sas/library/mixedglm.pdf" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/library/mixedglm.pdf&lt;/A&gt;&lt;BR /&gt;
by Russ Wolfinger and co-author. It is now somewhat out of date (lots of new features in MIXED, etc.), but this may get you started.</description>
      <pubDate>Sun, 20 Mar 2011 18:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34072#M8270</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2011-03-20T18:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34073#M8271</link>
      <description>Thanks, LVM. Furtonately, I am working with a post-doc who has deeper understanding of the statistics, I am just doing the programming in SAS and she can help me interpret it all. But you're right, I should narrow this down: what is the syntax for a standard two-way repeated measures ANOVA given the vars named above?</description>
      <pubDate>Sun, 20 Mar 2011 18:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34073#M8271</guid>
      <dc:creator>Bob291032</dc:creator>
      <dc:date>2011-03-20T18:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34074#M8272</link>
      <description>Hi Bob,&lt;BR /&gt;
&lt;BR /&gt;
In your design, are Base, T1-T4 the same time points for treatments A, B, and Sham? Or the times are treatment specific (15 different time points): &lt;BR /&gt;
&lt;BR /&gt;
Base_a&lt;BR /&gt;
Base_b&lt;BR /&gt;
Base_sham&lt;BR /&gt;
T1_a&lt;BR /&gt;
T1_b&lt;BR /&gt;
T1_sham&lt;BR /&gt;
T2_a&lt;BR /&gt;
T2_b&lt;BR /&gt;
T2_sham&lt;BR /&gt;
...

Message was edited by: statsplank</description>
      <pubDate>Mon, 21 Mar 2011 02:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34074#M8272</guid>
      <dc:creator>statsplank</dc:creator>
      <dc:date>2011-03-21T02:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34075#M8273</link>
      <description>Hi statsplank, &lt;BR /&gt;
&lt;BR /&gt;
Subjects were brought back three separate days, each day receiving a different treatment and having each day their measurements were taken at baseline, t1-t4. So I think the answer to your question is 'yes'. Every subject has five measures for treatment a on day 1, five for treatment b on day 2,and five on day3 for sham. Thank you for helping me!&lt;BR /&gt;
&lt;BR /&gt;
-Bob</description>
      <pubDate>Mon, 21 Mar 2011 06:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34075#M8273</guid>
      <dc:creator>Bob291032</dc:creator>
      <dc:date>2011-03-21T06:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34076#M8274</link>
      <description>The article I mentioned gives all the coding for repeated measures using GLM or MIXED.</description>
      <pubDate>Mon, 21 Mar 2011 12:36:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34076#M8274</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2011-03-21T12:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34077#M8275</link>
      <description>EDIT: Missed the PDF, though it was the SAS doc. I will review the PDF and post back.</description>
      <pubDate>Mon, 21 Mar 2011 14:54:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34077#M8275</guid>
      <dc:creator>Bob291032</dc:creator>
      <dc:date>2011-03-21T14:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34078#M8276</link>
      <description>So I read the paper and was able to generate repeated measures anova using the following code:&lt;BR /&gt;
&lt;BR /&gt;
title 'Treatment A v. Sham';&lt;BR /&gt;
proc glm data=expdata;&lt;BR /&gt;
	class intervention;&lt;BR /&gt;
	model base T1 T2 T3 T4  = intervention / nouni;&lt;BR /&gt;
	repeated timepoint 5;&lt;BR /&gt;
	where intervention IN ( 0 1 );&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I'm still playing with this, but now I feel like I am in the movie &lt;I&gt;Inception&lt;/I&gt;... We need to go deeper!  Next thing is to get tukey post-hoc tests to see which timepoints are significant compared to baseline.</description>
      <pubDate>Wed, 23 Mar 2011 04:04:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34078#M8276</guid>
      <dc:creator>Bob291032</dc:creator>
      <dc:date>2011-03-23T04:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34079#M8277</link>
      <description>Hi Bob,&lt;BR /&gt;
&lt;BR /&gt;
From your code I see you chose to do the multivariate analysis. I am not very familiar with proc glm usage for the repeated measurements analysis and was wondering how did you account for the fact that all treatments were tested on the same individual (individual is a blocking factor in your design). In proc mixed I would probably include random SubjectID; statement.</description>
      <pubDate>Wed, 23 Mar 2011 14:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34079#M8277</guid>
      <dc:creator>statsplank</dc:creator>
      <dc:date>2011-03-23T14:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34080#M8278</link>
      <description>Hi statsplank,&lt;BR /&gt;
&lt;BR /&gt;
Good question, can you demonstrate that with proc mixed code? One thing that concerned me with the proc glm was that the sphericity test was significant, indicating my data did not have type h variance-covariance matrix. Seeing how you would do this setup with proc mixed would be very helpful, thank you.&lt;BR /&gt;
&lt;BR /&gt;
-B.</description>
      <pubDate>Wed, 23 Mar 2011 17:22:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34080#M8278</guid>
      <dc:creator>Bob291032</dc:creator>
      <dc:date>2011-03-23T17:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34081#M8279</link>
      <description>I've also tried with PROC MIXED. I had to restructure the data into a long form (each row represents one measurement of one experiment i.e.&lt;BR /&gt;
&lt;BR /&gt;
subjectID | value | intervention | time&lt;BR /&gt;
==========================&lt;BR /&gt;
1 12 A Base&lt;BR /&gt;
1 10 A T1&lt;BR /&gt;
1 13 A T2&lt;BR /&gt;
...&lt;BR /&gt;
20 15 S T4&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;proc mixed;&lt;/B&gt;&lt;BR /&gt;
	class intervention time;&lt;BR /&gt;
	model value = time intervention time*intervention;&lt;BR /&gt;
	random int / subject = subjectID type=CS;&lt;BR /&gt;
&lt;BR /&gt;
	where ( intervention = 0 OR intervention = 1 );&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Does this properly take into consideration that the same subject is going through each intervention AND timepoint? i.e. is this an appropriate way to model the repeated-measures problem in the OP? Statsplank sounds like you think my previous proc GLM attempt was faulty.</description>
      <pubDate>Fri, 25 Mar 2011 19:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34081#M8279</guid>
      <dc:creator>Bob291032</dc:creator>
      <dc:date>2011-03-25T19:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34082#M8280</link>
      <description>Also, I may be doing something wrong with the ANOVA - it says that the intervention is not significant but the timepoint is!  I ran within-intervention paired t-tests comparing the measured value at any given timepoint v. baseline (i.e. what I would want a post-hoc test to do after anova) and I had the expected results: for each of my parameters, intervention A shows a significant change at each time point following baseline, intervention B and Sham do not (i.e. A has a significant effect). Obviously I can't just do 20+ paired t-tests without severe multiple testing type i errors but my point is that &lt;I&gt;all &lt;/I&gt; parameters are significantly changed from baseline in the same direction for &lt;I&gt;all&lt;/I&gt; time points for intervention A but not for sham or intervention B so a proper anova would have to show a significant treatment effect, yet I am not getting that. I am obviously doing something wrong with the repeated measures ANOVA. &lt;BR /&gt;
&lt;BR /&gt;
I could really use some expertise on the syntax of a repeated measures ANOVA (each subject repeated for each time point for each intervention) given my problem description.  Thanks!</description>
      <pubDate>Fri, 25 Mar 2011 20:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34082#M8280</guid>
      <dc:creator>Bob291032</dc:creator>
      <dc:date>2011-03-25T20:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Figure Out Repeated Measures ANOVA Syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34083#M8281</link>
      <description>Hi Bob,&lt;BR /&gt;
&lt;BR /&gt;
Given the "long" data set with one record per outcome value, I would try to run the proc mixed as follows:&lt;BR /&gt;
&lt;BR /&gt;
proc mixed;&lt;BR /&gt;
class intervention time;&lt;BR /&gt;
model value = time intervention time*intervention;&lt;BR /&gt;
repeated time / subject=subjectID type=AR(1);&lt;BR /&gt;
random int / subject=subjectID;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I put type=AR(1) since you have sequential time points. You may want to specify different covariance structure.</description>
      <pubDate>Mon, 28 Mar 2011 15:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-t-Figure-Out-Repeated-Measures-ANOVA-Syntax/m-p/34083#M8281</guid>
      <dc:creator>statsplank</dc:creator>
      <dc:date>2011-03-28T15:26:48Z</dc:date>
    </item>
  </channel>
</rss>

