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.
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!
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.