<?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: Linear Discriminate Analysis- Error:TESTCLASS variable length vs Class Varible. in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729846#M35393</link>
    <description>&lt;P&gt;By default, PROC IMPORT looks at the first 20 rows to guess things like length and format, so you can try to add&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;	guessingrows=max;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;before your RUN statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you probably know, for delimited files PROC IMPORT is just a front end to a DATA step. You can see the DATA step code in the log. If you want, you can copy the code and add a LENGTH statement.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Mar 2021 17:15:49 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2021-03-29T17:15:49Z</dc:date>
    <item>
      <title>Linear Discriminate Analysis- Error:TESTCLASS variable length vs Class Varible.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729789#M35384</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run linear discriminant analysis on my data but&amp;nbsp; I am running into this error and I am not sure on how I need fix my data to overcome the error. I am going to attach my raw data:PARKDAT here (80 obs) and my test data:newdata (16 obs). (I am using the most recent version of SAS Studio) This is the code I ran:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Proc Discrim Data=PARKDAT Method=Normal testdata=newdata Pool=Yes&lt;/P&gt;&lt;P&gt;pcov listerr crosslisterr Crossvalidate testlist;&lt;BR /&gt;Class Status;&lt;BR /&gt;Var _NUMERIC_;&lt;BR /&gt;Priors Prop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 13:49:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729789#M35384</guid>
      <dc:creator>wkm21</dc:creator>
      <dc:date>2021-03-29T13:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Linear Discriminate Analysis- Error:TESTCLASS variable length vs Class Varible.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729799#M35385</link>
      <description>&lt;P&gt;It is always best to paste the EXACT error message from the SAS log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am going to guess that the length of the Status variable in the&amp;nbsp;&lt;SPAN&gt;PARKDAT&amp;nbsp;data set is different than the length of the same variable in the NEWDATA data set.&amp;nbsp; You can use PROC CONTENTS to examine the lengths.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 14:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729799#M35385</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-03-29T14:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Linear Discriminate Analysis- Error:TESTCLASS variable length vs Class Varible.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729831#M35388</link>
      <description>&lt;P&gt;Hi Rick&lt;/P&gt;&lt;P&gt;Typically how do you go about fixing that?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 16:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729831#M35388</guid>
      <dc:creator>wkm21</dc:creator>
      <dc:date>2021-03-29T16:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Linear Discriminate Analysis- Error:TESTCLASS variable length vs Class Varible.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729834#M35391</link>
      <description>&lt;P&gt;Have you confirmed that it is the course of the problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best way to fix it is when you import the data. You haven't stated how you read the data into SAS, so I can't say more.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also fix it after importing by using the LENGTH statement. For example,&lt;/P&gt;
&lt;P&gt;data NewData2;&lt;/P&gt;
&lt;P&gt;length Status $13;&lt;/P&gt;
&lt;P&gt;set NewData;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 16:39:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729834#M35391</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-03-29T16:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Linear Discriminate Analysis- Error:TESTCLASS variable length vs Class Varible.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729839#M35392</link>
      <description>Hi Rick&lt;BR /&gt;&lt;BR /&gt;Yes the error that you predicted is correct :&lt;BR /&gt;&lt;BR /&gt;ERROR: The TESTCLASS variable must have the same length as the CLASS variable.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;&lt;BR /&gt;When I import the data this how wrote the code:&lt;BR /&gt;&lt;BR /&gt;FILENAME REFFILE '/home/wkmustahs210/sasuser.v94/testdataParkDAT.csv';&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT DATAFILE=REFFILE&lt;BR /&gt;DBMS=CSV&lt;BR /&gt;OUT=newdata;&lt;BR /&gt;GETNAMES=YES;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;PROC CONTENTS DATA=newdata; RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I used the upload and import function on SAS. I have question about "NewData2". So I run that code and I want to use the NewData2 for LDA analysis will the code be something like this:&lt;BR /&gt;&lt;BR /&gt;Title2 'Linear Discriminant Analysis';&lt;BR /&gt;Proc Discrim Data=PARKDAT Method=Normal testdata=NewData2 Pool=Yes&lt;BR /&gt;pcov listerr crosslisterr Crossvalidate testlist;&lt;BR /&gt;Class Status;&lt;BR /&gt;Var _NUMERIC_;&lt;BR /&gt;Priors Prop;&lt;BR /&gt;&lt;BR /&gt;Run;&lt;BR /&gt;Are there any additional modifications I have to make&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Rose</description>
      <pubDate>Mon, 29 Mar 2021 16:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729839#M35392</guid>
      <dc:creator>wkm21</dc:creator>
      <dc:date>2021-03-29T16:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Linear Discriminate Analysis- Error:TESTCLASS variable length vs Class Varible.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729846#M35393</link>
      <description>&lt;P&gt;By default, PROC IMPORT looks at the first 20 rows to guess things like length and format, so you can try to add&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;	guessingrows=max;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;before your RUN statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you probably know, for delimited files PROC IMPORT is just a front end to a DATA step. You can see the DATA step code in the log. If you want, you can copy the code and add a LENGTH statement.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 17:15:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Linear-Discriminate-Analysis-Error-TESTCLASS-variable-length-vs/m-p/729846#M35393</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-03-29T17:15:49Z</dc:date>
    </item>
  </channel>
</rss>

