DATA Step, Macro, Functions and more

Proc univariate

Reply
Occasional Contributor
Posts: 7

Proc univariate

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! 

 

Respected Advisor
Posts: 2,647

Re: Proc univariate

Posted in reply to ericageiger

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
Regular Contributor
Posts: 150

Re: Proc univariate

Posted in reply to ericageiger

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.

Super User
Posts: 22,820

Re: Proc univariate

Posted in reply to ericageiger

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. 

 

 

Ask a Question
Discussion stats
  • 3 replies
  • 85 views
  • 0 likes
  • 4 in conversation