<?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 why the result change in proc logistic in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794643#M38970</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a problem with the result of proc logistic. I use selection= backward in proc logistic and use ods output to see my result. After that I select those var whose pvalue is less than 0.05 and return the result by using outest= in proc logistic. However,&amp;nbsp; the coefficients of the same variables in "paraest" and "betas" are different.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone helps me to figure it out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;ods output ParameterEstimates=paraest;&lt;BR /&gt;proc logistic data=f.train2 desc namelen=40 ;&lt;BR /&gt;class &amp;amp;class_var;&lt;BR /&gt;model ksi= &amp;amp;class_var &amp;amp;reduced/selection=backward fast slstay=.001;&lt;BR /&gt;run;&lt;BR /&gt;ods output close;&lt;/P&gt;&lt;P&gt;%put &amp;amp;class_var &amp;amp;reduced;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data f.paraest;&lt;BR /&gt;set paraest;&lt;BR /&gt;where ProbChiSq&amp;lt;.05;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select distinct variable into:selected separated by " "&lt;BR /&gt;from f.paraest;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select distinct variable into:char separated by " "&lt;BR /&gt;from f.paraest a&lt;BR /&gt;where a.variable in (select name from dictionary.columns&lt;BR /&gt;where upcase(libname)="F" and&lt;BR /&gt;upcase(memname)="TRAIN2" and&lt;BR /&gt;upcase(type)="CHAR");&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;%put &amp;amp;selected;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%put &amp;amp;char;&lt;/P&gt;&lt;P&gt;proc logistic data=f.train2 desc outest=betas namelen=40 ;&lt;BR /&gt;class &amp;amp;char;&lt;BR /&gt;model ksi= &amp;amp;selected/selection=backward slstay=.001;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sat, 05 Feb 2022 02:53:21 GMT</pubDate>
    <dc:creator>heloiee</dc:creator>
    <dc:date>2022-02-05T02:53:21Z</dc:date>
    <item>
      <title>why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794643#M38970</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a problem with the result of proc logistic. I use selection= backward in proc logistic and use ods output to see my result. After that I select those var whose pvalue is less than 0.05 and return the result by using outest= in proc logistic. However,&amp;nbsp; the coefficients of the same variables in "paraest" and "betas" are different.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone helps me to figure it out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;ods output ParameterEstimates=paraest;&lt;BR /&gt;proc logistic data=f.train2 desc namelen=40 ;&lt;BR /&gt;class &amp;amp;class_var;&lt;BR /&gt;model ksi= &amp;amp;class_var &amp;amp;reduced/selection=backward fast slstay=.001;&lt;BR /&gt;run;&lt;BR /&gt;ods output close;&lt;/P&gt;&lt;P&gt;%put &amp;amp;class_var &amp;amp;reduced;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data f.paraest;&lt;BR /&gt;set paraest;&lt;BR /&gt;where ProbChiSq&amp;lt;.05;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select distinct variable into:selected separated by " "&lt;BR /&gt;from f.paraest;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select distinct variable into:char separated by " "&lt;BR /&gt;from f.paraest a&lt;BR /&gt;where a.variable in (select name from dictionary.columns&lt;BR /&gt;where upcase(libname)="F" and&lt;BR /&gt;upcase(memname)="TRAIN2" and&lt;BR /&gt;upcase(type)="CHAR");&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;%put &amp;amp;selected;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%put &amp;amp;char;&lt;/P&gt;&lt;P&gt;proc logistic data=f.train2 desc outest=betas namelen=40 ;&lt;BR /&gt;class &amp;amp;char;&lt;BR /&gt;model ksi= &amp;amp;selected/selection=backward slstay=.001;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 02:53:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794643#M38970</guid>
      <dc:creator>heloiee</dc:creator>
      <dc:date>2022-02-05T02:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794647#M38971</link>
      <description>&lt;P&gt;No idea why you would use the DATA step to select parameters with p&amp;lt;.05 after requiring them to have p&amp;lt;.001 in the LOGISTIC run, but ignoring that, if there are any missing values in any of the unselected candidate variables from the first LOGISTIC run, then the set of observations used in the first run is not the same as the set of observations used in the second run and therefore differences are to be expected. In the first run, any observation that has a missing value on any of the specified variables will be omitted.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 04:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794647#M38971</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-02-05T04:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794648#M38972</link>
      <description>&lt;P&gt;Thanks for your reply. However, the f.train2 dataset is kind of special---- missing value is represented by -1, so I think it's not because of this problem?&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 04:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794648#M38972</guid>
      <dc:creator>heloiee</dc:creator>
      <dc:date>2022-02-05T04:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794649#M38973</link>
      <description>You should never represent missing values with a numeric value because whatever value you use is use in fitting the model. Obviously, the results will change depending on the value you select. If you want to replace missing values, you should use a statistically valid method such as multiple imputation (available in PROC MI).</description>
      <pubDate>Sat, 05 Feb 2022 04:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794649#M38973</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-02-05T04:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794650#M38974</link>
      <description>&lt;P&gt;My bad, I didn't express clearly. Missing value is represented by "-1" in char var.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 04:24:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794650#M38974</guid>
      <dc:creator>heloiee</dc:creator>
      <dc:date>2022-02-05T04:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794651#M38975</link>
      <description>I assume you are saying that if a character CLASS variable is missing then you use a -1 so that -1 becomes another valid level of that CLASS variable. OK, but what about missing values in a numeric variable that isn't a CLASS variable? Also note that you didn't use the FAST method in the second LOGISTIC run like in the first.</description>
      <pubDate>Sat, 05 Feb 2022 04:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794651#M38975</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-02-05T04:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794652#M38976</link>
      <description>&lt;P&gt;Yes, your assumption is correct. That's what I mean. For the numeric variables, there are no missing value. And I tried to add FAST, but the result still looks different from the one in the first Proc Logistic output&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 04:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794652#M38976</guid>
      <dc:creator>heloiee</dc:creator>
      <dc:date>2022-02-05T04:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794653#M38977</link>
      <description>&lt;P&gt;How different?&lt;/P&gt;
&lt;P&gt;Can you replicate the problem using a data set from the SAS sample documentation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not, it's your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can, post the code/log (since data is public) and we can help from there.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 05:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794653#M38977</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-05T05:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794654#M38978</link>
      <description>What happens if you drop all of the junk between the two LOGISTIC runs and just type in the selected variables from the first LOGISTIC into the CLASS and MODEL statements in the second LOGISTIC?</description>
      <pubDate>Sat, 05 Feb 2022 05:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794654#M38978</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-02-05T05:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794678#M38985</link>
      <description>&lt;P&gt;Thank you. I think I solve the problem by deleting some variables which are constants(I just checked the log. I made some missing indicators and there are no missing value for those var. That's my mistake).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 20:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794678#M38985</guid>
      <dc:creator>heloiee</dc:creator>
      <dc:date>2022-02-05T20:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: why the result change in proc logistic</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794679#M38986</link>
      <description>&lt;P&gt;Thanks for your reply. I think I have solved the problem.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 20:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/why-the-result-change-in-proc-logistic/m-p/794679#M38986</guid>
      <dc:creator>heloiee</dc:creator>
      <dc:date>2022-02-05T20:02:28Z</dc:date>
    </item>
  </channel>
</rss>

