BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
chester2018
Obsidian | Level 7

Hi everyone! Hopefully you guys can help me out! Below is the code I run! I was able to run this general code for other categories such as insurance status, smoking status, etc. 

proc logistic data=HHS.EPDS;
	class EPDS_Cat (ref="No");
	model guideline_levels (ref="None") = EPDS_Cat / link = glogit;
run;
But I get this error message: ERROR: Invalid reference value for EPDS_Cat. I'm trying to make the "No" as the reference group. Below is a table of the other categories. 
EPDS_CatFrequencyPercentCumulative
Frequency
Cumulative
Percent
.1793.821793.82
No389683.19407587.02
Yes60812.984683100.00

 

Thanks for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
I noticed your variable "EPDS_Cat" is numeric type.
Try using its original value like : 1 , 2

View solution in original post

4 REPLIES 4
SAS_Rob
SAS Employee

I suggest that you check the formatted value itself.  Likely there is a space after the o in "No".  It has to match exactly.  You could also just use the DESCENDING to get it to use that as the reference.

class EPDS_Cat (descending);
Ksharp
Super User
I noticed your variable "EPDS_Cat" is numeric type.
Try using its original value like : 1 , 2
chester2018
Obsidian | Level 7

Thanks! I realized that SAS made this numeric, when it should've been categorical! I made a quick change and used the value "1" as the reference group!

ballardw
Super User

Absolutely nothing wrong with numeric values for categorical variables. "Category" is a use, not a value.

 

Dichotomous 1/0 valued variables can be much easier to perform some tasks with than character valued (or some odd arbitrary other number pairs).

Consider the SUM of 1/0 valued variable is the number of values=1.

The Mean would be the percentage of 1.

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 638 views
  • 1 like
  • 4 in conversation