<?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 can I apply my nonlinear mixed-effects model to testdata? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/803782#M39524</link>
    <description>&lt;P&gt;The PREDICT statement predicts any expression. Currently, you are predicting mdl, which does not include any random effects.&amp;nbsp; Add a new PREDICT statement such as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;predict mdl+u&amp;nbsp; out=tahminRand;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Or, for more complicated expressions, define a temporary variable in the program that incorporates the random effects. For example:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Pred = mdl + u;&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;predict Pred out=tahminRand;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2022 12:56:59 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2022-03-24T12:56:59Z</dc:date>
    <item>
      <title>How can I apply my nonlinear mixed-effects model to testdata?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/803559#M39509</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I developed a nonlinear mixed-effects model using nlmixed procedure. But, I do not know how to apply this model to test data (unseen data in modeling). I tried OUTmodel and INmodel options, but I failed to run the model. Could you help me please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data capboy;&lt;BR /&gt;input boy dbh N G hmak dmak plot;&lt;BR /&gt;datalines;&lt;BR /&gt;10.1 35 725 23.50 11.2 35 1&lt;BR /&gt;10.6 21 725 23.50 11.2 35 1&lt;/P&gt;&lt;P&gt;... more lines&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data testdata;&lt;BR /&gt;input boy dbh N G hmak dmak plot;&lt;BR /&gt;datalines;&lt;BR /&gt;19 28 450 24.25 20 53 5&lt;BR /&gt;16.3 32 450 24.25 20 53 5&lt;/P&gt;&lt;P&gt;... more lines&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc nlmixed data=capboy ;&lt;BR /&gt;parms b1=54.021 b2=-12.521 b3=5.445 b4=1.911 b5=0.0699 s2u=0 s2e=1;&lt;BR /&gt;mdl=1.3 + (((b1 + b2*(dbh/hmak)))/(1 + (((b3 + b4*dmak/hmak))*exp( - (b5+u)*dbh))));&lt;BR /&gt;model boy ~ normal(mdl,s2e) &lt;STRONG&gt;OUTmodel=deneme&lt;/STRONG&gt;;&lt;BR /&gt;random u ~ normal(0,s2u) subject=plot out=rp;&lt;BR /&gt;predict mdl out=tahmin;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc nlmixed &lt;STRONG&gt;INmodel=deneme&lt;/STRONG&gt;;&lt;BR /&gt;&lt;STRONG&gt;score data=testdata fitstat;&lt;/STRONG&gt;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 13:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/803559#M39509</guid>
      <dc:creator>ferhatbolat</dc:creator>
      <dc:date>2022-03-23T13:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I apply my nonlinear mixed-effects model to testdata?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/803641#M39510</link>
      <description>&lt;P&gt;The NLMIXED procedure does not support a SCORE statement, nor a STORE statement that would create a model that PROC PLM could score. Therefore, you have to use the "missing value trick" to score data sets. For a discussion of the missing value trick and a complete example, see the following articles:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Introduction and main ideas: &lt;A href="https://blogs.sas.com/content/iml/2014/02/17/the-missing-value-trick-for-scoring-a-regression-model.html" target="_self"&gt;"The missing value trick for scoring a regression model"&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;A second example: &lt;A href="https://blogs.sas.com/content/iml/2018/08/06/score-quantile-regression-sas.html" target="_self"&gt;"How to score and graph a quantile regression model in SAS"&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Neither of the examples use PROC NLMIXED, but I can see from the code you've posted that you have experience with PROC NLMIXED syntax, so I think you'll be able to adapt the ideas to your problem.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 19:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/803641#M39510</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-03-23T19:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I apply my nonlinear mixed-effects model to testdata?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/803755#M39523</link>
      <description>&lt;P&gt;Thank you Rick,&lt;/P&gt;&lt;P&gt;I used "&lt;EM&gt;the missing value trick&lt;/EM&gt;" and predicted the missing values. However, this method gave the predictions of fixed-effects. I need the predictions of random-effects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data score;&lt;BR /&gt;boy=.;&lt;BR /&gt;do plot=143 to 178;&lt;BR /&gt;output;&lt;BR /&gt;run;&lt;BR /&gt;data Combined;&lt;BR /&gt;set capboy&lt;BR /&gt;Score(in=ScoreData);&lt;BR /&gt;run;&lt;BR /&gt;proc nlmixed data=Combined;&lt;BR /&gt;parms b1=54.021 b2=-12.521 b3=5.445 b4=1.911 b5=0.0699 s2u=0.3 s2e=0.5;&lt;BR /&gt;mdl=1.3 + ((((b1+u) + b2*(dbh/hmak)))/(1 + (((b3 + b4*dmak/hmak))*exp( - b5*dbh))));&lt;BR /&gt;model boy ~ normal(mdl,s2e);&lt;BR /&gt;random u ~ normal(0,s2u) subject=plot out=rp;&lt;BR /&gt;predict mdl out=tahmin;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=tahmin(Where= (plot=143));&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 09:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/803755#M39523</guid>
      <dc:creator>ferhatbolat</dc:creator>
      <dc:date>2022-03-24T09:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I apply my nonlinear mixed-effects model to testdata?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/803782#M39524</link>
      <description>&lt;P&gt;The PREDICT statement predicts any expression. Currently, you are predicting mdl, which does not include any random effects.&amp;nbsp; Add a new PREDICT statement such as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;predict mdl+u&amp;nbsp; out=tahminRand;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Or, for more complicated expressions, define a temporary variable in the program that incorporates the random effects. For example:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Pred = mdl + u;&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;predict Pred out=tahminRand;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 12:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/803782#M39524</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-03-24T12:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I apply my nonlinear mixed-effects model to testdata?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/804028#M39554</link>
      <description>&lt;P&gt;Thank you very much Rick for your helps.&lt;/P&gt;&lt;P&gt;I predicted fixed and random effects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 10:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-can-I-apply-my-nonlinear-mixed-effects-model-to-testdata/m-p/804028#M39554</guid>
      <dc:creator>ferhatbolat</dc:creator>
      <dc:date>2022-03-25T10:48:17Z</dc:date>
    </item>
  </channel>
</rss>

