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

Dear,
I have to set a multiple linear regression with continuous and categorical variables. 

SAS uses the highest value of a categorical variable as the reference level. How can I change the reference level of a categorical variable? 

Can I use CLASS statement with the REF OPTION (REF=FIRST) in the PROC REG or PROC GLM?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

PROC GLMSELECT allows it. I don't know about the others, but thought they didn't. 

View solution in original post

5 REPLIES 5
Reeza
Super User

PROC GLMSELECT allows it. I don't know about the others, but thought they didn't. 

abarnett313
Calcite | Level 5

Can you use PROC GLMSELECT to perform a standard linear regression? I'm running into the same problem with the reference group for my categorical variables. Thanks!

Reeza
Super User

You can create the dummy variables in many different ways and use PROC REG.

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

 

But otherwise I think you can, this is from the documentation and I'm going to guess the first three sentences are what you need?

 

The GLMSELECT procedure compares most closely to REG and GLM. The REG procedure supports a variety of model-selection methods but does not support a CLASS statement. The GLM procedure supports a CLASS statement but does not include effect selection methods. The GLMSELECT procedure fills this gap. GLMSELECT focuses on the standard independently and identically distributed general linear model for univariate responses and offers great flexibility for and insight into the model selection algorithm. GLMSELECT provides results (displayed tables, output data sets, and macro variables) that make it easy to take the selected model and explore it in more detail in a subsequent procedure such as REG or GLM.

StatDave
SAS Super FREQ

You can use the REF= option in the CLASS statement in PROC GLM. PROC REG does not have a CLASS statement. See this note on the topic for many procedures.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 4500 views
  • 2 likes
  • 4 in conversation