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

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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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