<?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 proc mixed model convergence question in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-model-convergence-question/m-p/810347#M39897</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm just wondering if you have had such experience before: same exact data, fit into the "same" model (in my opinion, below two models are the same) but the convergence result is totally different (model one cannot converge, but model two can):&lt;/P&gt;&lt;P&gt;(I know model 1 LSMEANS statement asks for diff, but model 2 asks for pdiff. But i don't think this is the reason).&lt;/P&gt;&lt;P&gt;The only reason i can see and have tried it worked is to re-order the variables in class statement, i.e., to put pstudyid right after usubjid, just like the 2nd model. But Why? why does this matter?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model 1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;proc mixed data=cdr0102_pool;&lt;BR /&gt;class usubjid avisitn anfgr02n adcmblfl region1 apoegr3 pstudyid; *===&amp;lt;apparently the order in class impact the convergence (pstudyid);&lt;BR /&gt;model chgtpt02 = anfgr02n avisitn avisitn*anfgr02n pstudyid pstudyid*avisitn tpt02 tpt02*avisitn mmsebl adcmblfl region1 apoegr3/ ddfm=kr residual;&lt;BR /&gt;repeated avisitn / type=un subject=usubjid;&lt;BR /&gt;lsmeans avisitn*anfgr02n/ diff cl;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model 2:&lt;/STRONG&gt;&lt;BR /&gt;proc mixed data=cdr0102_pool;&lt;BR /&gt;class usubjid pstudyid avisitn anfgr02n adcmblfl region1 apoegr3;&lt;BR /&gt;model chgtpt02 = anfgr02n avisitn avisitn*anfgr02n pstudyid pstudyid*avisitn tpt02 tpt02*avisitn mmsebl adcmblfl region1 apoegr3 / ddfm=kr residual;&lt;BR /&gt;repeated avisitn / type=un subject=usubjid;&lt;BR /&gt;lsmeans avisitn*anfgr02n / cl pdiff;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2022 13:03:49 GMT</pubDate>
    <dc:creator>yahoo0806</dc:creator>
    <dc:date>2022-04-28T13:03:49Z</dc:date>
    <item>
      <title>proc mixed model convergence question</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-model-convergence-question/m-p/810347#M39897</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm just wondering if you have had such experience before: same exact data, fit into the "same" model (in my opinion, below two models are the same) but the convergence result is totally different (model one cannot converge, but model two can):&lt;/P&gt;&lt;P&gt;(I know model 1 LSMEANS statement asks for diff, but model 2 asks for pdiff. But i don't think this is the reason).&lt;/P&gt;&lt;P&gt;The only reason i can see and have tried it worked is to re-order the variables in class statement, i.e., to put pstudyid right after usubjid, just like the 2nd model. But Why? why does this matter?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model 1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;proc mixed data=cdr0102_pool;&lt;BR /&gt;class usubjid avisitn anfgr02n adcmblfl region1 apoegr3 pstudyid; *===&amp;lt;apparently the order in class impact the convergence (pstudyid);&lt;BR /&gt;model chgtpt02 = anfgr02n avisitn avisitn*anfgr02n pstudyid pstudyid*avisitn tpt02 tpt02*avisitn mmsebl adcmblfl region1 apoegr3/ ddfm=kr residual;&lt;BR /&gt;repeated avisitn / type=un subject=usubjid;&lt;BR /&gt;lsmeans avisitn*anfgr02n/ diff cl;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model 2:&lt;/STRONG&gt;&lt;BR /&gt;proc mixed data=cdr0102_pool;&lt;BR /&gt;class usubjid pstudyid avisitn anfgr02n adcmblfl region1 apoegr3;&lt;BR /&gt;model chgtpt02 = anfgr02n avisitn avisitn*anfgr02n pstudyid pstudyid*avisitn tpt02 tpt02*avisitn mmsebl adcmblfl region1 apoegr3 / ddfm=kr residual;&lt;BR /&gt;repeated avisitn / type=un subject=usubjid;&lt;BR /&gt;lsmeans avisitn*anfgr02n / cl pdiff;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 13:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-model-convergence-question/m-p/810347#M39897</guid>
      <dc:creator>yahoo0806</dc:creator>
      <dc:date>2022-04-28T13:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed model convergence question</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-model-convergence-question/m-p/810462#M39902</link>
      <description>&lt;P class="csE77A638E"&gt;&lt;SPAN class="cs10AA554A"&gt;When the optimization process is stable, the results should not be affected by different orders of independent variables in the model. However, when the optimization is not stable, the order of the effects might occasionally make a difference, for example, one model might not even converge while other models might converge successfully. The documentation here&amp;nbsp;&lt;SPAN class="cs40ADD360"&gt;&lt;A class="cs445E1B2D" href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_details58.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en#statug_mixed017761"&gt;&amp;nbsp;&lt;/A&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_details58.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en#statug_mixed017761"&gt;https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_details58.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en#statug_mixed017761&amp;nbsp;&lt;/A&gt;&lt;A class="cs445E1B2D" href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_details58.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en#statug_mixed017761"&gt;&amp;nbsp;&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="cs10AA554A"&gt;provides some information on how to deal with convergence issues. For example, &amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN class="cs32FCFA39"&gt;&amp;nbsp;Rearranging effects in the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="cs10AA554A"&gt;&lt;A class="cs445E1B2D" href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_syntax10.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en"&gt;&lt;SPAN class="cs37D51CCC"&gt;MODEL&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="cs32FCFA39"&gt;&amp;nbsp;statement so that the most significant ones are first can help, because PROC MIXED sweeps the estimate of&amp;nbsp;X'V-1X&amp;nbsp;in the order of the MODEL effects and the sweep is more stable if larger pivots are dealt with first. If this does not help, specifying starting values with the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="cs10AA554A"&gt;&lt;A class="cs445E1B2D" href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_syntax11.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en"&gt;&lt;SPAN class="cs37D51CCC"&gt;PARMS&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="cs32FCFA39"&gt;&amp;nbsp;statement can place the optimization on a different and possibly more stable path.&lt;/SPAN&gt;&lt;SPAN class="cs10AA554A"&gt;&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN class="cs4A4384B5"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="csE77A638E"&gt;&lt;SPAN class="cs4A4384B5"&gt;In your case, the two programs have different orders of effects in the CLASS statements, that makes different orders of the design matrix for the interaction effect&amp;nbsp;&lt;SPAN&gt;pstudyid*avisitn, which is essentially the same as specifying the model effects in different orders, so the issues discussed above could appear.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs2654AE3A"&gt;&lt;SPAN class="cs4A4384B5"&gt;I hope that explains why your first program did not converge while your second program did converge.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs2654AE3A"&gt;&lt;SPAN class="cs4A4384B5"&gt;What is the error message for your first program?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs2654AE3A"&gt;&lt;SPAN class="cs4A4384B5"&gt;Jill&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs2654AE3A"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 19:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-model-convergence-question/m-p/810462#M39902</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2022-04-28T19:03:47Z</dc:date>
    </item>
  </channel>
</rss>

