<?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: The CLASS variable has more than two levels. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602994#M174654</link>
    <description>&lt;P&gt;PROC TTEST requires two levels of the class variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have in your code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CLASS GRADE; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and variable GRADE has more than two levels.&lt;/P&gt;</description>
    <pubDate>Sat, 09 Nov 2019 16:53:51 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-11-09T16:53:51Z</dc:date>
    <item>
      <title>The CLASS variable has more than two levels.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602990#M174650</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Exam;
input class grade;
datalines;
0 73
1 86
0 87
1 81
0 78
1 84
0 75
1 88
0 82
1 90
0 66
1 85
0 95
1 84
0 75
1 92
0 70
1 83
1 91
1 53
1 84
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Im brand new to using SAS University addition and im getting this error. please help as this is done the same as in my booklet provided by the teacher. The code above is my data in a table then below we have the code for the T-test&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
 *
 * Task code generated by SAS Studio 3.8 
 *
 * Generated on '09/11/2019 15:59' 
 * Generated by 'sasdemo' 
 * Generated on server 'LOCALHOST' 
 * Generated on SAS platform 'Linux LIN X64 2.6.32-754.6.3.el6.x86_64' 
 * Generated on SAS version '9.04.01M6P11072018' 
 * Generated on browser 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362' 
 * Generated on web client 'http://localhost:10080/SASStudio/38/main?locale=en_GB&amp;amp;zone=GMT%252B00%253A00' 
 *
 */

ods noproctitle;
ods graphics / imagemap=on;

/* Test for normality */
proc univariate data=WORK.EXAM normal mu0=0;
	ods select TestsForNormality;
	class grade;
	var class;
run;

/* t test */
proc ttest data=WORK.EXAM sides=L h0=0 plots(showh0);
	class grade;
	var class;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And this is the Log with the error&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 NOTE: ODS statements in the SAS Studio environment may disable some output features.
 73         
 74         /*
 75          *
 76          * Task code generated by SAS Studio 3.8
 77          *
 78          * Generated on '09/11/2019 15:59'
 79          * Generated by 'sasdemo'
 80          * Generated on server 'LOCALHOST'
 81          * Generated on SAS platform 'Linux LIN X64 2.6.32-754.6.3.el6.x86_64'
 82          * Generated on SAS version '9.04.01M6P11072018'
 83          * Generated on browser 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
 83       ! Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362'
 84          * Generated on web client 'http://localhost:10080/SASStudio/38/main?locale=en_GB&amp;amp;zone=GMT%252B00%253A00'
 85          *
 86          */
 87         
 88         ods noproctitle;
 89         ods graphics / imagemap=on;
 90         
 91         /* Test for normality */
 92         proc univariate data=WORK.EXAM normal mu0=0;
 93         ods select TestsForNormality;
 94         class grade;
 95         var class;
 96         run;
 
 NOTE: PROCEDURE UNIVARIATE used (Total process time):
       real time           1.32 seconds
       cpu time            1.30 seconds
       
 
 97         
 98         /* t test */
 99         proc ttest data=WORK.EXAM sides=L h0=0 plots(showh0);
 100        class grade;
 101        var class;
 102        run;
 
 ERROR: The CLASS variable has more than two levels.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE TTEST used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 103        
 104        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 116        &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 16:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602990#M174650</guid>
      <dc:creator>laurenhosking</dc:creator>
      <dc:date>2019-11-09T16:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: The CLASS variable has more than two levels.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602991#M174651</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/298952"&gt;@laurenhosking&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Exam;
input class grade;
datalines;
0 73
1 86
0 87
1 81
0 78
1 84
0 75
1 88
0 82
1 90
0 66
1 85
0 95
1 84
0 75
1 92
0 70
1 83
1 91
1 53
1 84
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Im brand new to using SAS University addition and im getting this error. please help as this is done the same as in my booklet provided by the teacher&lt;/P&gt;
&lt;P&gt;This is my code above&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The code you posted is a simple data step to create a dataset and CANNOT be the cause of the ERROR. Please post the code that caused the error message, and the complete log from it.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 16:25:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602991#M174651</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-09T16:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: The CLASS variable has more than two levels.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602992#M174652</link>
      <description>&lt;P&gt;You will not get that error from the code you posted.&amp;nbsp; Please show the code you actually ran that produced the error.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 16:26:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602992#M174652</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-09T16:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: The CLASS variable has more than two levels.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602993#M174653</link>
      <description>&lt;P&gt;Just changed thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 16:35:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602993#M174653</guid>
      <dc:creator>laurenhosking</dc:creator>
      <dc:date>2019-11-09T16:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: The CLASS variable has more than two levels.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602994#M174654</link>
      <description>&lt;P&gt;PROC TTEST requires two levels of the class variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have in your code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CLASS GRADE; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and variable GRADE has more than two levels.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 16:53:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602994#M174654</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-09T16:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: The CLASS variable has more than two levels.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602999#M174657</link>
      <description>&lt;P&gt;&amp;nbsp;Could it be that you wanted this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc ttest data=WORK.EXAM sides=L h0=0 plots(showh0);
class class;
var grade;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Nov 2019 17:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/602999#M174657</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-09T17:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: The CLASS variable has more than two levels.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/603028#M174678</link>
      <description>As others have indicated you have your usage of CLASS and VAR backwards. &lt;BR /&gt;CLASS is the grouping variable and VAR is the variable of the observations you want to see are different. So your CLASS variable is conveniently and confusingly class, and your VAR variable is grade.</description>
      <pubDate>Sat, 09 Nov 2019 23:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-CLASS-variable-has-more-than-two-levels/m-p/603028#M174678</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-09T23:45:52Z</dc:date>
    </item>
  </channel>
</rss>

