<?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 find probability from logistic mixed model, NLMIXED procedure? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810517#M39909</link>
    <description>&lt;P&gt;The way the predicted probability is computed is right there in your NLMIXED code. Plug in the values of your predictors and use the estimated parameter estimates to compute your &lt;STRONG&gt;xb&lt;/STRONG&gt; variable, and then transform it as in the next statement to obtain your&amp;nbsp;&lt;STRONG&gt;prob&lt;/STRONG&gt; variable which is the predicted probability. But I should note that this is just a simple logistic model and there is no reason to go to the trouble of using NLMIXED ... the model is easily fit in PROC LOGISTIC. The OUTPUT statement does the same as the PREDICT statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic;
model metab3=time sex age;
output out=preds p=pred;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You mentioned wanting to compare high and low risk groups, but I don't see anything like a group variable in your model. If you add a group variable in the model, then you can use the LSMEANS statement in PROC LOGISTIC to display the probabilities for the two groups and get a test comparing them by adding to the above statements as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic;
class group / param=glm;
model metab3=group time sex age;
output out=preds p=pred;
lsmeans group / ilink diff;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 29 Apr 2022 00:21:09 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2022-04-29T00:21:09Z</dc:date>
    <item>
      <title>How to find probability from logistic mixed model, NLMIXED procedure?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810497#M39904</link>
      <description>&lt;P&gt;Does anyone know how to calculate the probability based on NLMIXED logit model by plugging in the coefficients or setting it as an average of the whole sample?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 22:15:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810497#M39904</guid>
      <dc:creator>fumikam</dc:creator>
      <dc:date>2022-04-28T22:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to find probability from logistic mixed model, NLMIXED procedure?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810499#M39905</link>
      <description>&lt;P&gt;seems to me that you might need an ESTIMATE statement. Can you provide more information on your PROC NLMIXED program and what you are trying to estimate?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 21:18:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810499#M39905</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2022-04-28T21:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to find probability from logistic mixed model, NLMIXED procedure?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810503#M39906</link>
      <description>Just use the PREDICT statement and specify the name of the variable in your code that is the binomial probability. The PREDICT statement will then provide the predicted probability for each observation in the input data set.</description>
      <pubDate>Thu, 28 Apr 2022 22:00:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810503#M39906</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-04-28T22:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to find probability from logistic mixed model, NLMIXED procedure?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810509#M39907</link>
      <description>Thank you for your reply. Here is my code.&lt;BR /&gt;&lt;BR /&gt;I'm comparing the High metabolic syndrome risk group and the Low risk group.&lt;BR /&gt;&lt;BR /&gt;I found estimates but want to know the probability of the high risk group.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc nlmixed data=myfolder.metab;&lt;BR /&gt;&lt;BR /&gt;parms b0=0 b1=0 b2=0 b3=0;&lt;BR /&gt;&lt;BR /&gt;xb = b0 + b1*time + b2*sex + b3*age;&lt;BR /&gt;&lt;BR /&gt;prob = exp(xb)/(1+exp(xb));&lt;BR /&gt;&lt;BR /&gt;liklhd = (prob**metab3)*((1-prob)**(1-metab3));&lt;BR /&gt;&lt;BR /&gt;ll = log(liklhd);&lt;BR /&gt;&lt;BR /&gt;model metab3 ~ general(ll);&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Apr 2022 23:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810509#M39907</guid>
      <dc:creator>fumikam</dc:creator>
      <dc:date>2022-04-28T23:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to find probability from logistic mixed model, NLMIXED procedure?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810510#M39908</link>
      <description>Thank you for your reply. I used a predict statement and found the mean std&lt;BR /&gt;but I still need how to calculate probability.&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Apr 2022 23:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810510#M39908</guid>
      <dc:creator>fumikam</dc:creator>
      <dc:date>2022-04-28T23:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to find probability from logistic mixed model, NLMIXED procedure?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810517#M39909</link>
      <description>&lt;P&gt;The way the predicted probability is computed is right there in your NLMIXED code. Plug in the values of your predictors and use the estimated parameter estimates to compute your &lt;STRONG&gt;xb&lt;/STRONG&gt; variable, and then transform it as in the next statement to obtain your&amp;nbsp;&lt;STRONG&gt;prob&lt;/STRONG&gt; variable which is the predicted probability. But I should note that this is just a simple logistic model and there is no reason to go to the trouble of using NLMIXED ... the model is easily fit in PROC LOGISTIC. The OUTPUT statement does the same as the PREDICT statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic;
model metab3=time sex age;
output out=preds p=pred;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You mentioned wanting to compare high and low risk groups, but I don't see anything like a group variable in your model. If you add a group variable in the model, then you can use the LSMEANS statement in PROC LOGISTIC to display the probabilities for the two groups and get a test comparing them by adding to the above statements as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic;
class group / param=glm;
model metab3=group time sex age;
output out=preds p=pred;
lsmeans group / ilink diff;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Apr 2022 00:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-find-probability-from-logistic-mixed-model-NLMIXED/m-p/810517#M39909</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-04-29T00:21:09Z</dc:date>
    </item>
  </channel>
</rss>

