Turn on suggestions

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

Showing results for

Options

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

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 09-26-2014 09:27 AM
(1678 views)

Dear all,

I wrote a sas/iml code which compute a coefficients matrix of three OLS regressions. (VAR model)

Is it possible to plug in this matrix in VAR model at SAS/STAT in order to calculate the residuals? (residual=y-yhat)

and then the covariance matrix between the residuals?

Usually the SAS regression procedures compute the matrix of the coefficients.

Here I want to give the X, coefficient's matrix and then to compute the residuals.

I'll appreciate any information,

Thanks,

Orit

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Being possible and being a good idea are two different things. Yes, it is possible. However, I agree with that evaluating (scoring) the model in SAS/IML will probably be simpler, since evaluating a model is just matrix multiplication.

If you decide to go the SAS/STAT route, look into PROC SCORE. You would have to write the coefficients to a data set in the form that PROC SCORE could consume, as described here: SAS/STAT(R) 13.1 User's Guide

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If you have already done the calculation of coefficients in PROC IML, then you could easily compute residuals in PROC IML as well. Using SAS/STAT in this situation only complicates things, in my opinion.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

You right in general.

But I have a VAR model which is in my case three equation and can be more.

So it will be really efficient if it is possible to plug in the coefficient matrix into SAS/STAT.

Is it possible?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Without knowing the details of what you are doing, I can't see how it would be more efficient to compute coefficients in IML and then move the coefficients somewhere else for calculation of residuals. You have everything you need already in IML.

But if you must use SAS/STAT, use PROC SCORE.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Being possible and being a good idea are two different things. Yes, it is possible. However, I agree with that evaluating (scoring) the model in SAS/IML will probably be simpler, since evaluating a model is just matrix multiplication.

If you decide to go the SAS/STAT route, look into PROC SCORE. You would have to write the coefficients to a data set in the form that PROC SCORE could consume, as described here: SAS/STAT(R) 13.1 User's Guide

Are you ready for the spotlight? We're accepting content ideas for **SAS Innovate 2025** to be held May 6-9 in Orlando, FL. The call is **open **until September 16. Read more here about **why** you should contribute and **what is in it** for you!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.