<?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 my error is saying my variable doesn't match the type in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/my-error-is-saying-my-variable-doesn-t-match-the-type/m-p/404321#M66930</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i converted numeric variables into categorical variable.&lt;/P&gt;&lt;P&gt;By far when i check my temporary data called 'forreg' i can see 'Male' equals 1 for Gender.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But When i tried to plot PROC REG it still doesn't allow me to plot&lt;/P&gt;&lt;P&gt;and gives me error, saying:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;150 data forreg;&lt;BR /&gt;151 set new;&lt;BR /&gt;152 KEEP Exam Assign Gender;&lt;BR /&gt;153 IF Gender='Male' then Gender=1; Else Gender=0;&lt;BR /&gt;154 run;&lt;/P&gt;&lt;P&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;153:30 153:45&lt;BR /&gt;NOTE: There were 146 observations read from the data set WORK.NEW.&lt;BR /&gt;NOTE: The data set WORK.FORREG has 146 observations and 3 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;155&lt;BR /&gt;156 TITLE1 'Scatter';&lt;BR /&gt;157 PROC REG data=forreg;&lt;BR /&gt;158 MODEL Exam = Assign Gender /VIF;&lt;BR /&gt;ERROR: Variable GENDER in list does not match type prescribed for this list.&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;159 RUN;&lt;/P&gt;&lt;P&gt;WARNING: No variables specified for an SSCP matrix. Execution terminating.&lt;BR /&gt;NOTE: PROCEDURE REG used (Total process time):&lt;BR /&gt;real time 0.08 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can i plot PROC REG, using my converted dummy variables?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is my code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data forreg;
  set new;
  KEEP Exam Assign Gender;
IF Gender='Male' then Gender=1; Else Gender=0;
run;

TITLE1 'Scatter';
PROC REG data=forreg;
MODEL  Exam = Assign Gender /VIF;
RUN;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 15 Oct 2017 20:13:48 GMT</pubDate>
    <dc:creator>glee217</dc:creator>
    <dc:date>2017-10-15T20:13:48Z</dc:date>
    <item>
      <title>my error is saying my variable doesn't match the type</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/my-error-is-saying-my-variable-doesn-t-match-the-type/m-p/404321#M66930</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i converted numeric variables into categorical variable.&lt;/P&gt;&lt;P&gt;By far when i check my temporary data called 'forreg' i can see 'Male' equals 1 for Gender.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But When i tried to plot PROC REG it still doesn't allow me to plot&lt;/P&gt;&lt;P&gt;and gives me error, saying:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;150 data forreg;&lt;BR /&gt;151 set new;&lt;BR /&gt;152 KEEP Exam Assign Gender;&lt;BR /&gt;153 IF Gender='Male' then Gender=1; Else Gender=0;&lt;BR /&gt;154 run;&lt;/P&gt;&lt;P&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;153:30 153:45&lt;BR /&gt;NOTE: There were 146 observations read from the data set WORK.NEW.&lt;BR /&gt;NOTE: The data set WORK.FORREG has 146 observations and 3 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;155&lt;BR /&gt;156 TITLE1 'Scatter';&lt;BR /&gt;157 PROC REG data=forreg;&lt;BR /&gt;158 MODEL Exam = Assign Gender /VIF;&lt;BR /&gt;ERROR: Variable GENDER in list does not match type prescribed for this list.&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;159 RUN;&lt;/P&gt;&lt;P&gt;WARNING: No variables specified for an SSCP matrix. Execution terminating.&lt;BR /&gt;NOTE: PROCEDURE REG used (Total process time):&lt;BR /&gt;real time 0.08 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can i plot PROC REG, using my converted dummy variables?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is my code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data forreg;
  set new;
  KEEP Exam Assign Gender;
IF Gender='Male' then Gender=1; Else Gender=0;
run;

TITLE1 'Scatter';
PROC REG data=forreg;
MODEL  Exam = Assign Gender /VIF;
RUN;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 15 Oct 2017 20:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/my-error-is-saying-my-variable-doesn-t-match-the-type/m-p/404321#M66930</guid>
      <dc:creator>glee217</dc:creator>
      <dc:date>2017-10-15T20:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: my error is saying my variable doesn't match the type</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/my-error-is-saying-my-variable-doesn-t-match-the-type/m-p/404323#M66931</link>
      <description>&lt;P&gt;Once a variable is character, it never changes to become numeric.&amp;nbsp; As the note in your log indicated, GENDER is still character after these statements:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if gender='Male' then gender=1; else gender=0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be easy enough for you to verify that result by running a PROC CONTENTS on the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create a new variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if gender='Male' then gender_num=1; else gender_num=0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can even end up with a numeric variable named GENDER:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;drop gender;&lt;/P&gt;
&lt;P&gt;rename gender_num=gender;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the original GENDER variable remains character for the duration of its existence.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2017 21:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/my-error-is-saying-my-variable-doesn-t-match-the-type/m-p/404323#M66931</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-10-15T21:02:30Z</dc:date>
    </item>
  </channel>
</rss>

