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?

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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