<?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 Help to fit this model with NLMIXED in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Help-to-fit-this-model-with-NLMIXED/m-p/239894#M12694</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use SAS (SAS University Edition) to fit a nonlinear mixed-effects model to my data. Before fitting the model, I first import the data into SAS. This data consists in repeated measurements (over time) for a group of individuals (the dataset is attached). To distinguish between individuals, I use a grouping variable &lt;EM&gt;grp&lt;/EM&gt;. This dataset is not a 'synthetic dataset' (ie. the data was not generated using the model itself or another model).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code to import the data &amp;amp;colon;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename mydata '/folders/myfolders/data_for_nlmixed_procedure.txt';&lt;/P&gt;&lt;P&gt;data datagen;&lt;BR /&gt;infile mydata delimiter=',';&lt;BR /&gt;input X Y grp;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once the data is imported into SAS, here is the code I use (and the model I want to fit to my data) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc nlmixed data=datagen tech=quanew linesearch=6 method=gauss qpoints=1 maxfunc=100000 maxiter=6000;&lt;BR /&gt;parms p0=1.33301 t0=71.7015 v0=-0.0002 s2gamma=0.48836 s2tau=40.5372 s2e=0.02251;&lt;BR /&gt;model Y ~ normal( p0 + exp(gamma)*v0*(X-t0-tau) , s2e);&lt;BR /&gt;random gamma tau ~ normal([0, 0], [s2gamma, 0, s2tau]) subject=grp out=eb_rh_insula;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using this code, I often encounter the following error : "No valid parameter points were found". For example, this happens by choosing as initial values : p0=3.33 t0=51 v0=-0.002 s2gamma=0.48 s2tau=40 s2e=0.02. To deal with this error message, I assumed I had to try different starting values. Once I found correct starting values, the procedure NLMIXED often has difficulties to converge. For example, running the code above gives me :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: QUANEW Optimization cannot be completed.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The gradient of the objective function cannot be computed during the optimization process.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;I have tried other optimization techniques (tech=newrap, trureg,...) but I keep getting error messages.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&lt;BR /&gt;I would like to understand what is causing these difficulties. Is it a problem with the model itself ? I believe the model is identifiable. Is it a problem with my NLMIXED procedure ? I would really appreciate new ideas here !&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Thank you !&lt;/DIV&gt;</description>
    <pubDate>Fri, 18 Dec 2015 00:26:44 GMT</pubDate>
    <dc:creator>jibounet01</dc:creator>
    <dc:date>2015-12-18T00:26:44Z</dc:date>
    <item>
      <title>Help to fit this model with NLMIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Help-to-fit-this-model-with-NLMIXED/m-p/239894#M12694</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use SAS (SAS University Edition) to fit a nonlinear mixed-effects model to my data. Before fitting the model, I first import the data into SAS. This data consists in repeated measurements (over time) for a group of individuals (the dataset is attached). To distinguish between individuals, I use a grouping variable &lt;EM&gt;grp&lt;/EM&gt;. This dataset is not a 'synthetic dataset' (ie. the data was not generated using the model itself or another model).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code to import the data &amp;amp;colon;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename mydata '/folders/myfolders/data_for_nlmixed_procedure.txt';&lt;/P&gt;&lt;P&gt;data datagen;&lt;BR /&gt;infile mydata delimiter=',';&lt;BR /&gt;input X Y grp;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once the data is imported into SAS, here is the code I use (and the model I want to fit to my data) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc nlmixed data=datagen tech=quanew linesearch=6 method=gauss qpoints=1 maxfunc=100000 maxiter=6000;&lt;BR /&gt;parms p0=1.33301 t0=71.7015 v0=-0.0002 s2gamma=0.48836 s2tau=40.5372 s2e=0.02251;&lt;BR /&gt;model Y ~ normal( p0 + exp(gamma)*v0*(X-t0-tau) , s2e);&lt;BR /&gt;random gamma tau ~ normal([0, 0], [s2gamma, 0, s2tau]) subject=grp out=eb_rh_insula;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using this code, I often encounter the following error : "No valid parameter points were found". For example, this happens by choosing as initial values : p0=3.33 t0=51 v0=-0.002 s2gamma=0.48 s2tau=40 s2e=0.02. To deal with this error message, I assumed I had to try different starting values. Once I found correct starting values, the procedure NLMIXED often has difficulties to converge. For example, running the code above gives me :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: QUANEW Optimization cannot be completed.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The gradient of the objective function cannot be computed during the optimization process.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;I have tried other optimization techniques (tech=newrap, trureg,...) but I keep getting error messages.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&lt;BR /&gt;I would like to understand what is causing these difficulties. Is it a problem with the model itself ? I believe the model is identifiable. Is it a problem with my NLMIXED procedure ? I would really appreciate new ideas here !&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Thank you !&lt;/DIV&gt;</description>
      <pubDate>Fri, 18 Dec 2015 00:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Help-to-fit-this-model-with-NLMIXED/m-p/239894#M12694</guid>
      <dc:creator>jibounet01</dc:creator>
      <dc:date>2015-12-18T00:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fit this model with NLMIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Help-to-fit-this-model-with-NLMIXED/m-p/239933#M12695</link>
      <description>&lt;P&gt;I'm no expert with nlmixed but one thing that sure helps is to remove subjects without enough points. I think the difficulty might be with the product of gamma and tau, both being random. Anyway, this takes a while but converges...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table b as
select *
from datagen
group by grp
having count(*) &amp;gt;= 3;
quit;

proc nlmixed data=b tech=quanew qpoints=8;
parms p0=2.5 t0=71.7015 v0=-8.5 s2gamma=6 s2tau=40.5372 s2e=0.02251;
model Y ~ normal( p0 - exp(gamma)*(X-tau) , s2e);
random gamma tau ~ normal([v0, t0], [s2gamma, 0, s2tau]) subject=grp;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Dec 2015 06:19:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Help-to-fit-this-model-with-NLMIXED/m-p/239933#M12695</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-12-18T06:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fit this model with NLMIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Help-to-fit-this-model-with-NLMIXED/m-p/239971#M12697</link>
      <description>&lt;P&gt;Thank you for your answer ! I will try this new code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am interested in having several points of view on the model or the NLMIXED procedure. This would probably help me understand where are the difficulties coming from when fitting the model to some data.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2015 11:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Help-to-fit-this-model-with-NLMIXED/m-p/239971#M12697</guid>
      <dc:creator>jibounet01</dc:creator>
      <dc:date>2015-12-18T11:53:22Z</dc:date>
    </item>
  </channel>
</rss>

