<?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 do I build a logistic model for each categorical value of some categorical variable of a dat in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263258#M269201</link>
    <description>&lt;P&gt;If it doesn't work, please post your code AND log.&lt;/P&gt;
&lt;P&gt;You're likely putting something in the wrong place, using a BY statement is the correct answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2016 16:45:21 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-04-12T16:45:21Z</dc:date>
    <item>
      <title>How do I build a logistic model for each categorical value of some categorical variable of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263243#M269196</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=BTS201506 ; 
class Carrier ; 
model DepDelayInd(Descending) = CRSDepTime seqnum DepDelayLagInd DepDelayLag DepDelayLagCum ArrDelayLagInd ArrDelayLag ArrDelayLagCum DepDelayLag2 ArrDelayLag2;
where cancelled=0 ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So basically, Carrier is my categorical variable. I want to partition the dataset based on the values of this categorical variable and then build a logistic regression for each of the values of this categorical variable, Carrier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the code above does not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 16:05:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263243#M269196</guid>
      <dc:creator>junlue</dc:creator>
      <dc:date>2016-04-12T16:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I build a logistic model for each categorical value of some categorical variable of a dat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263246#M269197</link>
      <description>&lt;P&gt;Instead of Class Carrier use By Carrier. This will do a complete separate analysis for each level of Carrier. The data must be sorted by Carrier first though.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 16:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263246#M269197</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-12T16:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I build a logistic model for each categorical value of some categorical variable of a dat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263247#M269198</link>
      <description>&lt;P&gt;But Carrier is a character variable.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 16:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263247#M269198</guid>
      <dc:creator>junlue</dc:creator>
      <dc:date>2016-04-12T16:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I build a logistic model for each categorical value of some categorical variable of a dat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263249#M269199</link>
      <description>&lt;P&gt;When I use By Carrier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is error message&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Variable Carrier should be either numeric or specified in the CLASS statement&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 16:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263249#M269199</guid>
      <dc:creator>junlue</dc:creator>
      <dc:date>2016-04-12T16:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I build a logistic model for each categorical value of some categorical variable of a dat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263254#M269200</link>
      <description>&lt;P&gt;First sort your data set by&amp;nbsp;&lt;SPAN&gt;Carrier then use the sorted data set in logistic regression with&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;By Carrier;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 16:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263254#M269200</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2016-04-12T16:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I build a logistic model for each categorical value of some categorical variable of a dat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263258#M269201</link>
      <description>&lt;P&gt;If it doesn't work, please post your code AND log.&lt;/P&gt;
&lt;P&gt;You're likely putting something in the wrong place, using a BY statement is the correct answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 16:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263258#M269201</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-12T16:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I build a logistic model for each categorical value of some categorical variable of a dat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263283#M269202</link>
      <description>&lt;P&gt;Actually it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My final question is,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"where cancelled = 0"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;statement has no effect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still getting warnings like these in the ouput window:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Note: 2898 observations were deleted due to missing values for the response or explanatory variables."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But that shouldn't be the case because all the missing values are where cancelled = 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By stating where cancelled = 1, i am selecting those observations without missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 17:34:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263283#M269202</guid>
      <dc:creator>junlue</dc:creator>
      <dc:date>2016-04-12T17:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I build a logistic model for each categorical value of some categorical variable of a dat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263384#M269203</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/80100"&gt;@junlue&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Actually it worked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My final question is,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems that the&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"where cancelled = 0"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;statement has no effect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm still getting warnings like these in the ouput window:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Note: 2898 observations were deleted due to missing values for the response or explanatory variables."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But that shouldn't be the case because all the missing values are where cancelled = 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By stating where cancelled = 1, i am selecting those observations without missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try Running this code and see what you get:&lt;/P&gt;
&lt;P&gt;Proc freq data=BTS201506;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; tables cancelled* (DepDelayInd&amp;nbsp; CRSDepTime seqnum DepDelayLagInd DepDelayLag DepDelayLagCum ArrDelayLagInd ArrDelayLag ArrDelayLagCum DepDelayLag2 ArrDelayLag2) / list missing;&lt;CODE class="  language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;See if you have any rows with cancelled=0 and something else missing. Or possibly you really meant to keep cancelled=1??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 03:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263384#M269203</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-13T03:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I build a logistic model for each categorical value of some categorical variable of a dat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263392#M269204</link>
      <description>&lt;P&gt;There was a typo in my previous post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I meant "where cancelled = 0", not 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this was a non-issue and you are right. There are indeed still missing values in for rows with the value of 0 for the cancelled variable&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 04:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263392#M269204</guid>
      <dc:creator>junlue</dc:creator>
      <dc:date>2016-04-13T04:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I build a logistic model for each categorical value of some categorical variable of a dat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263554#M269205</link>
      <description>&lt;P&gt;The procedure, as do most of the regressions, excludes any record with a missing value for the variables on the model statement. It may be that you have some mis-coded variables such as missing should have become 0 or similar that was intended but skipped.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 15:21:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263554#M269205</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-13T15:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I build a logistic model for each categorical value of some categorical variable of a dat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263574#M269206</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/80100"&gt;@junlue﻿&lt;/a&gt;&amp;nbsp;it sounds like you have your question answered. Please mark the appropriate solution as the correct answer.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 16:12:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-build-a-logistic-model-for-each-categorical-value-of/m-p/263574#M269206</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-13T16:12:44Z</dc:date>
    </item>
  </channel>
</rss>

