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
- /
- SAS Programming
- /
- General Programming
- /
- Quadratic Regression Clarification

Topic Options

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-09-2015 10:49 AM

Hi, what follows is a question on how to do a certain type of regression in SAS EG, and to clarify conceptuals around the term "quadratic".

Previously: I've been doing linear regression searching out an appropriate line equation to explain a relationship between two variables. To do this I've been going to "Tasks", selecting "Regression", and selecting "Linear Regression". No problem. Based on diagnostic plotting (Q-Q, Residual vs. Fit, and Cook's), and looking at standard transformations, (square root, and Ln), it looks like I'm dealing with a quadratic relationship between the two variables in question. I continually see a fan shaped relationship within my residual vs. fit regardless of transformation tweaks, and this intuitively makes sense when considering what I know about the two variables and how they interact.

Confusion: There seems to be some differences in what I'm finding online when looking at how to do quadratic regression in SAS. Some understand quadratic regression to be a form of non-linear regression, and some understand it as a modified version of linear regression. I assume the latter. A polynomial term–a quadratic (squared) or cubic (cubed) term turns a linear regression model into a curve. But because it is X that is squared or cubed, and not the Beta coefficient, it still qualifies as a linear model. Where would I go within SAS EG to do this?

Question: Where within the SAS EG interface does one do quadratic regression?

From y = a + ß1x

To y = a + ß1x + ß2x^2

Confirmation of my understanding on quadratic regression as well as help figuring out where it is in SAS EG would be most helpful. I would not mind discussing SAS code used to accomplish the same, but prefer to use the Regression "wizard" at this point due to my timeline.

Any help would be greatly appreciated.

NS

Accepted Solutions

Solution

04-10-2015
08:48 AM

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

Posted in reply to GalacticAbacus

04-10-2015 08:48 AM

You are correct that "linear regression" means linear in the (beta) coefficients. Thus there are two ways you can handle this situation:

1) Use a DATA step or a transformation in EG (under Query Builder, Computed Columns) to create a new variable called xSquared which is x**2. Then do the usual linear regression on x and xSquared.

2) For more complicated interactions, use the Generalized Lineasr Regression task. After you specify x as the quantitative variable, click on the Model item in the left box. That takes you to a GUI that you can use to build interactions between variables. In your case, you would click on x and then click the Polynomial button (Degree=2) to the effects x and x*x will appear in the Effects column.

All Replies

Solution

04-10-2015
08:48 AM

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

Posted in reply to GalacticAbacus

04-10-2015 08:48 AM

You are correct that "linear regression" means linear in the (beta) coefficients. Thus there are two ways you can handle this situation:

1) Use a DATA step or a transformation in EG (under Query Builder, Computed Columns) to create a new variable called xSquared which is x**2. Then do the usual linear regression on x and xSquared.

2) For more complicated interactions, use the Generalized Lineasr Regression task. After you specify x as the quantitative variable, click on the Model item in the left box. That takes you to a GUI that you can use to build interactions between variables. In your case, you would click on x and then click the Polynomial button (Degree=2) to the effects x and x*x will appear in the Effects column.

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

Posted in reply to Rick_SAS

04-13-2015 09:09 AM

Thanks Rick, I'll explore the above and report back. I appreciate the aid.

TS

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

Posted in reply to GalacticAbacus

04-16-2015 05:06 PM

Looks like that was what I needed. Thanks again.