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
- /
- Proc reg and reference groups

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
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-09-2015 09:09 AM

Dataset

ID | Y | X1 (Categorical) | X2 (categorical) |
---|---|---|---|

1 | 85 | 2 | 1 |

2 | 156 | 4 | 5 |

3 | 78 | 1 | 8 |

4 | 456 | 3 | 9 |

1) I think by default, proc reg selects the lowest values as the reference variable right? In this case the reference value of X1/X2 will be 1. If I were to run:

Proc reg data=have;

model y=x1 x2;

run;

2) If I wanted the reference value to be 2 for the X1 variable, how do I do it?

Accepted Solutions

Solution

01-09-2015
09:19 AM

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

01-09-2015 09:19 AM

You can't use character or categorical variables in the model statement of PROC REG.

If you want to do this in PROC GLM, the last value alphabetically will have it's coefficient set to zero. Which in general is pretty irrelevant since you can use the TEST or ESTIMATE statement to compare level 2 to any (combination of) other levels.

I assume your actual data set contains more than the 4 observations shown.

All Replies

Solution

01-09-2015
09:19 AM

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

01-09-2015 09:19 AM

You can't use character or categorical variables in the model statement of PROC REG.

If you want to do this in PROC GLM, the last value alphabetically will have it's coefficient set to zero. Which in general is pretty irrelevant since you can use the TEST or ESTIMATE statement to compare level 2 to any (combination of) other levels.

I assume your actual data set contains more than the 4 observations shown.

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

01-09-2015 09:31 AM

Thanks I'll look into Proc GLM. Yes there is more than 4 observations in my dataset shown

Can I use the class statement to set the reference value for Proc GLM?

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

01-09-2015 09:36 AM

You would use the TEST or ESTIMATE statements to compare level 2 to any other level.

Or you can specify the level you want to have coefficient of zero in the CLASS statement.

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

01-12-2015 03:09 PM

Yes, you can set the reference level for CLASS variables in PROC GLM (beginning in SAS 9.3 TS1M2). See this note about setting reference levels.