<?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: Linear regression with categorical and continuous independent variables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Linear-regression-with-categorical-and-continuous-independent/m-p/715054#M27343</link>
    <description>&lt;P&gt;Technically, if your model is a categorical variable as the independent variable, it's not really regression any more, it's Analysis of Variance, but the idea/concept is the same as regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=have;
    class race;
    model change_in_value=race;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 28 Jan 2021 16:41:47 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-01-28T16:41:47Z</dc:date>
    <item>
      <title>Linear regression with categorical and continuous independent variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Linear-regression-with-categorical-and-continuous-independent/m-p/715038#M27340</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running a linear regression and currently trying to figure out how to properly structure my data set. change_in_value is the dependent variable. All variables before are independent variables. weight and bmi are the only continuous IV's, while the rest are discrete. My goal is to run a regression using each IV in a separate regression model for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input gender race education employment marriage income weight bmi change_in_value;
datalines;
0 1 1 1 0 1 120 25.4 -10
0 1 2 1 0 1 110 23 -5
0 1 2 1 0 1 115 23.5 -7
0 1 3 1 0 1 140 25 5
1 2 3 1 0 2 185 28 -12.5
1 2 2 0 0 2 160 26.5 -14
1 2 2 0 0 2 150 26 -10
1 3 1 0 1 2 140 25.5 5
1 3 4 0 1 3 165 26.5 7
0 4 4 0 1 3 185 27.5 9 
0 4 5 1 1 4 195 29 12
0 5 5 1 0 4 205 29.5 -15
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Gender and employment are simple binary 0/1 variables, which is simple for this process. My main concern is variables such as race that have many levels (5).&amp;nbsp; I understand that a linear regression requires dummy variables to be made, however I am unclear how to do that in SAS, and how to structure dummy variables in general.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone could help me that would be wonderful, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 16:04:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Linear-regression-with-categorical-and-continuous-independent/m-p/715038#M27340</guid>
      <dc:creator>mitrakos</dc:creator>
      <dc:date>2021-01-28T16:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Linear regression with categorical and continuous independent variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Linear-regression-with-categorical-and-continuous-independent/m-p/715054#M27343</link>
      <description>&lt;P&gt;Technically, if your model is a categorical variable as the independent variable, it's not really regression any more, it's Analysis of Variance, but the idea/concept is the same as regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=have;
    class race;
    model change_in_value=race;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jan 2021 16:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Linear-regression-with-categorical-and-continuous-independent/m-p/715054#M27343</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-28T16:41:47Z</dc:date>
    </item>
  </channel>
</rss>

