<?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: Subject in repeated statement for PROC MIXED in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856940#M42383</link>
    <description>&lt;P&gt;I am not sure about your question -- no subject= option or no repeated statement? What is the model now? And is your data a repeated measures?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Jill&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2023 20:49:17 GMT</pubDate>
    <dc:creator>jiltao</dc:creator>
    <dc:date>2023-02-02T20:49:17Z</dc:date>
    <item>
      <title>Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856580#M42353</link>
      <description>I’m currently running a parallel trial with 4 groups, 5 different subjects per group. 8 equally spaced timepoints 1 to 8 hours post treatment. the first level is the control group, compared to each of the 3 treatment groups. I have subject=subject in the repeated line, but I’ve seen someone recently run this analysis using subject=subject*time. Can anyone explain how adding the time interaction would affect the outcome?&lt;BR /&gt;&lt;BR /&gt;class subject treatment time;&lt;BR /&gt;model result= treatment time treatment*time;&lt;BR /&gt;Repeated time / type=CS subject=??;&lt;BR /&gt;lsmeans treatment / adjust=dunnett;</description>
      <pubDate>Wed, 01 Feb 2023 06:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856580#M42353</guid>
      <dc:creator>stats2554</dc:creator>
      <dc:date>2023-02-01T06:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856642#M42357</link>
      <description>&lt;P&gt;With a repeated statement like&lt;/P&gt;
&lt;P&gt;repeated time / type=cs subject=subject;&lt;/P&gt;
&lt;P&gt;you are modeling the R matrix as a block diagonal structure with a common covariance on all the observations from the same level of SUBJECT.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With your data description, if SUBJECT takes on a unique value for for each unique subject in your data (ie, subjects 1,2,3 in block a and subjects 4,5,6 in block b), then this syntax will be fine If you have subjects nested in blocks (ie, subjects 1,2,3 in block a and subjects 1,2,3 in block b) and subject 1 in block a is a different subject than subject 1 in block b, then you need subject=subject(block) on your repeated statement,&lt;/P&gt;
&lt;P&gt;A statement like&lt;/P&gt;
&lt;P&gt;repeated time / type=cs subject=subject*time is likely incorrect. The subject= effect on the repeated statement is the experimental unit on which repeated measures were taken. If time is your repeated measure, then it is unlikely that you took repeated measures over time on the experimental unit subject*time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 13:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856642#M42357</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2023-02-01T13:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856682#M42364</link>
      <description>Would it be appropriate to include group=treatment in this case? Thanks!</description>
      <pubDate>Wed, 01 Feb 2023 17:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856682#M42364</guid>
      <dc:creator>stats2554</dc:creator>
      <dc:date>2023-02-01T17:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856695#M42368</link>
      <description>&lt;P&gt;GROUP=TREATMENT will estimate the TYPE=CS structure separately for each level of treatment. If you suspect you have heterogeneity in the variances across levels of treatment, then that is the way to handle it. You do need sufficient data to estimate the variances for each treatment. If you are having trouble using GROUP= then that can be a sign that you do not have sufficient data to estimate the variance separately.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 17:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856695#M42368</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2023-02-01T17:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856700#M42369</link>
      <description>Thanks! My last question is when I remove the subject= statement completely but leave in the repeated time, the results are very similar. Can you explain why the results are similar when it is removed and how the analysis methods are different this way? It actually has better sensitivity to pick up changes, but wouldn’t use it if it was wrong.</description>
      <pubDate>Wed, 01 Feb 2023 18:05:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856700#M42369</guid>
      <dc:creator>stats2554</dc:creator>
      <dc:date>2023-02-01T18:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856703#M42371</link>
      <description>&lt;P&gt;If you have a repeated statement like&lt;/P&gt;
&lt;P&gt;repeated time / type=cs;&lt;/P&gt;
&lt;P&gt;then you are not estimating anything in the r-matrix except a diagonal element. MIXED might partition the variance into two components (with TYPE=CS), but the components will sum to the residual variance you obtain when you drop the repeated statement completely. So, this repeated statement is the same as having no repeated statement at all. Specifically, this repeated statement is not correlating any observations in your data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 18:23:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856703#M42371</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2023-02-01T18:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856728#M42373</link>
      <description>&lt;P&gt;I used the data and program below for your questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data pr;&lt;BR /&gt;input Person Gender $ y1 y2 y3 y4;&lt;BR /&gt;y=y1; Age=8; output;&lt;BR /&gt;y=y2; Age=10; output;&lt;BR /&gt;y=y3; Age=12; output;&lt;BR /&gt;y=y4; Age=14; output;&lt;BR /&gt;drop y1-y4;&lt;BR /&gt;datalines;&lt;BR /&gt;1 F 21.0 20.0 21.5 23.0&lt;BR /&gt;2 F 21.0 21.5 24.0 25.5&lt;BR /&gt;3 F 20.5 24.0 24.5 26.0&lt;BR /&gt;4 F 23.5 24.5 25.0 26.5&lt;BR /&gt;5 F 21.5 23.0 22.5 23.5&lt;BR /&gt;6 F 20.0 21.0 21.0 22.5&lt;BR /&gt;7 F 21.5 22.5 23.0 25.0&lt;BR /&gt;8 F 23.0 23.0 23.5 24.0&lt;BR /&gt;9 F 20.0 21.0 22.0 21.5&lt;BR /&gt;10 F 16.5 19.0 19.0 19.5&lt;BR /&gt;11 F 24.5 25.0 28.0 28.0&lt;BR /&gt;12 M 26.0 25.0 29.0 31.0&lt;BR /&gt;13 M 21.5 22.5 23.0 26.5&lt;BR /&gt;14 M 23.0 22.5 24.0 27.5&lt;BR /&gt;15 M 25.5 27.5 26.5 27.0&lt;BR /&gt;16 M 20.0 23.5 22.5 26.0&lt;BR /&gt;17 M 24.5 25.5 27.0 28.5&lt;BR /&gt;18 M 22.0 22.0 24.5 26.5&lt;BR /&gt;19 M 24.0 21.5 24.5 25.5&lt;BR /&gt;20 M 23.0 20.5 31.0 26.0&lt;BR /&gt;21 M 27.5 28.0 31.0 31.5&lt;BR /&gt;22 M 23.0 23.0 23.5 25.0&lt;BR /&gt;23 M 21.5 23.5 24.0 28.0&lt;BR /&gt;24 M 17.0 24.5 26.0 29.5&lt;BR /&gt;25 M 22.5 25.5 25.5 26.0&lt;BR /&gt;26 M 23.0 24.5 26.0 30.0&lt;BR /&gt;27 M 22.0 21.5 23.5 25.0&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;proc mixed data=pr ;&lt;BR /&gt;class Person Gender age;&lt;BR /&gt;model y = Gender Age Gender*Age / s;&lt;BR /&gt;repeated age / type=cs subject=Person r;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc mixed data=pr ;&lt;BR /&gt;class Person Gender age;&lt;BR /&gt;model y = Gender Age Gender*Age / s;&lt;BR /&gt;repeated age / type=cs subject=Person*age r;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see that the above two programs produced the same results. Generally speaking, the second program have a repeated statement that is too complex than necessary. It seems to be okay for this model, but if you use a different covariance structure, such as AR(1) or UN, you might see something like the following-&lt;/P&gt;
&lt;P&gt;NOTE: Convergence criteria met but final Hessian is not positive definite.&lt;/P&gt;
&lt;P&gt;So I would use the first model specification.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 19:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856728#M42373</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2023-02-01T19:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856936#M42382</link>
      <description>Thanks! If the subject= statement is not included and the data is not correlated, is this still considered a “repeated measures” analysis? The results are giving pvalues for the treatment*time interaction that are indicating the correct trend is being detected, but I wasn’t sure if there was real utility in doing such an analysis (picking up the same trends, with less power?). Thanks!</description>
      <pubDate>Thu, 02 Feb 2023 20:43:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856936#M42382</guid>
      <dc:creator>stats2554</dc:creator>
      <dc:date>2023-02-02T20:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856940#M42383</link>
      <description>&lt;P&gt;I am not sure about your question -- no subject= option or no repeated statement? What is the model now? And is your data a repeated measures?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Jill&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 20:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856940#M42383</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2023-02-02T20:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856958#M42384</link>
      <description>It is repeated measures data at four timepoints 1-4 hours. Without using a subject=option my data is giving me the correct significance for treatment and treatment*time interaction…except the pvalues are lower than when a subject= option is entered. So I’m curious to how it is treating the data in the four timepoints without defining subject, especially since I’m getting results similar to what is given with a subject= option in the repeated line.</description>
      <pubDate>Thu, 02 Feb 2023 21:41:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856958#M42384</guid>
      <dc:creator>stats2554</dc:creator>
      <dc:date>2023-02-02T21:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856978#M42386</link>
      <description>&lt;P&gt;Are you comparing the models with --&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;repeated age / type=cs ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;repeated age / type=cs subject=Person;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Or something else?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 00:24:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856978#M42386</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2023-02-03T00:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856981#M42387</link>
      <description>Correct, both of those models with proc mixed (just using a different data set). I’m curious as to how sas treats the data differently using the first vs 2nd model you mention. I’m curious because it’s still showing a valid significant treatmentxtime interaction as it should, and the results are not far off when I add dunnetts test to compare lsmeans between treatments. So it seems to still be making valid inferences…I just not sure how it is treating the data at repeated timepoints without setting a subject= option in the repeated statement.</description>
      <pubDate>Fri, 03 Feb 2023 01:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/856981#M42387</guid>
      <dc:creator>stats2554</dc:creator>
      <dc:date>2023-02-03T01:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Subject in repeated statement for PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/857060#M42392</link>
      <description>&lt;P&gt;repeated age / type=cs;&lt;/P&gt;
&lt;P&gt;just estimates the residual variances and break it into two pieces. So your R matrix is a constant variance (sum of the two estimates) and zero covariance.&lt;/P&gt;
&lt;P&gt;repeated age / type=cs subject=person;&lt;/P&gt;
&lt;P&gt;estimates a block-diagonal covariance matrix R, with each block corresponds to each person. Within each block, the structure is a compound symmetry .&lt;/P&gt;
&lt;P&gt;You can add the R option in the REPEATED statement to see the R matrix in the output.&lt;/P&gt;
&lt;P&gt;If you want to model the correlations in your data, you might need to use the second specification (with the SUBJECT= option). And go with whatever this model produces for your fixed effects.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 15:05:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Subject-in-repeated-statement-for-PROC-MIXED/m-p/857060#M42392</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2023-02-03T15:05:39Z</dc:date>
    </item>
  </channel>
</rss>

