DATA Step, Macro, Functions and more

Supress all but one statistic in a PROC

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Supress all but one statistic in a PROC

Hello,

I am writing a program and all I want is the Levene's Test statistic in PROC GLM-- I don't need the rest of the output. Is there any way to just extract the Levene's test or suppress everything but the Levene's test? Thanks for any help you could give!

-Charles


Accepted Solutions
Solution
‎09-30-2013 09:55 PM
Trusted Advisor
Posts: 1,253

Re: Supress all but one statistic in a PROC

Hi Charles,

Use the ods select HOVFTest; statement before your PROC GLM code. Be sure to then reset your ODS select to all afterwards.

ods select HOVFTest;
proc glm data=sashelp.cars;
     class make;
     model weight=make;
     means make / hovtest;
run;
quit;
ods select all;

Hope this helps.

Cheers,

Michelle

View solution in original post


All Replies
Solution
‎09-30-2013 09:55 PM
Trusted Advisor
Posts: 1,253

Re: Supress all but one statistic in a PROC

Hi Charles,

Use the ods select HOVFTest; statement before your PROC GLM code. Be sure to then reset your ODS select to all afterwards.

ods select HOVFTest;
proc glm data=sashelp.cars;
     class make;
     model weight=make;
     means make / hovtest;
run;
quit;
ods select all;

Hope this helps.

Cheers,

Michelle

Occasional Contributor
Posts: 14

Re: Supress all but one statistic in a PROC

Thank you, that worked perfectly!  If I wanted to just select the parametric estimates table with the variance inflation factor and my proc reg code looked like this:

REG DATA=&userdata.;

Linear_Regression_Model: MODEL x2 = x3 x4 x5 x6 x7

/VIF;

RUN;

QUIT;

what is the name of the ods output? VIF?  How are you be able to tell what the name of a table in SAS output is?

Thanks again.


Trusted Advisor
Posts: 1,253

Re: Supress all but one statistic in a PROC

You would specify ods trace on; before your proc glm and ods trace off; afterwards and then check the log for the name of the ods table.

For example...

ods trace on;
proc reg data=sashelp.class;
     model weight=height /vif;
run;
quit;
ods trace off;

And in the log you will see the names of the ods tables, so the ParameterEstimates contains the VIF.


Cheers,

Michelle

Occasional Contributor
Posts: 14

Re: Supress all but one statistic in a PROC

Thanks again!!

Respected Advisor
Posts: 2,655

Re: Supress all but one statistic in a PROC

Micelle's answer will (almost) always give you the table names, but the documentation also lists the ODS Table Names, along with required statements or options, under the Details tab.

Steve Denham

Respected Advisor
Posts: 4,659

Re: Supress all but one statistic in a PROC

Use ODS to extract only the statistic you want. Terminate your GLM step by the statements :

proc glm .....

....

   MEANS ... / HOVTEST=LEVENE;

...

   ods select none;

   ods output HOVFTest = ht( where=(probf is not missing) keep=fvalue probf );

run;

   ods select all;

quit;

Dataset ht will contain the F value and probability of Levene's test.

PG

PG
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 437 views
  • 6 likes
  • 4 in conversation