<?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: How to fit two-part mixed effects (with crossed random effects) models in SAS in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/764839#M37366</link>
    <description>&lt;P&gt;PROC GLIMMIX defaults to a maximum iteration of 20, so almost always the first thing I do, is use an NLOPTIONS statement to set MAXITER, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;nloptions maxiter=1000;&lt;/PRE&gt;
&lt;P&gt;Your use of maxopt=100 in the PROC GLIMMIX statement does allow for 100 iterations, but you may need more, provided the likelihood function is well-behaved.&lt;/P&gt;
&lt;P&gt;The next thing I would consider is to not use ARSIN(SQRT()) as the transformation outside of GLIMMIX.&amp;nbsp; Rather, I would use the canonical link function (logit)..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So on to the values you see in the iteration history.&amp;nbsp; Do they seem to be converging (although slowly), or is there something unusual happening?&amp;nbsp; Is it growing by a fixed amount at each step?&amp;nbsp; Does it look like it is trying to converge, only to jump to some value that seems pathological?&amp;nbsp; Does it look like it should be called converged at some point, but just keeps going?&amp;nbsp; Each of these is a symptom of something different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
    <pubDate>Mon, 30 Aug 2021 13:49:01 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2021-08-30T13:49:01Z</dc:date>
    <item>
      <title>How to fit two-part mixed effects (with crossed random effects) models in SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/764806#M37364</link>
      <description>&lt;P&gt;How do you fit a two-part mixed effects model in SAS? I have clustered data (crossed design) and the response variable is semi-continuous with many zeros and is bounded in [0,1). I want to fit a two-part mixed effects model to this data including the assumption that the two parts are correlated. So far I have tried fitting this model using PROC GLIMMIX.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The outcome variable is y. First, to prepare the data for Proc Glimmix, I do the following data step to create a new string variable called "distribution" that indicates whether the observation is "Binary" or "normal" so as to fit two parts with different distributions. I have transformed the nonzero part of y using ARSIN(SQRT(.)). The variable "zero" is coded as 0 if y=0 and 1 if y&amp;gt;0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data2;
length distribution $7;
set data1;
response = (zero = 1);
distribution = "Binary";
output;
response = y;
distribution = "Normal";
output;
keep ID1 ID2 response distribution x1 x2 x3 x4;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The variable "response" will then be used as outcome variable in PROC GLIMMIX as below;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data = data2 method =rmpl noclprint pconv=1e-10 maxopt=100 ;
class ID1 ID2 distribution x1 x2 x3 x4 ;
model response(event ="1") = distribution distribution*x1 distribution*x2
distribution*x3 distribution*x4 / noint solution dist=byobs(distribution) ddfm=bw;
random distribution/ subject = ID1 type = un solution ;
random distribution / subject = ID2 type =un solution ;
nloptions tech=nrridg maxiter=1000 gconv=0;
ods exclude solutionr ; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This model, however, does not converge. Does anyone have an idea on how to fit such models or how to adjust the Proc Glimmix above?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: The code above was adapted from the article below but there they do not have crossed random effects:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Baldwin, S. A., Fellingham, G. W., &amp;amp; Baldwin, A. S. (2016). Statistical models for multilevel skewed physical activity data in health research and behavioral medicine.&amp;nbsp;Health Psychology,&amp;nbsp;35(6), 552.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 10:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/764806#M37364</guid>
      <dc:creator>Vivyw</dc:creator>
      <dc:date>2021-08-30T10:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit two-part mixed effects (with crossed random effects) models in SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/764839#M37366</link>
      <description>&lt;P&gt;PROC GLIMMIX defaults to a maximum iteration of 20, so almost always the first thing I do, is use an NLOPTIONS statement to set MAXITER, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;nloptions maxiter=1000;&lt;/PRE&gt;
&lt;P&gt;Your use of maxopt=100 in the PROC GLIMMIX statement does allow for 100 iterations, but you may need more, provided the likelihood function is well-behaved.&lt;/P&gt;
&lt;P&gt;The next thing I would consider is to not use ARSIN(SQRT()) as the transformation outside of GLIMMIX.&amp;nbsp; Rather, I would use the canonical link function (logit)..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So on to the values you see in the iteration history.&amp;nbsp; Do they seem to be converging (although slowly), or is there something unusual happening?&amp;nbsp; Is it growing by a fixed amount at each step?&amp;nbsp; Does it look like it is trying to converge, only to jump to some value that seems pathological?&amp;nbsp; Does it look like it should be called converged at some point, but just keeps going?&amp;nbsp; Each of these is a symptom of something different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 13:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/764839#M37366</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-08-30T13:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit two-part mixed effects (with crossed random effects) models in SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/764889#M37374</link>
      <description>If I'm not mistaken, it's typical to create a cross classified variable rather than to treat the two classes as separate levels, which would assume full nesting rather than cross-classification.  So instead of a three-level model, like you have, you would have only a two-level model, with your cross-classified variable defining the second level.  For example:  &lt;BR /&gt;&lt;BR /&gt;data want; set have;  &lt;BR /&gt;crossclassifier = catt(ID1, "-", ID2); &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;proc glimmix data = want method =rmpl noclprint pconv=1e-10 maxopt=100 ;&lt;BR /&gt;class crossclassifier distribution x1 x2 x3 x4 ;&lt;BR /&gt;model response(event ="1") = distribution distribution*x1 distribution*x2&lt;BR /&gt;distribution*x3 distribution*x4 / noint solution dist=byobs(distribution) ddfm=bw;&lt;BR /&gt;random distribution/ subject = crossclassifier type = un solution ;&lt;BR /&gt;nloptions tech=nrridg maxiter=1000 gconv=0;&lt;BR /&gt;ods exclude solutionr ; &lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Raudenbush, S. W., &amp;amp; Bryk, A. S. (2002). Chapter 12:  Models for Cross-Classified Random Effects.  Hierarchical linear models: Applications and data analysis methods (Vol. 1). sage.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Aug 2021 15:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/764889#M37374</guid>
      <dc:creator>tellmeaboutityo</dc:creator>
      <dc:date>2021-08-30T15:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit two-part mixed effects (with crossed random effects) models in SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/765027#M37381</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/168242"&gt;@tellmeaboutityo&lt;/a&gt;&amp;nbsp;, I had not seen that article and method.&amp;nbsp; What a good idea!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 12:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/765027#M37381</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-08-31T12:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit two-part mixed effects (with crossed random effects) models in SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/765116#M37383</link>
      <description>&lt;P&gt;Thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you mean not to transform but use beta distribution (with logit link)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the values in the iteration history, they seem like it&amp;nbsp;&lt;SPAN&gt;should have converged at some point, but just keeps going.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 17:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-two-part-mixed-effects-with-crossed-random-effects/m-p/765116#M37383</guid>
      <dc:creator>Vivyw</dc:creator>
      <dc:date>2021-08-31T17:09:12Z</dc:date>
    </item>
  </channel>
</rss>

