Programming the statistical procedures from SAS

The CLASS variable has more than two levels

Reply
New User
Posts: 1

The CLASS variable has more than two levels

Hello All, 

I have a problem that I would to to do ttest but the log showed me that "The CLASS variable has more than two levels"

 

proc ttest data=work.two;
class AR;
var IN_1_AMT
title 'TTest 1 - Calculating TTEST for IN_1_AMT AR';
run;

 

please help for this problem

Super User
Posts: 18,583

Re: The CLASS variable has more than two levels

Well, does your class have more than 2 levels? If so, you need proc anova instead. 

Frequent Contributor
Posts: 92

Re: The CLASS variable has more than two levels

Correct as Rezza has mentioned you need to perform ANOVA test in case you have more than 2 class variables.

 

Also please see if ur observations are less than 30 or else you need to use Z test <this scenario is applicable only when we you have 2 class variables else ANOVA is the solution>.

Ask a Question
Discussion stats
  • 2 replies
  • 885 views
  • 1 like
  • 3 in conversation