BookmarkSubscribeRSS Feed
CharlesR
Calcite | Level 5
Hello,
I'm using proc logistic and have several categorical variables. The data, though, is numeric, some with corresponding formats, others binary, etc. Is there an easy way to get proc logistic to recognize the variables as categorical? I tried to list them under class, but this didn't work of course since the data is numeric. Do i simply have to reformat the info? How do i do this in an efficient manner?
5 REPLIES 5
deleted_user
Not applicable
CLASS works with numeric or character. However, if you want to group numeric variables into grouped classes you will need to generate a user format. Here is an example:

PROC FORMAT;
value classit low-25 = '-25'
25<-60 = '25 <- 60'
60 - high = '60+'
;
run;

proc logistic data=yourdata descending;
class num_class;
format num_class clasit.;
model whatever = other_numeric | class @ 2;
run; Message was edited by: jonas.bilenas
deleted_user
Not applicable
Hmm, My response looks truncated. Is there a word limit here?
Cynthia_sas
SAS Super FREQ
Hi:
No, no word limit, but special characters like < and > sometimes confuse the forum posting editor...because it uses HTML tags and < and > are looking like HTML and so sometimes pieces of your post get "truncated" while the editor looks for the end of a tag.

Here's the specifics:
http://support.sas.com/forums/thread.jspa?messageID=27609毙

Use the [pre] and [/pre] tags around your code and output in order to maintain indenting and spacing. And, also, use &lt; for < symbol and &gt; for > symbol.

cynthia
CharlesR
Calcite | Level 5
Great. Thanks all! I think i was forgetting to put my values in single quotes. Silly rabbit . . .

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 5 replies
  • 1158 views
  • 0 likes
  • 4 in conversation