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
Diamond | Level 26
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 . . .

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1895 views
  • 0 likes
  • 4 in conversation