BookmarkSubscribeRSS Feed
Reeza
Super User

@csessa3 wrote:

It's a long story, but the gist is that I have a dataset of medical providers who are listed in multiple states within the dataset. I am going to use the dummy variables to calculate which state they are listed in the most to use this as their "primary" state. 

 

So for example, if doctor A is listed in Florida 2 times and Georgia 1 time, I want to say he is a Florida doctor. 


In a case like this, you shouldn't be solving it with dummy variables. Run a proc freq and get the top count per doctor. 

 

proc freq data=have noprint;
table doctorID*state /out =doc_statecounts;
run;

proc sort data=doc_statecounts;
by doctorID descending count;
run;

proc sort data=doc_statecounts nodupkey out=doc_primarystate;
by doctorID;
run;
mkeintz
PROC Star

My first guess is, especially for the GLM modelling, is that the problem may not be the number of observations, but the number of unique values of STATE (or other class variables).  But given you have not provided the glm model you are estimating (or the logistic) that's only a conjecture.

 

Do you know how many values of STATE you have?  You program assumes it has only two values: 1 and 2.  But SAS is telling you there is at least one other value.  It could be a missing value, or a valid value.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 16 replies
  • 3462 views
  • 2 likes
  • 7 in conversation