DATA Step, Macro, Functions and more

I want just one table from UNIVARIATE normaltest

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

I want just one table from UNIVARIATE normaltest

I am trying to get the table with the Shapiro-Wilk in it.

 

The "normaltest" command gives 7 tables, but I just want the one.

 

So if I had to several thousand variables, how could I restrict the output to just table per variable?

 

proc univariate data=my.data normaltest;
where time=0;
var weight;

 

Many thanks.


Accepted Solutions
Solution
‎05-08-2017 01:04 PM
Super User
Posts: 19,851

Re: I want just one table from UNIVARIATE normaltest

See the methods here to capture the results. 

http://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

 

There's also usually an OUTPUT or OUT option in many procs that allow you to capture output. You can review the documentation for the procedure of interest to find the relevant syntax. Univariate has the OUTTABLE option on the PROC UNIVARIATE statement as well as the OUT statement.

https://support.sas.com/documentation/cdl/en/procstat/70116/HTML/default/viewer.htm#procstat_univari...

 

 

OUTTABLE=SAS-data-set

creates an output data set that contains univariate statistics arranged in tabular form, with one observation per analysis variable. See the section OUTTABLE= Output Data Set for details.

 

You may want to look at OUTTABLE

 

View solution in original post


All Replies
Solution
‎05-08-2017 01:04 PM
Super User
Posts: 19,851

Re: I want just one table from UNIVARIATE normaltest

See the methods here to capture the results. 

http://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

 

There's also usually an OUTPUT or OUT option in many procs that allow you to capture output. You can review the documentation for the procedure of interest to find the relevant syntax. Univariate has the OUTTABLE option on the PROC UNIVARIATE statement as well as the OUT statement.

https://support.sas.com/documentation/cdl/en/procstat/70116/HTML/default/viewer.htm#procstat_univari...

 

 

OUTTABLE=SAS-data-set

creates an output data set that contains univariate statistics arranged in tabular form, with one observation per analysis variable. See the section OUTTABLE= Output Data Set for details.

 

You may want to look at OUTTABLE

 

Occasional Contributor
Posts: 7

Re: I want just one table from UNIVARIATE normaltest

proc univariate data=my.data normaltest;
where time=0;
var weight;

 


ODS SELECT 'Tests for Normality';
RUN;

 

This line did what I needed.  Thanks for the lead.

☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 116 views
  • 0 likes
  • 2 in conversation