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?
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.
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
> adding char in var statement
What sort of statistics are you going to compute on a CHAR variable?
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?
gender is a categorical variable and needs to be used as class.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.