turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- change reference level for categorical variable in...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-08-2017 06:03 PM

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

Accepted Solutions

Solution

03-08-2017
06:10 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to d_margiotta

03-08-2017 06:08 PM

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

All Replies

Solution

03-08-2017
06:10 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to d_margiotta

03-08-2017 06:08 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

03-08-2017 06:11 PM

Thanks

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to d_margiotta

11-29-2017 02:18 PM

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!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to abarnett313

11-29-2017 02:26 PM

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

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to d_margiotta

11-29-2017 02:57 PM

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.