<?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: Is there any real reason to create dummy variables using SAS? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555181#M9614</link>
    <description>&lt;P&gt;There may be automated ways to categorize or group levels together, but I'm not able to think of any now. (If the data was continuous, there are binning methods and clustering methods)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely you would have to combine levels in the code somehow yourself. PROC FORMAT works to combine levels with many procedures, for example using the &lt;FONT face="courier new,courier"&gt;SASHELP.CARS&lt;/FONT&gt; data set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	value $vf 'All'='All' "Front",'Rear'='Other';
run;

proc glm data=sashelp.cars;
	format drivetrain $vf.;
	class drivetrain;
	model invoice=drivetrain;
run;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2019 19:34:26 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-04-30T19:34:26Z</dc:date>
    <item>
      <title>Is there any real reason to create dummy variables using SAS?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555162#M9606</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, is there any real benefit to creating dummy variables from your character variables..if procedures like proc logistic have the CLASS statement and options within proc logistic to just create dummy variables automatically (ie param=ref)?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 18:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555162#M9606</guid>
      <dc:creator>edasdfasdfasdfa</dc:creator>
      <dc:date>2019-04-30T18:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any real reason to create dummy variables using SAS?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555166#M9608</link>
      <description>&lt;P&gt;There are a few procedures that don't generate their own dummy variables (example: PROC OPTMODEL), but most modeling procedures do generate dummy variables internally and so there's no value in doing the work to generate dummy variables for those procedures. I suppose the other reason to do generate your own dummy variables is if you want a specific parameterization of the model that is not provided by the PROC, but I would think that is very rare.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 18:38:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555166#M9608</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-30T18:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any real reason to create dummy variables using SAS?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555175#M9611</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about if you want to reduce the number of levels in a character variable? Is there a way to do that through a procedure or would that require creating less levels manually?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 18:53:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555175#M9611</guid>
      <dc:creator>edasdfasdfasdfa</dc:creator>
      <dc:date>2019-04-30T18:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any real reason to create dummy variables using SAS?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555181#M9614</link>
      <description>&lt;P&gt;There may be automated ways to categorize or group levels together, but I'm not able to think of any now. (If the data was continuous, there are binning methods and clustering methods)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely you would have to combine levels in the code somehow yourself. PROC FORMAT works to combine levels with many procedures, for example using the &lt;FONT face="courier new,courier"&gt;SASHELP.CARS&lt;/FONT&gt; data set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	value $vf 'All'='All' "Front",'Rear'='Other';
run;

proc glm data=sashelp.cars;
	format drivetrain $vf.;
	class drivetrain;
	model invoice=drivetrain;
run;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 19:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555181#M9614</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-30T19:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any real reason to create dummy variables using SAS?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555227#M9633</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/201537"&gt;@edasdfasdfasdfa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about if you want to reduce the number of levels in a character variable? Is there a way to do that through a procedure or would that require creating less levels manually?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Depends on your data how much work might be involved. Consider the following code:&lt;/P&gt;
&lt;PRE&gt;data example;
   input x $;
datalines;
FullSize
FullGas
Fun
Strength
String
Super
;
run;

proc freq data=example;
run;
proc freq data=example;
   format x $3.;
run;
Proc freq data=example;
   format x $2.;
run;
Proc freq data=example;
   format x $1.;
run;&lt;/PRE&gt;
&lt;P&gt;The format applied to a variable for the run of a procedure would control the number of dummy variables created.&lt;/P&gt;
&lt;P&gt;Some data may be easily grouped this way, otherwise you may need multiple formats. And formats&amp;nbsp;are probably better in general than adding different variables.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 21:51:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-there-any-real-reason-to-create-dummy-variables-using-SAS/m-p/555227#M9633</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-30T21:51:17Z</dc:date>
    </item>
  </channel>
</rss>

