Hello,
I am a student trying to perform a proc univariate on my data, however I had to recode my data and now the variables are character variables instead of numeric. I keep getting the ERROR: Variable Diabetes in list does not match type prescribed for this list.
I realize it is due to the fact that it is not in numerical form, but how else would I go about performing this procedure? Or is there a statement needed for SAS to assign the characters to numeric form.
Thank you so much!
How else would you go about performing this procedure?
It's really not clear what you mean, there is no logical way to do something like a PROC UNIVARIATE on character variables. So this is NOT a SAS issue in any way. And you haven't explained what the variable diabetes is, or why you recoded it to character.
Can you please tell us how you are bringing in the data? This is an easy fix but it is easiest to fix coming in vs once it is there.
If your variable is categorical you likely want count summaries instead and that lends itself to PROC FREQ, not PROC UNIVARIATE.
Statistical summaries, such as means/medians don't make sense for a categorical variable.
If you're trying to group your summaries by the categorical variable include it in your CLASS statement.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.