<?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 Perform Logistic Regression Using Categorical Variables on SAS Studio? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785476#M32155</link>
    <description>&lt;P&gt;Here's a tutorial for you that you can follow along with - full data is available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_examples02.htm\" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_examples02.htm\&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS, you can leave them as is and include them in both the CLASS and MODEL statement and specify your parameterization method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's all that's needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Base example assuming you have a data set called SAMPLE, categorical variables called Status and YesNo, an outcome called Outcome and continuous variables such as Age and BP.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=sample;
class Status YesNo / PARAM=REF;
model outcome = Age Status YesNo BP;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/409435"&gt;@NairobiTester&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How can I do logistic Regression in SAS Studio (SAS OnDemand for Academics) using categorical variables that have been assigned character values such as yes/no; nothing/low/medium/high; linear or non-linear; success/failed; bachelors/masters/Ph.D. and so on? Kindly help. It has really given me a headache since I'm new to SAS. See below I've attached a file holding the data set that I have to use to do logistic regression.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:46:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-12-10T21:46:20Z</dc:date>
    <item>
      <title>How to Perform Logistic Regression Using Categorical Variables on SAS Studio?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785473#M32154</link>
      <description>&lt;P&gt;How can I do logistic Regression in SAS Studio (SAS OnDemand for Academics) using categorical variables that have been assigned character values such as yes/no; nothing/low/medium/high; linear or non-linear; success/failed; bachelors/masters/Ph.D. and so on? Kindly help. It has really given me a headache since I'm new to SAS. See below I've attached a file holding the data set that I have to use to do logistic regression.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785473#M32154</guid>
      <dc:creator>NairobiTester</dc:creator>
      <dc:date>2021-12-10T21:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Perform Logistic Regression Using Categorical Variables on SAS Studio?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785476#M32155</link>
      <description>&lt;P&gt;Here's a tutorial for you that you can follow along with - full data is available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_examples02.htm\" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_examples02.htm\&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS, you can leave them as is and include them in both the CLASS and MODEL statement and specify your parameterization method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's all that's needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Base example assuming you have a data set called SAMPLE, categorical variables called Status and YesNo, an outcome called Outcome and continuous variables such as Age and BP.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=sample;
class Status YesNo / PARAM=REF;
model outcome = Age Status YesNo BP;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/409435"&gt;@NairobiTester&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How can I do logistic Regression in SAS Studio (SAS OnDemand for Academics) using categorical variables that have been assigned character values such as yes/no; nothing/low/medium/high; linear or non-linear; success/failed; bachelors/masters/Ph.D. and so on? Kindly help. It has really given me a headache since I'm new to SAS. See below I've attached a file holding the data set that I have to use to do logistic regression.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785476#M32155</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-12-10T21:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to Perform Logistic Regression Using Categorical Variables on SAS Studio?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785477#M32156</link>
      <description>&lt;P&gt;As I don't download attachments, I can't see your data. The preferred method to make (a portion of) your data is via &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Logistic regression with categorical variables requires you to list the categorical variable in a CLASS statement. Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=have;
    class categorical_variable1 categorical_variable2;
    model y=categorical_variable1 categorical_variable2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:46:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785477#M32156</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-10T21:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Perform Logistic Regression Using Categorical Variables on SAS Studio?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785510#M32164</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;I'm running the following code but I'm getting an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt; ERROR: Variable NUMBER_OF_SALES_SUPPORT_MATERIAL not found.
 ERROR: Variable WORKED_IN_TOP_COMPANIES not found.
 NOTE: The SAS System stopped processing this step because of errors.
 78         proc logistic data = research.fintech1;
 79            class  number_of_sales_support_material
 80          worked_in_top_companies;
 81            model dependent_company_status= number_of_sales_support_material
 82          worked_in_top_companies number_of_sales_support_material*worked_in_top_companies skills_score
 82       ! percent_skill_entrepreneurship
 83          / expb;
 84         run;
 85         
 86         %web_open_table(RESEARCH.fintech1);
 87         
 88         
 89         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 99         &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help with this. I have already created a library in SAS Studio called RESEARCH and linked it to the fintech1 data set. The data set has the variables I have used in my program as columns. I don't know where I go wrong. Is there something that I'm not doing right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Program&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%web_open_table(RESEARCH.fintech1);

proc logistic data = research.fintech1;
   class  number_of_sales_support_material
 worked_in_top_companies;
   model dependent_company_status= number_of_sales_support_material
 worked_in_top_companies number_of_sales_support_material*worked_in_top_companies skills_score percent_skill_entrepreneurship
 / expb;
run;

%web_open_table(RESEARCH.fintech1);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 05:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785510#M32164</guid>
      <dc:creator>NairobiTester</dc:creator>
      <dc:date>2021-12-11T05:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Perform Logistic Regression Using Categorical Variables on SAS Studio?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785527#M32165</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/409435"&gt;@NairobiTester&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Reeza,&lt;/P&gt;
&lt;P&gt;I'm running the following code but I'm getting an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt; ERROR: Variable NUMBER_OF_SALES_SUPPORT_MATERIAL not found.
 ERROR: Variable WORKED_IN_TOP_COMPANIES not found.
 NOTE: The SAS System stopped processing this step because of errors.
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly help with this. I have already created a library in SAS Studio called RESEARCH and linked it to the fintech1 data set. The data set has the variables I have used in my program as columns. I don't know where I go wrong. Is there something that I'm not doing right?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When SAS says the variable is not found, it is because the variable is not in the data set research.fintech1. So, when you imply that the variables are in the data set, SAS disagrees, and in these situations, I believe SAS. Perhaps you have spelled the names wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check the PROC CONTENTS for data set research.fintech1 and see for yourself.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Perform-Logistic-Regression-Using-Categorical-Variables/m-p/785527#M32165</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-11T11:25:59Z</dc:date>
    </item>
  </channel>
</rss>

