- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using proc model to perform linear regression and want to apply the so-called White test that checks whether the residuals have constant variance.
Now I want these statistics in a dataset, so that I can use them for later processing, but how?
I have something of the form:
proc model data=dataset;
parms b0 b1;
y = b0 + b1*x;
fit y / white ;
run;
and I am interested in getting the following output values in a dataset:
Do you know how to do that?
Thanks in advance
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
If you put
ODS TRACE ON; in front of your PROC MODEL
, you see the name of all output objects in the LOG.
Suppose the name of the output object you are interested in equals "white_heteroscedasticity".
Then specify just in front of your PROC MODEL:
ODS TRACE OFF;
ODS OUTPUT white_heteroscedasticity=work.my_white_dataset;
That's the way to capture output objects in a data set.
Good luck,
Koen
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
If you put
ODS TRACE ON; in front of your PROC MODEL
, you see the name of all output objects in the LOG.
Suppose the name of the output object you are interested in equals "white_heteroscedasticity".
Then specify just in front of your PROC MODEL:
ODS TRACE OFF;
ODS OUTPUT white_heteroscedasticity=work.my_white_dataset;
That's the way to capture output objects in a data set.
Good luck,
Koen
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
For later reference, I found the following in the log:
Output Added:
-------------
Name: HeteroTest
Label: Heteroscedasticity Test
Template: ets.model.HeteroTest
Path: Model.OLS.HeteroTest
and then used
ods output Model.OLS.HeteroTest=work.HeteroTest;
to write it to a dataset.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @drdee ,
Thanks for having marked this topic as solved.
Concerning:
ods output Model.OLS.HeteroTest=work.HeteroTest;
... I was not even aware you could specify the "Path".
The "Name" should be enough, like
ods output HeteroTest=work.HeteroTest;
Kind regards,
Koen
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You are right of course, thanks.
Best, Dimitri
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Generally, here's some instructions and explanations on how to capture output that is shown.
https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods...
I'm not certain what the table name is from the limited output you've shown but guessing at HETERO test. The blog post above illustrates how to find the table names if needed or they're listed here. I find the ODS TRACE method simpler.
proc model data=dataset;
ods output HeteroTest=want;
parms b0 b1;
y = b0 + b1*x;
fit y / white ;
run;
@drdee wrote:
Hi,
I'm using proc model to perform linear regression and want to apply the so-called White test that checks whether the residuals have constant variance.
Now I want these statistics in a dataset, so that I can use them for later processing, but how?
I have something of the form:
proc model data=dataset;
parms b0 b1;
y = b0 + b1*x;
fit y / white ;
run;
and I am interested in getting the following output values in a dataset:
Do you know how to do that?
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content