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
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
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
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
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
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 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.