BookmarkSubscribeRSS Feed
ralphbenno
Fluorite | Level 6

having problem to  add a char variable in my var statement.

 

I am doing an analysis of data using age,, gender , and rate of mortality and group of year

 

I want to analyze the mean for group of years for age, gender M, F,C and rate

 

proc mean

class year

var  gender age rate

 

I get an error when I add gender

 

can you help please?

 

 

5 REPLIES 5
PGStats
Opal | Level 21

You got the message

 

ERROR: Variable Gender in list does not match type prescribed for this list.

 

The type prescribed for this list is NUMERIC.

PG
novinosrin
Tourmaline | Level 20

Rule1: classifification variables or categorical variables sre part of Class statement or BY statement if sorted

 

rule2: Analysis variables numeric are part of var statement.

 

Non compliance will result in an error. Hence the case

ChrisNZ
Tourmaline | Level 20

> adding char in var statement

 

What sort of statistics are you going to compute on a CHAR variable?

ralphbenno
Fluorite | Level 6

compute mortality rate for female and male for various year groups

 

I have 9 years group in column 1 female column 2  rate column 3  male column 4 and rate column 5

 

the class is  on year

 female rate

male rate

var has rate

I need to add male and female

 

help?

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 668 views
  • 0 likes
  • 5 in conversation