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. 

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 692 views
  • 0 likes
  • 4 in conversation