<?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 interaction when using proc logistic for data analysis in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-when-using-proc-logistic-for-data-analysis/m-p/163208#M8523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a question about interaction when using proc logistic for data analysis.&amp;nbsp;&amp;nbsp; I have a binary outcome death(0/1) and two binary predictors, MIHP(0/1) and black(0/1).&amp;nbsp; I ran the following codes.&amp;nbsp; To fit a logistic model with interaction between MIHP and black, I do go with two ways as follows.&amp;nbsp; I expect to see exactly the same results in the output of the two ways, but I do not.&amp;nbsp; Can anyone explain why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Way#1: adding MIHP|black to the right hand side of the model statement&lt;/P&gt;&lt;P&gt;Way#2: first creating interaction variablein interact=MIHP*black, then adding MIHP, black, and interact to the rightside of the model statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two ways provide excatly the same model fit statistics (AIC, SC, and -2LogL), but the MLE of the parameters are not the same. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why this happens? Which is the correct one? Or they should be used differently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help,&lt;/P&gt;&lt;P&gt;Zhiying&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Apr 2014 16:33:26 GMT</pubDate>
    <dc:creator>ZhiyingYou</dc:creator>
    <dc:date>2014-04-01T16:33:26Z</dc:date>
    <item>
      <title>interaction when using proc logistic for data analysis</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-when-using-proc-logistic-for-data-analysis/m-p/163208#M8523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a question about interaction when using proc logistic for data analysis.&amp;nbsp;&amp;nbsp; I have a binary outcome death(0/1) and two binary predictors, MIHP(0/1) and black(0/1).&amp;nbsp; I ran the following codes.&amp;nbsp; To fit a logistic model with interaction between MIHP and black, I do go with two ways as follows.&amp;nbsp; I expect to see exactly the same results in the output of the two ways, but I do not.&amp;nbsp; Can anyone explain why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Way#1: adding MIHP|black to the right hand side of the model statement&lt;/P&gt;&lt;P&gt;Way#2: first creating interaction variablein interact=MIHP*black, then adding MIHP, black, and interact to the rightside of the model statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two ways provide excatly the same model fit statistics (AIC, SC, and -2LogL), but the MLE of the parameters are not the same. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why this happens? Which is the correct one? Or they should be used differently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help,&lt;/P&gt;&lt;P&gt;Zhiying&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2014 16:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/interaction-when-using-proc-logistic-for-data-analysis/m-p/163208#M8523</guid>
      <dc:creator>ZhiyingYou</dc:creator>
      <dc:date>2014-04-01T16:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: interaction when using proc logistic for data analysis</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-when-using-proc-logistic-for-data-analysis/m-p/163209#M8524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give more detail? Possibly the data?&amp;nbsp; When I tried this on a toy example, I got the same results for both models:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data junk;&lt;/P&gt;&lt;P&gt; input var1&amp;nbsp; var2&amp;nbsp; DV $ count;&lt;/P&gt;&lt;P&gt; interact = var1*var2;&lt;/P&gt;&lt;P&gt; datalines;&lt;/P&gt;&lt;P&gt; 0&amp;nbsp; 0 0 100&lt;/P&gt;&lt;P&gt; 0&amp;nbsp; 0 1&amp;nbsp; 50&lt;/P&gt;&lt;P&gt; 0&amp;nbsp; 1 0&amp;nbsp; 25&lt;/P&gt;&lt;P&gt; 0&amp;nbsp; 1 1&amp;nbsp; 75&lt;/P&gt;&lt;P&gt; 1&amp;nbsp; 0 0&amp;nbsp; 100&lt;/P&gt;&lt;P&gt; 1 0&amp;nbsp; 1&amp;nbsp; 10&lt;/P&gt;&lt;P&gt; 1 1 0&amp;nbsp; 10&lt;/P&gt;&lt;P&gt; 1 1 1 90&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc logistic data = junk;&lt;/P&gt;&lt;P&gt;&amp;nbsp; model DV = var1 var2 interact;&lt;/P&gt;&lt;P&gt;&amp;nbsp; freq count;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc logistic data = junk;&lt;/P&gt;&lt;P&gt;&amp;nbsp; model DV = var1|var2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; freq count;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2014 22:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/interaction-when-using-proc-logistic-for-data-analysis/m-p/163209#M8524</guid>
      <dc:creator>plf515</dc:creator>
      <dc:date>2014-04-01T22:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: interaction when using proc logistic for data analysis</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-when-using-proc-logistic-for-data-analysis/m-p/163210#M8525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The differences you get are most likely due to differences in parameterisations. Not the same interaction levels are estimated in both fits. Look as this simple example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data cars;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;length ab ba $4;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set sashelp.cars;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;a = cylinders &amp;lt;= 4;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;b = drivetrain = "Front";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cheap = MSRP &amp;lt;= 30000;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ab = cats("a",a,"b",b);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ba = cats("b",b,"a",a);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;title "a|b";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc logistic data=cars;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;class a b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model cheap = a|b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ods output parameterEstimates=a_b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;title "a b ab";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc logistic data=cars;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;class a b ab;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model cheap = a b ab;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ods output parameterEstimates=ab;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;title "a b ba";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc logistic data=cars;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;class a b ba;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model cheap = a b ba;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ods output parameterEstimates=ba;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data parmEstimates;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;length model classVal0 classVal1 $4;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set a_b ab ba indsname=ds;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model = scan(ds,2,".");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where DF &amp;gt; 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;title "Parameter estimates for the three parameterisations";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print data=parmEstimates noobs; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check which levels of &lt;STRONG&gt;a&lt;/STRONG&gt; and &lt;STRONG&gt;b&lt;/STRONG&gt; are estimated in each model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 02:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/interaction-when-using-proc-logistic-for-data-analysis/m-p/163210#M8525</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-04-02T02:38:15Z</dc:date>
    </item>
  </channel>
</rss>

