<?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: question with creating dummy variables. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152917#M40218</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick, I am sorry, your suggestion worked. I just needed to fix another mistake to be able to realize it.&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Dec 2014 05:21:39 GMT</pubDate>
    <dc:creator>woroyire</dc:creator>
    <dc:date>2014-12-17T05:21:39Z</dc:date>
    <item>
      <title>question sas program.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152912#M40213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My assignment consist of creating dummies variables for sex and age and using them in a multiple regression procedure: Here is what I did. I need help finding out why&lt;/P&gt;&lt;P&gt;DUMMIES FOR AGE VARIABLES PRINT ONLY ZEROS.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;My goal is to do a regression analysis using dummy variables for sex and age my attempt is at the end of the program.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; The procedure does not work, I believe it is because of a problem with the dummy variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Thanks for your help.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA REGRESS;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; DO AGE = '6 Mo.','9 Mo.','12 Mo.';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DO SEX = 'M','F';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DO I = 1 to 7;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPEED = INT(RANNOR(451212)*5 + 20 + 4*(AGE EQ '9 Mo.')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + 5*(AGE EQ '12 Mo.') - 8*(SEX EQ 'M'));&lt;/P&gt;&lt;P&gt;&amp;nbsp; Rest_Time = INT(RANUNI(451212)*15 + 200 + 4*(AGE EQ '6 Mo.')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + 5*(AGE EQ '9 Mo.') - 8*(SEX EQ 'F'));&lt;/P&gt;&lt;P&gt;&amp;nbsp; Recovery = INT(RANNOR(451212)*5 + 125 + 4*(AGE EQ '9 Mo.')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + 5*(AGE EQ '12 Mo.') - 8*(SEX EQ 'M'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTPUT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; DROP I;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;&lt;STRONG&gt;***** part of the program I need help with starts here***&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;DATA DUMMIES;&lt;/P&gt;&lt;P&gt;SET REGRESS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF AGE= '6 MO.' THEN AGE1=1; ELSE AGE1=0;&lt;/P&gt;&lt;P&gt;IF AGE ='9 MO.' THEN AGE2=1; ELSE AGE2=0;&lt;/P&gt;&lt;P&gt;IF SEX ='F' THEN FEMALE=1; ELSE FEMALE=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=DUMMIES;&lt;/P&gt;&lt;P&gt;VAR AGE1 AGE2 FEMALE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;REG&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DATA&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; = FINAL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;TITLE&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' REGRESSION WITH SPEED AS DEPENDENT VARIABLE'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;MODEL&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; SPEED = AGE1 AGE2 FEMALE REST_TIME RECOVERY/&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;P&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;R&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 02:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152912#M40213</guid>
      <dc:creator>woroyire</dc:creator>
      <dc:date>2014-12-17T02:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: question with creating dummy variables.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152913#M40214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;String comparisons like &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;IF AGE= '6 M&lt;SPAN style="color: #ff0000;"&gt;O&lt;/SPAN&gt;.' are case sensitive.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you populate the variables you're using mixed case:&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;DO AGE = '6 M&lt;SPAN style="color: #ff0000;"&gt;o&lt;/SPAN&gt;.','9 Mo.','12 Mo.';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get around this by "upcasing" the age variable before the comparison: &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;IF upcase(AGE)= '6 M&lt;SPAN style="color: #ff0000;"&gt;O&lt;/SPAN&gt;.'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 03:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152913#M40214</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-12-17T03:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: question with creating dummy variables.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152914#M40215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, I think in proc reg &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;DUMMIES data set will be used instead of FINAL.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 03:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152914#M40215</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-12-17T03:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: question with creating dummy variables.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152915#M40216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also look into the CLASS statement in some other procs as well, they automatically create categorical variables for you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 04:53:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152915#M40216</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-17T04:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: question with creating dummy variables.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152916#M40217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Patrick and stat@sas. I change the strings to uppercase with no success. What puzzles me is that the variable SEX responds as wanted with 0s and 1s. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 05:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152916#M40217</guid>
      <dc:creator>woroyire</dc:creator>
      <dc:date>2014-12-17T05:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: question with creating dummy variables.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152917#M40218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick, I am sorry, your suggestion worked. I just needed to fix another mistake to be able to realize it.&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 05:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-sas-program/m-p/152917#M40218</guid>
      <dc:creator>woroyire</dc:creator>
      <dc:date>2014-12-17T05:21:39Z</dc:date>
    </item>
  </channel>
</rss>

