BookmarkSubscribeRSS Feed
Bal23
Lapis Lazuli | Level 10

based on what I have learned, to create dummy variables, needs to create n-1 level of variables.

however, now I need to create as one variable with several levels.

for example, for agegroup I need to have one as a reference, with each level higher being 1,2,and 3.

 

I remember that I used Stata to create similiar dummy variables, but do not know how to do that with SAS.

Can anybody give advice, or provide reference?

Thanks.

1 REPLY 1
Reeza
Super User

Rick Wicklins blog

http://blogs.sas.com/content/iml/2016/02/22/create-dummy-variables-in-sas.html

 

SAS UCLA

http://www.ats.ucla.edu/stat/sas/faq/dumvars.htm

 

My post - on here ...

https://communities.sas.com/t5/SAS-Statistical-Procedures/How-to-create-dummy-variables-Categorical-...

 

Last, but not least, several proc support the CLASS statement where SAS will deal with creating the dummy variables. Some Procs allow you to specify the reference level and parameterization type, but others don't so make sure to read the docs for the proc you're using. 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1 reply
  • 1185 views
  • 2 likes
  • 2 in conversation