<?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: GLIMMIX convergence problems in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119477#M259603</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve, thanks for your response! I will look into whether it's feasible to make doctors (using the proportion of patients they convinced to quit as the response) rather than patients the basic units of the analysis. Also, the logit transform is a good idea, that may have to be my last resort if this dataset proves to be beyond the capabilities of GLIMMIX. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Nov 2012 12:21:41 GMT</pubDate>
    <dc:creator>sethcamden</dc:creator>
    <dc:date>2012-11-09T12:21:41Z</dc:date>
    <item>
      <title>GLIMMIX convergence problems</title>
      <link>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119472#M259598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;I am trying to analyze a huge dataset with 87,000 subjects. Each subject has 4 repeated measures (1 week, 3 weeks, 6 weeks, 2 months). The model we are developing has both G-side and R-side random effects (i.e. repeated measures and additional random effects). When I try to run the analysis, GLIMMIX gives a "&lt;STRONG&gt;Did not converge&lt;/STRONG&gt;" error. I have tried all of the options GLIMMIX offers for controlling the optimization process e.g. changing the convergence criterion (&lt;STRONG&gt;pconv&lt;/STRONG&gt; = 1e-4), increasing the &lt;STRONG&gt;maxiter&lt;/STRONG&gt; parameter, and playing around with the options for controlling the inner iterations (available through the &lt;STRONG&gt;nloptions &lt;/STRONG&gt;statement) but none of this works. But I noticed that if I take a small random sample of 6000 subjects (from the original 87000 sample size) and run the same model on this sub-sample, GLIMMIX converges. So I suspect the issue is that the sample size (87000 subjects) is just too large. Also, G-side random effects has 120 levels and the other has 8 levels, so the Z matrix has 128 columns in total. Coupled with the large sample size, this may be the source of the problem I'm experiencing. Is there an upper limit on the sample size and Z matrix size GLIMMIX can handle? I know the MIXED procedure has a high-performance version (for huge datasets) called HPMIXED, does GLIMMIX have this as well?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;A quick description of the study: The study is a multi-center trial (8 different hospitals) aimed at gauging the effectiveness of doctors strongly recommending that their patients quit smoking. For each patient, the doctor recommendation was given only &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;once&lt;/STRONG&gt;&lt;/SPAN&gt; (during one of the patient's visit to the hospital). Each patient was then asked about their smoking status 1 week, 3 weeks, 6 weeks, and 2 months (hence the 4 repeated measures) after receiving the doctor recommendation. These 4 repeated measures form the R-side component of the model. We included the variables '&lt;STRONG&gt;hospital&lt;/STRONG&gt;' and '&lt;STRONG&gt;doctor&lt;/STRONG&gt;' (nested within '&lt;STRONG&gt;hospital&lt;/STRONG&gt;') as random effects and these formed the G-side component. As I mentioned earlier, the variable '&lt;STRONG style="font-family: verdana, geneva;"&gt;doctor&lt;/STRONG&gt;' has 120 levels and the second G-side variable '&lt;STRONG style="font-family: verdana, geneva;"&gt;hospital' &lt;/STRONG&gt;has 8 levels, producing a rather huge Z matrix with 128 columns.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;The code is given below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;proc glimmix data=lib.data pconv=1e-4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;class agegroup gender time user doctor hospital subjectID;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;model QuitSmoke(event='1') = agegroup gender time user time*user /dist=binary link=logit solution covb;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;random time /subject=subjectID residual type=ar(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;random doctor(hospital) hospital;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;nloptions technique=congra maxiter=1000 gconv=1e-4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Any help on this would be greatly appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Thanks.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 14:40:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119472#M259598</guid>
      <dc:creator>sethcamden</dc:creator>
      <dc:date>2012-11-07T14:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX convergence problems</title>
      <link>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119473#M259599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your data set sorted by? If subjectID is a numeric column you may want to sort it by subjectID and then remove it from your class statement and modify your random statement appropriately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is explained with some other great tips at &lt;A class="active_link" href="http://support.sas.com/resources/papers/proceedings12/332-2012.pdf" title="http://support.sas.com/resources/papers/proceedings12/332-2012.pdf"&gt;http://support.sas.com/resources/papers/proceedings12/332-2012.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Michelle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 19:34:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119473#M259599</guid>
      <dc:creator>MichelleHomes</dc:creator>
      <dc:date>2012-11-07T19:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX convergence problems</title>
      <link>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119474#M259600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By far, Michelle's suggestion is what you need to do. Of all the dist= options in GLIMMIX, I find dist=binary to lead to the most problems with convergence.&amp;nbsp; I have felt the pain that is evident in that NLOPTIONS statement and pconv= option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible that subjects are nested within doctors as well?&amp;nbsp; If so you might be able to coalesce responses into a binomial distributed variable that calculates the proportion of subjects that have quit for each doctor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If, however, you still run into convergence problems, you might consider pre-processing your dependent variable by applying the logit transform (or arcsin(sqrt(y), or whatever good transformation that may have been referenced prior to the development of generalized linear models) and then moving to HPMIXED.&amp;nbsp; And just to make sure I understand everything correctly, the variable 'user' carries the information of whether the doctor recommended strongly to quit, correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 16:00:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119474#M259600</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2012-11-08T16:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX convergence problems</title>
      <link>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119475#M259601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michelle. Currently the dataset is sorted by timepoint and within each timepoint, the subjects are sorted by their subjectID (i.e. in PROC SORT I used "&lt;STRONG&gt;by time SubjectID&lt;/STRONG&gt;"). Yes, SubjectID is a numeric variable. I am not exactly sure how the order in which my dataset is sorted affects convergence in the GLIMMIX procedure. As you suggested, I can sort by SubjectID and remove it from the class statement but I'm not sure what you mean when you say I should "modify the random statement appropriately". My study is a repeated measures study, each subject (represented by SubjectID) has measurements at 4 timepoints (so there are 4 records per SubjectID). Therefore I find it necessary to include the "&lt;STRONG style="background-color: #ffffff; font-family: verdana, geneva;"&gt;random time /subject=subjectID residual type=ar(1)"&lt;/STRONG&gt; statement in order to specify the correlation structure of among the subjects'&amp;nbsp; 4 repeated measures. I'm not sure I see any other way of stipulating this structure in the model.&lt;/P&gt;&lt;P&gt;Thanks for the article you included, it was really useful, one of the examples (the 3-level HLM model) made me realize that I could recode the "doctor" variable so that it was properly nested within the "hospital" variable, and this led to a new "doctor" variable with much fewer levels (65 [down from 120]). However, this model didn't converge either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 02:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119475#M259601</guid>
      <dc:creator>sethcamden</dc:creator>
      <dc:date>2012-11-09T02:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX convergence problems</title>
      <link>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119476#M259602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My reference to modifying the random statement appropriately was because I thought you were running proc mixed. Sorry... Great to hear that the article helped with your new "doctor" variable. As a thought perhaps sort by SubjectID time and then remove SubjectID from the class statement and see how that goes. Another suggestion is to specify a alternate method for computing the denominator degrees of freedom for the tests of fixed effects resulting from the model. As you using a AR(1) covariance matrix structure, then perhaps the Kenward Rogers method with a firstorder suboption will help so that second derivatives from the calculation of the covariance matrix adjustment are not calculated which may help with the computation... so your model statement becomes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;model QuitSmoke(event='1') = agegroup gender time user time*user /dist=binary link=logit solution covb &lt;STRONG&gt;ddfm=kr(firstorder)&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As documented at &lt;A href="https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_glimmix_a0000001415.htm" title="https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_glimmix_a0000001415.htm"&gt;https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_glimmix_a0000001415.htm&lt;/A&gt; (and click on DDFM).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Michelle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 03:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119476#M259602</guid>
      <dc:creator>MichelleHomes</dc:creator>
      <dc:date>2012-11-09T03:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX convergence problems</title>
      <link>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119477#M259603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve, thanks for your response! I will look into whether it's feasible to make doctors (using the proportion of patients they convinced to quit as the response) rather than patients the basic units of the analysis. Also, the logit transform is a good idea, that may have to be my last resort if this dataset proves to be beyond the capabilities of GLIMMIX. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 12:21:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119477#M259603</guid>
      <dc:creator>sethcamden</dc:creator>
      <dc:date>2012-11-09T12:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX convergence problems</title>
      <link>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119478#M259604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To add to Michelle's comment regarding Kenward-Rogers degrees of freedom:&amp;nbsp; If you are on SAS/STAT12.1, try &lt;STRONG&gt;ddfm=kr2.&amp;nbsp; &lt;/STRONG&gt;The algorithm has been updated and is much more stable.&amp;nbsp; However, I don't think it will help with convergence.&amp;nbsp; My take on the process flow is convergence to stable variance-covarince matrix, estimate parameters, apply denominator degrees of freedom for calculation of tests and intervals.&amp;nbsp; If you have not achieved convergence, the other stuff doesn't get done.&amp;nbsp; No reason not to apply the better estimate though, as you will get convergence eventually.&amp;nbsp; I really think the coalescing to doctor as the unit of analysis should get this done (and if not, then maybe doing this piecewise by timepoint to see what might be messing things up is in order). &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, 09 Nov 2012 12:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/GLIMMIX-convergence-problems/m-p/119478#M259604</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2012-11-09T12:39:17Z</dc:date>
    </item>
  </channel>
</rss>

