<?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: Help with Proc Mixed Code in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Help-with-Proc-Mixed-Code/m-p/148078#M7810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would strongly consider going back to the model statement that I suggested, as it reflects the design of your study.&amp;nbsp; Eliminating terms because they aren't focal points of the study leads to mis-estimation of standard errors, and consequently faulty p-values when comparing means.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the random statment here estimates a variance component due to group.&amp;nbsp; The statement is exactly equivalent to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;random group;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the subject= syntax is more stable and faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it isn't surprising that adding it in affects the significance of the test.&amp;nbsp; Part of the reason is that with that in, you now have the correct error term for testing condition, where before it was being tested against the residual error.&amp;nbsp; The test against the residual is incorrect for your design. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax I gave you fits your design--give it a try.&amp;nbsp; I imagine that you will find significant interactions, which is where the richness of a split-plot is found.&amp;nbsp; If significant interactions are found, then simple effect (sliced) tests of condition can be set up at the various levels of role and period.&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, 31 Oct 2014 13:08:28 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2014-10-31T13:08:28Z</dc:date>
    <item>
      <title>Help with Proc Mixed Code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Help-with-Proc-Mixed-Code/m-p/148075#M7807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm hoping for some assistance with the coding of a hierarchical linear model with repeated measures.&amp;nbsp; I've written a code, but I'd like some verification that what I've done is proper for my data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data were collected as part of a decision making experiment.&amp;nbsp; Subjects played a game in groups of four, and each subject was assigned to a unique role within the group.&amp;nbsp; These roles are labeled r, w, d, and f.&amp;nbsp; Each period of the game, subjects placed orders to one another, (Order is the dependent variable in the model).&amp;nbsp; The lone factor of interest in the study is a treatment condition, (labeled Condition), which had two levels.&amp;nbsp; All subjects in a given group were given the same treatment (condition).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In short, I'm looking at the effect of Condition on Order, while controlling for the role each subject played within their group.&amp;nbsp; Subjects were nested within groups, and orders were recorded each period of the game, (repeated measurement).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code I developed is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;mixed&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;class &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;period condition r w d group;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;model &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;Order = condition r w d /&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;ddfm&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=satterh;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;repeated &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;period / &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;subject&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=participant(group);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;lsmeans &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;condition / pdiff;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;My concern is that perhaps I have not properly specified the model, particularly regarding the repeated measures and nested structure.&amp;nbsp; Any guidance would be greatly appreciated.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 19:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Help-with-Proc-Mixed-Code/m-p/148075#M7807</guid>
      <dc:creator>TravisTCU</dc:creator>
      <dc:date>2014-10-29T19:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Proc Mixed Code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Help-with-Proc-Mixed-Code/m-p/148076#M7808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am guessing that r, w and d are dummy variables reflecting role, and if all are zero then the role is f.&amp;nbsp; Much easier to have a class variable and let SAS do the heavy lifting.&amp;nbsp; Call this variable 'role'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then try:&lt;/P&gt;&lt;P&gt;proc mixed;&lt;/P&gt;&lt;P&gt;class period condition role group participant;&lt;/P&gt;&lt;P&gt;model order = period|condition|role /ddfm=kenwardrogers;&lt;/P&gt;&lt;P&gt;random intercept/subject=group;&lt;/P&gt;&lt;P&gt;repeated period/subject=participant(group) type=&amp;lt;I would put this in as AR(1), as I guess the periods are equally spaced in time&amp;gt;;&lt;/P&gt;&lt;P&gt;lsmeans condition/diff;&lt;/P&gt;&lt;P&gt;run;&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>Wed, 29 Oct 2014 19:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Help-with-Proc-Mixed-Code/m-p/148076#M7808</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-10-29T19:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Proc Mixed Code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Help-with-Proc-Mixed-Code/m-p/148077#M7809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for the quick and helpful response.&amp;nbsp; Your assumption about the dummy variables was correct; I've changed to using a single class variable labeled Role as you suggest.&amp;nbsp; Further, I've edited the model you created to exclude the fixed effect of period, as well as the interaction terms, as they are not focal points of this study.&amp;nbsp; All I'm truly interested in is the effect of Condition after controlling for Role, and accounting for the fact that repeated measures were taken, and subjects were nested in groups.&amp;nbsp; Thus, my revised model is structured as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;proc &lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;mixed&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;covtest&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;class &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;period condition role group participant;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;model &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;order = condition role /&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;ddfm&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=kenwardrogers;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;random &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;intercept/&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;subject&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=group;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;repeated &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;period/&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;subject&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=participant(group)&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;type&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=ar(&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;lsmeans &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;condition/diff;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="line-height: 107%; color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; line-height: 107%; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Ultimately, it appears as though the main difference between this model and my original model is the inclusion of the random intercept statement.&amp;nbsp; (You also specify the covariance structure as AR1 in the repeated statement).&amp;nbsp; Interestingly, this has a profound impact on the results.&amp;nbsp; Under the original model, Condition is statistically significant (p&amp;lt;0.001).&amp;nbsp; Under the revised model, it is not (p=0.179).&amp;nbsp; What does the addition of the random intercept statement do to the way in which the data are modeled as compared to the original model?&amp;nbsp; My assumption is that it allows for the estimation of separate intercepts for each group, but I'd like to understand more so as to determine why Condition is no longer significant.&amp;nbsp; Any insight you could provide would be most appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 01:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Help-with-Proc-Mixed-Code/m-p/148077#M7809</guid>
      <dc:creator>TravisTCU</dc:creator>
      <dc:date>2014-10-31T01:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Proc Mixed Code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Help-with-Proc-Mixed-Code/m-p/148078#M7810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would strongly consider going back to the model statement that I suggested, as it reflects the design of your study.&amp;nbsp; Eliminating terms because they aren't focal points of the study leads to mis-estimation of standard errors, and consequently faulty p-values when comparing means.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the random statment here estimates a variance component due to group.&amp;nbsp; The statement is exactly equivalent to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;random group;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the subject= syntax is more stable and faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it isn't surprising that adding it in affects the significance of the test.&amp;nbsp; Part of the reason is that with that in, you now have the correct error term for testing condition, where before it was being tested against the residual error.&amp;nbsp; The test against the residual is incorrect for your design. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax I gave you fits your design--give it a try.&amp;nbsp; I imagine that you will find significant interactions, which is where the richness of a split-plot is found.&amp;nbsp; If significant interactions are found, then simple effect (sliced) tests of condition can be set up at the various levels of role and period.&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, 31 Oct 2014 13:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Help-with-Proc-Mixed-Code/m-p/148078#M7810</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-10-31T13:08:28Z</dc:date>
    </item>
  </channel>
</rss>

