<?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: Estimates from a logistic regression model with bootstraps in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472279#M24580</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/216999"&gt;@LD4224&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I now want to save this model and use it to score an external dataset.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What model? The model of the bootstrap medians?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think you can get this any other way than by hard-coding it, or perhaps by clever use of a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not heard of using the bootstrap medians as the new model.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I derived a logistic regression model in my development set, then used the retained variables&amp;nbsp;in a model statement and ran it in 500 bootstrapped replicates of my development set.&amp;nbsp; I then retrieved the estimates from the ODS ParameterEstimates tables and calculated the medians of the intercepts and beta estimates.&amp;nbsp; (Let me know if anyone disagrees with this approach.)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I assume this means you did some for of stepwise selection (or forward or backward selection) when you fit the original model, and of course, I think then that the bootstrap ought to also do the stepwise and see if different variables are selected, that would be important to know.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, I strenuously object to the title of this post, and almost reported it as spam — MODERATORS can you change the title?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jun 2018 20:27:28 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-06-21T20:27:28Z</dc:date>
    <item>
      <title>Estimates from a logistic regression model with bootstraps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472274#M24579</link>
      <description>&lt;P&gt;Hello -&amp;nbsp; I'm trying to derive and save an unbiased logistic regression model using the outputted estimates from 500 bootstraps.&amp;nbsp; I derived a logistic regression model in my development set, then used the retained variables&amp;nbsp;in a model statement and ran it in 500 bootstrapped replicates of my development set.&amp;nbsp; I then retrieved the estimates from the ODS ParameterEstimates tables and calculated the medians of the intercepts and beta estimates.&amp;nbsp; (Let me know if anyone disagrees with this approach.)&amp;nbsp; I now want to save this model and use it to score an external dataset.&amp;nbsp; I could hard code it, but want the output I could get by using the Score statement in Proc Logisitic.&amp;nbsp; Any help would be appreciated! Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 20:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472274#M24579</guid>
      <dc:creator>LD4224</dc:creator>
      <dc:date>2018-06-21T20:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Estimates from a logistic regression model with bootstraps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472279#M24580</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/216999"&gt;@LD4224&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I now want to save this model and use it to score an external dataset.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What model? The model of the bootstrap medians?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think you can get this any other way than by hard-coding it, or perhaps by clever use of a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not heard of using the bootstrap medians as the new model.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I derived a logistic regression model in my development set, then used the retained variables&amp;nbsp;in a model statement and ran it in 500 bootstrapped replicates of my development set.&amp;nbsp; I then retrieved the estimates from the ODS ParameterEstimates tables and calculated the medians of the intercepts and beta estimates.&amp;nbsp; (Let me know if anyone disagrees with this approach.)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I assume this means you did some for of stepwise selection (or forward or backward selection) when you fit the original model, and of course, I think then that the bootstrap ought to also do the stepwise and see if different variables are selected, that would be important to know.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, I strenuously object to the title of this post, and almost reported it as spam — MODERATORS can you change the title?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 20:27:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472279#M24580</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-21T20:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Estimates from a logistic regression model with bootstraps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472306#M24581</link>
      <description>&lt;P&gt;i dont understand. Is the issue that you just want to avoid hard coding? if so, why not take the median (across bootstraps) from eg univariate and make it a macro variable and then use this as a coefficient in the proc logistic code score statement?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 22:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472306#M24581</guid>
      <dc:creator>pau13rown</dc:creator>
      <dc:date>2018-06-21T22:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Estimates from a logistic regression model with bootstraps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472333#M24582</link>
      <description>Thanks for replying.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;To clarify:&lt;BR /&gt;&lt;BR /&gt;Variable selection was done in the development set using the AIC (stepwise selection, SLENTRY=1 SLSTAY=1). I realize that Harrell and others recommend using bootstrapping for variable selection, but I'm sticking with the stepwise AIC approach.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Using the mean or median of the coefficients obtained in the bootstrapped samples is referred to as "bootstrap aggregating" or "bagging" of coefficients.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It's not that I want to avoid hard scoring. The way I've used Score in the past is as such, which allows me to get the ROC graphs and c statistic for the scored dataset.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PROC LOGISTIC DATA=WORK.BRAIST_SMS;&lt;BR /&gt;CLASS THORACIC (REF='0' PARAM=REF) SMSC2 (REF='1.2' PARAM=REF);&lt;BR /&gt;MODEL VTERM (EVENT='1') = SMSC2 THORACIC COBBMAX;&lt;BR /&gt;&lt;BR /&gt;SCORE DATA=WORK.VALID_SMS OUT=VALIDP OUTROC=VROC;&lt;BR /&gt;ROC;&lt;BR /&gt;&lt;BR /&gt;ROCCONTRAST;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is there a way to take the coefficients from the bootstraps and create something that would function like the "outmodel" does below?&lt;BR /&gt;proc logistic data = hsb2 outmodel=pout;&lt;BR /&gt;model honcomp = read math;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc logistic inmodel=pout;&lt;BR /&gt;&lt;BR /&gt;score clm data = toscore out=pred ;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Ideas?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jun 2018 23:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472333#M24582</guid>
      <dc:creator>LD4224</dc:creator>
      <dc:date>2018-06-21T23:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Estimates from a logistic regression model with bootstraps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472338#M24583</link>
      <description>&lt;P&gt;still not clear to me what youre asking. Consider my original answer ie use a macro variable. You didn't indicate why that wouldn't work - if you did that would help me understand your question. Don't worry about explaining the bootstrap etc, i get that, i just don't know what you want (if it's not what i already assumed)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: re "It's not that I want to avoid hard scoring" [i assume you meant hard coding], clearly you don't want to hard code, otherwise you would do it in 2 seconds, and you said yourself: "I could hard code it, but ...". So that seems to me to be the issue and that's easily solved with a macro variable&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 00:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472338#M24583</guid>
      <dc:creator>pau13rown</dc:creator>
      <dc:date>2018-06-22T00:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Estimates from a logistic regression model with bootstraps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472366#M24585</link>
      <description>Thanks. Can you explain how the maco would function and how I would write it? Or even how I would hard code it? I have looked all over and can't find any examples.&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Jun 2018 03:39:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472366#M24585</guid>
      <dc:creator>LD4224</dc:creator>
      <dc:date>2018-06-22T03:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Estimates from a logistic regression model with bootstraps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472488#M24597</link>
      <description>&lt;P&gt;I assume that whatever you did has left you with a final set of model coefficients that you want to use to score a new data set for the purpose of obtaining the ROC analysis. You can score the data from the coefficients as outlined in&amp;nbsp;section 4 of &lt;A href="http://support.sas.com/kb/33307" target="_self"&gt;this note&lt;/A&gt;. Using the logistic() function as mentioned there to get the predicted probabilities for the new data, you can then use the PRED= option in the SCORE statement as shown in &lt;A href="http://support.sas.com/kb/41364" target="_self"&gt;this note&lt;/A&gt; to get the ROC analysis.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 14:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472488#M24597</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2018-06-22T14:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Estimates from a logistic regression model with bootstraps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472632#M24605</link>
      <description>&lt;P&gt;incidentally, that is what i meant by 'hard coding' ie in that example they simply write out the coefficients. It would be better to define macros variables to minimise the possibility of misspecifying the model i guess. For example, the following type of thing is not uncommon:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc univariate data=....;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var x;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;output out=m1 mean=mean;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data m2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;set m1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;call symput ('mean1', mean);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc nlmixed data=....;&lt;BR /&gt;:&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; estimate 'Treatment A' exp(mu + &amp;amp;mean1.*b1 + 0.5*b2 + b3 + b4);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;estimate 'Treatment B'&amp;nbsp;&amp;nbsp; exp(mu + &amp;amp;mean1.*b1 + 0.5*b2 + b4);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 22:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-from-a-logistic-regression-model-with-bootstraps/m-p/472632#M24605</guid>
      <dc:creator>pau13rown</dc:creator>
      <dc:date>2018-06-22T22:41:03Z</dc:date>
    </item>
  </channel>
</rss>

