BookmarkSubscribeRSS Feed
ericageiger
Calcite | Level 5

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! 

 

3 REPLIES 3
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
AlanC
Barite | Level 11

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.

https://github.com/savian-net
Reeza
Super User

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. 

 

 

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
  • 3 replies
  • 1120 views
  • 0 likes
  • 4 in conversation