<?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: Random Slope parameters per individual using proc mixed in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964586#M48382</link>
    <description>&lt;P&gt;First, your PROC MIXED code does not seem to be appropriate. It looks to me that you wanted to fit a random coefficients model? If so, TIME should not be a CLASS variable, and you should have the SUBJECT= option in the RANDOM statement. Then with this modified RANDOM statement, your REPEATED statement with TYPE=UN structure is likely over-fitting your data and might need to be removed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc mixed data=trial;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;class idno ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;model GLOBALCOG = time WMFA WMH ICV brainvol AGE RACE GENDER/s chisq OUTPM=WORK.PM RESIDUAL;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;random intercept time / subject=idno;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then you might use approaches illustrated in the following usage note to obtain subject-specific intercept and slope estimates.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/37/109.html" target="_blank"&gt;37109 - Obtaining subject-specific parameter estimates and tests for a random coefficients model or HLM with PROC MIXED or PROC GLIMMIX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Jill&lt;/P&gt;</description>
    <pubDate>Fri, 18 Apr 2025 13:43:31 GMT</pubDate>
    <dc:creator>jiltao</dc:creator>
    <dc:date>2025-04-18T13:43:31Z</dc:date>
    <item>
      <title>Random Slope parameters per individual using proc mixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964522#M48376</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help obtaining the random slope estimates per individual, so that I can use those parameters per individual as an outcome in another part of the analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code that I am currently using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods output solutionf=slopes;&lt;BR /&gt;proc mixed data=trial;&lt;BR /&gt;class idno time;&lt;BR /&gt;model GLOBALCOG = time WMFA WMH ICV brainvol AGE RACE GENDER/s chisq OUTPM=WORK.PM RESIDUAL;&lt;BR /&gt;random intercept time;&lt;BR /&gt;repeated time/type=un subject=idno r rcorr;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The part "solutionf=slopes" provide one parameter of the random slope but not per individual.&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 15:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964522#M48376</guid>
      <dc:creator>lgutm18</dc:creator>
      <dc:date>2025-04-17T15:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Random Slope parameters per individual using proc mixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964529#M48377</link>
      <description>&lt;P&gt;Is this what you are looking for?&lt;BR /&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_mixed_examples05.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_mixed_examples05.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 18:05:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964529#M48377</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-04-17T18:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Random Slope parameters per individual using proc mixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964555#M48378</link>
      <description>&lt;P&gt;Yes! Thanks for sharing. However, what it's still not clear is how to extract the random slope parameters per individual as a column that you could add to the dataset to use for analysis. I'd greatly appreciate suggestions!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 21:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964555#M48378</guid>
      <dc:creator>lgutm18</dc:creator>
      <dc:date>2025-04-17T21:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Random Slope parameters per individual using proc mixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964559#M48379</link>
      <description>&lt;P&gt;I think your code should look like this:&lt;/P&gt;
&lt;PRE&gt;data trial;
call streaminit(123);
do idno=1 to 10;
 do time=1 to 4;
  globalcog=rand('normal');
  brain=rand('normal');
  output;
 end;
end;
run;

&lt;STRONG&gt;ods  output SolutionR= SolutionR;&lt;/STRONG&gt;
proc mixed data=trial;
class idno time;
model GLOBALCOG = time brain/s chisq  RESIDUAL;
&lt;STRONG&gt;random intercept /subject=idno solution ;&lt;/STRONG&gt;
repeated time/type=un subject=idno r rcorr;
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1744938570030.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106321iDE21A919E111CE30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1744938570030.png" alt="Ksharp_0-1744938570030.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 01:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964559#M48379</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-04-18T01:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Random Slope parameters per individual using proc mixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964563#M48381</link>
      <description>&lt;P&gt;If this random slope is one slope for one subject. Try this:&lt;/P&gt;
&lt;PRE&gt;data trial;
call streaminit(123);
do idno=1 to 10;
 do time=1 to 4;
  globalcog=rand('normal');
  brain=rand('normal');
  output;
 end;
end;
run;

&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ods  output SolutionR= SolutionR;&lt;/STRONG&gt;&lt;/FONT&gt;
proc mixed data=trial;
class idno time ;
model GLOBALCOG = time brain/s chisq  RESIDUAL;
/*random intercept /subject=idno solution ;*/
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;random  brain/subject=idno solution ;&lt;/STRONG&gt;&lt;/FONT&gt;

/*repeated time/type=un subject=idno r rcorr;*/
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1744940008111.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106323i699FA69AA1B266C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1744940008111.png" alt="Ksharp_0-1744940008111.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 01:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964563#M48381</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-04-18T01:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Random Slope parameters per individual using proc mixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964586#M48382</link>
      <description>&lt;P&gt;First, your PROC MIXED code does not seem to be appropriate. It looks to me that you wanted to fit a random coefficients model? If so, TIME should not be a CLASS variable, and you should have the SUBJECT= option in the RANDOM statement. Then with this modified RANDOM statement, your REPEATED statement with TYPE=UN structure is likely over-fitting your data and might need to be removed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc mixed data=trial;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;class idno ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;model GLOBALCOG = time WMFA WMH ICV brainvol AGE RACE GENDER/s chisq OUTPM=WORK.PM RESIDUAL;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;random intercept time / subject=idno;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then you might use approaches illustrated in the following usage note to obtain subject-specific intercept and slope estimates.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/37/109.html" target="_blank"&gt;37109 - Obtaining subject-specific parameter estimates and tests for a random coefficients model or HLM with PROC MIXED or PROC GLIMMIX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Jill&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 13:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/964586#M48382</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2025-04-18T13:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Random Slope parameters per individual using proc mixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/965140#M48414</link>
      <description>This works great! Thank you very much!</description>
      <pubDate>Sat, 26 Apr 2025 00:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/965140#M48414</guid>
      <dc:creator>lgutm18</dc:creator>
      <dc:date>2025-04-26T00:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Random Slope parameters per individual using proc mixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/965141#M48415</link>
      <description>I appreciate your comment and the resource. I have fixed my code.&lt;BR /&gt;Thanks!!</description>
      <pubDate>Sat, 26 Apr 2025 00:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Slope-parameters-per-individual-using-proc-mixed/m-p/965141#M48415</guid>
      <dc:creator>lgutm18</dc:creator>
      <dc:date>2025-04-26T00:46:56Z</dc:date>
    </item>
  </channel>
</rss>

