What's the easiest way to create monthly dummy variables in SAS Enterprise Guide? I already have a monthly variable 1-12. Thanks!
Ah, with your clarification it's even a bit easier than my original. You have a "Month" var that is set to 1 thru 12 already?
You want to create "monthly dummy variables" but then you say "I already have monthly dummy variables".
I don't understand the request.
Sorry, I just corrected. I have a monthly variable.
I know how to do it using query builder to recode the monthly variable column 11 different times. Surely there is something easier.
Something like this?
claireluen wrote:
I know how to do it using query builder to recode the monthly variable column 11 different times. Surely there is something easier.
I don't know if this is available through Enterprise Guide, but the easiest way I know of the create dummy variables is PROC GLMMOD.
Ah, with your clarification it's even a bit easier than my original. You have a "Month" var that is set to 1 thru 12 already?
And if you want a more "query-friendly" method, create a 12-row reference table (one for each month value). Example DATA step:
Perfect, thanks.
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.