BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
altijani
Quartz | Level 8

Hi,

 

I am running a regression model that has 12 variables, and one state variable. For the State variable (numeric), I want to create a Fixed Effect for each State. Thus, I want to include in the model 49 new variables and leave one out as the reference State. How can I create these 49 variables so that I can include them in the model, please? Each oservation should have only one indicator for State. For example, Observation 1 from NY should have all 48 variables equal 0, and equals one for the NY indicator.

I am using SAS Enterprise guide, but can write the code and run it in SAS Base.

 

Thanks,

Altijani

 

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

Easiest method is probably the one described by Rick at: http://blogs.sas.com/content/iml/2016/02/22/create-dummy-variables-in-sas.html

 

Art, CEO, AnalystFinder.com

View solution in original post

1 REPLY 1
art297
Opal | Level 21

Easiest method is probably the one described by Rick at: http://blogs.sas.com/content/iml/2016/02/22/create-dummy-variables-in-sas.html

 

Art, CEO, AnalystFinder.com

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1800 views
  • 2 likes
  • 2 in conversation