<?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: Discrim variables issue in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249653#M13126</link>
    <description>&lt;P&gt;I suspect if you run PROC CONTENTS on your data you will discover that the variables are character:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc&amp;nbsp;contents data = CCData2; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There could be several reasons for this. In Excel, columns have&amp;nbsp;'types' like "General" or "Text." My guess is that your original spreadsheet is using text or something similar. Try using "General" or explicitly setting the columns to "Number". Then rerun the step where you import the excel file into SAS (maybe an import&amp;nbsp;wizard? or PROC IMPORT?).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Region Capture.png" alt="Region Capture.png" src="https://communities.sas.com/t5/image/serverpage/image-id/1868i6E3CCFEA52AECA97/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Feb 2016 13:19:02 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2016-02-12T13:19:02Z</dc:date>
    <item>
      <title>Discrim variables issue</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249578#M13119</link>
      <description>&lt;P&gt;Hey, I am trying to run a proc discrim on an excel file I've imported.&lt;/P&gt;&lt;P&gt;This is the code that I am trying to run:&lt;/P&gt;&lt;PRE&gt;proc discrim data = CCData2;
	class Sample;
	var pH HCO3 Ca Mg Na SO4 Cl Temp Conductivity Flow;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;And this is the error message I get:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;188  proc discrim data = CCData2;
189      class Sample;
190      var pH HCO3 Ca Mg Na SO4 Cl Temp Conductivity Flow;
ERROR: Variable pH in list does not match type prescribed for this list.
ERROR: Variable HCO3 in list does not match type prescribed for this list.
ERROR: Variable Ca in list does not match type prescribed for this list.
ERROR: Variable Mg in list does not match type prescribed for this list.
ERROR: Variable Na in list does not match type prescribed for this list.
ERROR: Variable SO4 in list does not match type prescribed for this list.
ERROR: Variable Cl in list does not match type prescribed for this list.
ERROR: Variable Temp in list does not match type prescribed for this list.
ERROR: Variable Conductivity in list does not match type prescribed for this list.
ERROR: Variable Flow in list does not match type prescribed for this list.
191  run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DISCRIM used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;From what I've read, I think that SAS thinks my variables are numerical values and is trying to run them as such. But I don't know how to change that as I am quite new to SAS.&lt;/P&gt;&lt;P&gt;Any help would be appreciated,&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 02:33:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249578#M13119</guid>
      <dc:creator>BLockwood</dc:creator>
      <dc:date>2016-02-12T02:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Discrim variables issue</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249580#M13120</link>
      <description>&lt;P&gt;Discriminant analysis does require numeric variables, as does the SAS procedure.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your data numeric? If not, then you need to find the appropriate statistical analysis method.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 02:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249580#M13120</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-12T02:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Discrim variables issue</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249586#M13121</link>
      <description>&lt;P&gt;Your variables likely were imported as character. You could use a data step such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data CCData3;
set CCData2;
num_ph = input(pH, best.);
num_HCO3 = input(HCO3, best.);
....
drop ph HCO3 ...;
rename num_ph=pH num_HCO3=HCO3 ....;
run;

proc discrim data = CCData3;
	class Sample;
	var pH HCO3 Ca Mg Na SO4 Cl Temp Conductivity Flow;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Feb 2016 03:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249586#M13121</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-02-12T03:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Discrim variables issue</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249592#M13122</link>
      <description>&lt;P&gt;I ran that and got this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WARNING: Variable num_ph cannot be renamed to pH because pH already exists.
WARNING: Variable num_HCO3 cannot be renamed to HCO3 because HCO3 already exists.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.CCDATA3 may be incomplete.  When this step was stopped there were 0
         observations and 27 variables.
WARNING: Data set WORK.CCDATA3 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 04:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249592#M13122</guid>
      <dc:creator>BLockwood</dc:creator>
      <dc:date>2016-02-12T04:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Discrim variables issue</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249653#M13126</link>
      <description>&lt;P&gt;I suspect if you run PROC CONTENTS on your data you will discover that the variables are character:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc&amp;nbsp;contents data = CCData2; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There could be several reasons for this. In Excel, columns have&amp;nbsp;'types' like "General" or "Text." My guess is that your original spreadsheet is using text or something similar. Try using "General" or explicitly setting the columns to "Number". Then rerun the step where you import the excel file into SAS (maybe an import&amp;nbsp;wizard? or PROC IMPORT?).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Region Capture.png" alt="Region Capture.png" src="https://communities.sas.com/t5/image/serverpage/image-id/1868i6E3CCFEA52AECA97/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 13:19:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249653#M13126</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-02-12T13:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Discrim variables issue</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249766#M13134</link>
      <description>&lt;P&gt;Yeah, you're right. When I ran the proc contents, it shows that they are all characters. However, even when I change the settings to general or numerical in excel and then re-import it, it still says they're characters.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12277iC1648ABCFEF423BD/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;</description>
      <pubDate>Fri, 12 Feb 2016 17:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249766#M13134</guid>
      <dc:creator>BLockwood</dc:creator>
      <dc:date>2016-02-12T17:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Discrim variables issue</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249790#M13135</link>
      <description>&lt;P&gt;Sorry. Make it simpler then...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data CCData3;
set CCData2;
num_ph = input(pH, best.);
num_HCO3 = input(HCO3, best.);
....
run;

proc discrim data = CCData3;
	class Sample;
	var num_:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Feb 2016 18:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249790#M13135</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-02-12T18:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Discrim variables issue</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249792#M13136</link>
      <description>&lt;P&gt;If you are using Proc Import to read XLS or XLSX files then it is a good idea to insure that column headings are on row 1 and only row 1, data starts in row2 and is not blank. A number of blank values for column might result in assigning the value as character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One option is to save the file as CSV and import that. One advantage is that you can use the guessingrows parameter to use more than the default 20 rows of data to determine data type when guessing and "blank" data will be missing so not influencing the choice of numeric or character. The next thing is the procedure generated datastep code that appears in the log that you can examine to see the choices made. if you disagree with the code you can copy and paste it into the editor and change informats, formats and such.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 18:47:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Discrim-variables-issue/m-p/249792#M13136</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-02-12T18:47:15Z</dc:date>
    </item>
  </channel>
</rss>

