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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1937 views
  • 2 likes
  • 2 in conversation