<?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: proc mixed multilevel output in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716842#M34676</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60873"&gt;@jiltao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your comments!&lt;/P&gt;
&lt;P&gt;My G matrix looks like the following&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Mixed: Convergence Status" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c data"&gt;Convergence criteria met.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;A name="IDX16" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Mixed: Estimated G Matrix" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="5" scope="colgroup"&gt;Estimated G Matrix&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;Row&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Effect&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;ID&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Col1&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Col2&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Intercept&lt;/TD&gt;
&lt;TD class="l data"&gt;600096&lt;/TD&gt;
&lt;TD class="r data"&gt;102.02&lt;/TD&gt;
&lt;TD class="r data"&gt;21.0655&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;difficulty&lt;/TD&gt;
&lt;TD class="l data"&gt;600096&lt;/TD&gt;
&lt;TD class="r data"&gt;21.0655&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the G matrix above means it is&amp;nbsp;&lt;SPAN&gt;not be positive definite&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also based on my data structure (as the attached), what's the best model would you suggest to use?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 04 Feb 2021 16:35:12 GMT</pubDate>
    <dc:creator>superbug</dc:creator>
    <dc:date>2021-02-04T16:35:12Z</dc:date>
    <item>
      <title>proc mixed multilevel output</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716716#M34668</link>
      <description>&lt;P&gt;Hello proc mixed experts,&lt;/P&gt;
&lt;P&gt;Variables in my data are person ID, itemduration(time spent answering each question), difficulty(item difficulty). Each person ID answers 150 questions, that is, row 1-row 150 are the same ID, row 151-row 300 are another person ID, etc.&amp;nbsp; Item nested in person(ID), I am trying a multilevel modeling (two level model).&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;Dependent variable is itemduration, level 1 predictor is item difficulty. Model below contains only level1 predictor.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;proc mixed data= try method=ml;
 class ID;
 model itemduration = difficulty / solution outp=t;
 random intercept difficulty / subject=ID type=un g solution;
 ods output solutionR=randest;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the following is portion of the output data "randest", I can't understand why "std Err Pred" are the same for all IDs. I am trying to get standard errors for each ID. How should I edit the code so that I can get standard errors for each ID?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_1-1612405553243.png" style="width: 520px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54311iD61FD944AB52839F/image-dimensions/520x236?v=v2" width="520" height="236" role="button" title="superbug_1-1612405553243.png" alt="superbug_1-1612405553243.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you for any help.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 02:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716716#M34668</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-02-04T02:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed multilevel output</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716809#M34669</link>
      <description>&lt;P&gt;What does the output look like for the covariance parameters?&amp;nbsp; What does the G matrix look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect you get the same standard errors because the variable "difficulty" appears both in the MODEL statement as a fixed effect and in the RANDOM statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What happens if you change the MODEL statement to&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;model itemduration = / solution outp=t;&lt;/PRE&gt;
&lt;P&gt;That should also change the df in the table from the residual df to the contained df.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, consider 'difficulty' as a repeated effect measured on each ID, and model as an R side effect.&amp;nbsp; You then have 2 levels on the R side (difficulty and ID within difficulty).&amp;nbsp; Code would look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed data= try method=ml;
 class ID;
 model itemduration = difficulty / solution outp=t;
 random intercept / subject=ID  g solution;
repeated difficulty/ subject=ID r;
 ods output solutionR=randest;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Without some data to try these on, I can't be sure how to move beyond something like these.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 13:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716809#M34669</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-02-04T13:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed multilevel output</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716815#M34673</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="trigger-hovercard" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304931" target="_blank"&gt;superbug&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;It looks to me that your G matrix might not be positive definite -- the estimated variance for the subject slope (deviation) of difficulty might be zero, and that might be the reason why the standard errors for your random slope estimates for each subject is zero. The reason why the standard errors for the random intercept for each subject is constant, is probably because of a balanced data you have. Is that the case -- that you have a balanced data?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is nothing wrong with your code or PROC MIXED. Your data situation might be the reason why.&lt;/P&gt;
&lt;P&gt;Hope this makes sense.&lt;/P&gt;
&lt;P&gt;Jill&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 14:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716815#M34673</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2021-02-04T14:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed multilevel output</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716821#M34675</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the suggestions!&lt;/P&gt;
&lt;P&gt;I am trying to investigate the effect of item difficulty on item response time, so I tried your code&amp;nbsp;&lt;SPAN&gt;considering 'difficulty' as a repeated effect measured on each ID. However, I got the following error message&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV id="tinyMceEditorsuperbug_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;283 proc mixed data=long;&lt;BR /&gt;NOTE: PROCEDURE MIXED used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ERROR: Only CLASS variables allowed in this effect.&lt;/STRONG&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.T_NEW may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 0 variables.&lt;BR /&gt;284 class ID;&lt;BR /&gt;285 model itemdur = difficulty / solution outp=t;&lt;BR /&gt;286 random intercept / subject=ID g solution;&lt;BR /&gt;287 repeated difficulty/ subject=ID r;&lt;BR /&gt;288 ods output solutionR=randest;&lt;BR /&gt;289 run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditorsuperbug_2" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;Could you please help how to modify the code so that to get correct results. I attached the data file for your reference. In the attached data, person&amp;nbsp;600096 answered 150 items (row 2-row 151), person 635021 answered the same set of items (row 152-row 301), etc. There are 37 person ID in total.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;DIV id="tinyMceEditorsuperbug_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 14:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716821#M34675</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-02-04T14:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed multilevel output</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716842#M34676</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60873"&gt;@jiltao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your comments!&lt;/P&gt;
&lt;P&gt;My G matrix looks like the following&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Mixed: Convergence Status" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c data"&gt;Convergence criteria met.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;A name="IDX16" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Mixed: Estimated G Matrix" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="5" scope="colgroup"&gt;Estimated G Matrix&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;Row&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Effect&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;ID&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Col1&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Col2&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Intercept&lt;/TD&gt;
&lt;TD class="l data"&gt;600096&lt;/TD&gt;
&lt;TD class="r data"&gt;102.02&lt;/TD&gt;
&lt;TD class="r data"&gt;21.0655&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;difficulty&lt;/TD&gt;
&lt;TD class="l data"&gt;600096&lt;/TD&gt;
&lt;TD class="r data"&gt;21.0655&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the G matrix above means it is&amp;nbsp;&lt;SPAN&gt;not be positive definite&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also based on my data structure (as the attached), what's the best model would you suggest to use?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Feb 2021 16:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716842#M34676</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-02-04T16:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed multilevel output</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716844#M34677</link>
      <description>&lt;P&gt;You should see the following message in the Log --&lt;/P&gt;
&lt;P&gt;NOTE: Estimated G matrix is not positive definite.&lt;/P&gt;
&lt;P&gt;So yes, your G matrix is not positive definite.&lt;/P&gt;
&lt;P&gt;You might consider taking out DIFFICULTY from the RANDOM statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 16:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-multilevel-output/m-p/716844#M34677</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2021-02-04T16:52:09Z</dc:date>
    </item>
  </channel>
</rss>

