Help using Base SAS procedures

The CLASS variable has more than two levels

Accepted Solution Solved
Reply
Contributor
Posts: 69
Accepted Solution

The CLASS variable has more than two levels

Hello

 

I am trying to check t test while I have a variables dl dm dn (profit vs assets in 3 variations) while my class is az. The az is dummy variable with 0 or 1 (1 is a family and 0 is not a family).

 

This is my project:

proc ttest data=sasuser.sasfile120416;

class az;

var dl dm dn;

run;

 

And the answer I got in log is

ERROR: The CLASS variable has more than two levels.

 

I checked and the az is only 1 and 0, so what it could be?

 

Thanks for any help!

 


Accepted Solutions
Solution
‎04-20-2016 06:24 AM
Grand Advisor
Posts: 16,928

Re: The CLASS variable has more than two levels

Any missing values? Is a format applied to variable. 

 

Post output from following:

 

proc freq data=sasuser.sasfile120416;
Format az;
Table az/missing
Run;

View solution in original post


All Replies
Solution
‎04-20-2016 06:24 AM
Grand Advisor
Posts: 16,928

Re: The CLASS variable has more than two levels

Any missing values? Is a format applied to variable. 

 

Post output from following:

 

proc freq data=sasuser.sasfile120416;
Format az;
Table az/missing
Run;
Trusted Advisor
Posts: 1,114

Re: The CLASS variable has more than two levels

@Reeza: Observations with missing values of the CLASS variable would be omitted from the calculations. Also, class levels are determined from the formatted values of the CLASS variable.

 

@yael: Is az a numeric variable or a character variable? Does it have a format (see PROC CONTENTS output)?

 

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 662 views
  • 2 likes
  • 3 in conversation