<?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: PROC Discriminant Error in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-Discriminant-Error/m-p/232846#M54759</link>
    <description>&lt;P&gt;Seems like your TESTDATA= dataset must contain observations from at least two of your classes. I don't know why.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc discrim data=sashelp.iris outstat=irisstat
             method=normal pool=no;
   class Species;
   var SepalLength SepalWidth PetalLength PetalWidth;
   priors proportional;
run;

proc discrim data=irisstat testdata=sashelp.iris testout=testout;
where species = "Setosa";
class species;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Nov 2015 03:09:19 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2015-11-03T03:09:19Z</dc:date>
    <item>
      <title>PROC Discriminant Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-Discriminant-Error/m-p/232811#M54754</link>
      <description>&lt;P&gt;I am running the PROC Discrim function to do the classification, however I am getting the below error while testing the results.&lt;/P&gt;
&lt;P&gt;Does anyone know what does this mean? I had doublecheckd and ensured that there are more than two classes available in the dependant variable.&lt;/P&gt;
&lt;P&gt;ERROR: At least 2 complete classes are required in DATA= data set or&lt;/P&gt;
&lt;P&gt;BY group.&lt;/P&gt;
&lt;P&gt;Here are the steps I am following.&lt;/P&gt;
&lt;P&gt;Step 1&lt;/P&gt;
&lt;P&gt;~~~~~&lt;/P&gt;
&lt;P&gt;Proc discrim data = test_data outstat=test_result &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;METHOD&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=NORMAL &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;POOL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = no &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CROSSVALIDATE;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;class trend;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;var var1 var2 var3 var4 ; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;PRIORS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;PROPORTIONAL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;RUN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;Step 2 - Here I need to test me previous results in data set &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;~~~~~~&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc discrim data = test_result &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TESTDATA&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=universe_data &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TESTOUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = UNIVPRED;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;class trend;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;var var1 var2 var3 var4 ; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;PRIORS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;PROPORTIONAL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;RUN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;Error : At least 2 complete classes are required in DATA= data set or&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;BY group.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000" face="Courier New" size="3"&gt;I tested keeping the trend blank and keping some dummy names used in the test data, but same error message.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 21:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-Discriminant-Error/m-p/232811#M54754</guid>
      <dc:creator>skallamp</dc:creator>
      <dc:date>2015-11-02T21:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Discriminant Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-Discriminant-Error/m-p/232846#M54759</link>
      <description>&lt;P&gt;Seems like your TESTDATA= dataset must contain observations from at least two of your classes. I don't know why.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc discrim data=sashelp.iris outstat=irisstat
             method=normal pool=no;
   class Species;
   var SepalLength SepalWidth PetalLength PetalWidth;
   priors proportional;
run;

proc discrim data=irisstat testdata=sashelp.iris testout=testout;
where species = "Setosa";
class species;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 03:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-Discriminant-Error/m-p/232846#M54759</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-11-03T03:09:19Z</dc:date>
    </item>
  </channel>
</rss>

