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
- /
- Base SAS Programming
- /
- Regression Output

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

06-21-2017 11:08 AM

Dear All,

In my course of statistics we are using SAS Software.

__One of the exercises is :compute the fitted sales of good for a supermarket that pays 800 euros in promotion , that has a parking, has 800 000 euros as revenues and the price of the goods is 95 cents;__

Using the previous data, i calculated:

Y= 0.555+ 2.042*x1+1.172*x2+1.467*x3-0.856*x4

Y= 0.555+ 2.042*800+1.172*1+1.467*800000-0.856*0.95

Y=1 175 234.5

Next task is:__the regression output has been produced using SAS software. Write the programm to computethis output.__

Could you please help me with this task?

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

Posted in reply to floraminty

06-21-2017 11:25 AM

You can look up the documentation for PROC REG and give it a try yourself. There are examples in the documentation.

--

Paige Miller

Paige Miller

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

Posted in reply to floraminty

06-21-2017 12:03 PM

Here's a list (and code) of the different ways to score a regression model.

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

Posted in reply to Reeza

06-21-2017 12:08 PM

Where?

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

Posted in reply to Reeza

06-21-2017 12:47 PM

http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html

My bad, CTRL + V doesn't always work on this machine

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

Posted in reply to floraminty

06-21-2017 12:52 PM

Do you actually have data? PROC REG fits a model to data. If you don't have data, then you can just write a DATA step that scores the model.

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

Posted in reply to Rick_SAS

06-21-2017 12:56 PM

Rick_SAS wrote:

Sure you can write the code without data, but you can't run it.

--

Paige Miller

Paige Miller

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

Posted in reply to PaigeMiller

06-21-2017 01:02 PM

I see the smiley face, but to clarify for the OP, I use the term "data" to mean observed values that are used to FIT the model. You can EVALUATE the model at any values of the explanatory variables. The values do not need to be observed. For your example, the DATA step is

```
data Want;
input X1-X4;
Y= 0.555+ 2.042*x1+1.172*x2+1.467*x3-0.856*x4;
datalines;
800 1 800000 0.95
;
proc print; run;
```

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

Posted in reply to Rick_SAS

06-21-2017 01:06 PM

Oh, I see, somehow the thread has morphed into scoring (or evaluating) an existing regression model; but that was not the original question. The original question was how to write SAS code to produce the output (regression coefficients and/or a regression model) that the user has provided. The PROC REG code to create these coefficients and estimate the model can of course be written without the data.

--

Paige Miller

Paige Miller

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

Posted in reply to PaigeMiller

06-21-2017 01:09 PM

@PaigeMiller You're correct, the question is ambiguous.

The OP can clarify I assume what h/she needs.