Proc Univariate Question

Accepted Solution Solved
Reply
Contributor
Posts: 53
Accepted Solution

Proc Univariate Question

Hello all,   I am trying to output a normality test p.Values for further analysis and having some problems with the code below.

 

Q1) Im not sure what pValue is being output with this code, it does not appear to be any one of the for produced on the results page

Q2) Can i force only the Anderson-Darling test to the output?

 

 

proc univariate data=SortedDataIn normal;

	by customer gd apg1 month;
	var total_qty;
	
	output  out=NormalityTest normaltest=pValue;

run;

 


Accepted Solutions
Solution
‎10-12-2015 04:55 PM
SAS Super FREQ
Posts: 3,755

Re: Proc Univariate Question

The NORMALTEST= option produces the value of the test statistic, not the p-value. Use PROBN=pvalue to get the p-value for the Shapiro-Wilk.

 

You can use ODS OUTPUT to get all the statistics in a data set:

ods output TestsForNormality=AllTests;

You can use a WHERE clause to choose the tests that you want to save. For example, to get only the Anderson-Darling, use

ods output TestsForNormality=AllTests(where=(TestLab="A-Sq"));

View solution in original post


All Replies
Solution
‎10-12-2015 04:55 PM
SAS Super FREQ
Posts: 3,755

Re: Proc Univariate Question

The NORMALTEST= option produces the value of the test statistic, not the p-value. Use PROBN=pvalue to get the p-value for the Shapiro-Wilk.

 

You can use ODS OUTPUT to get all the statistics in a data set:

ods output TestsForNormality=AllTests;

You can use a WHERE clause to choose the tests that you want to save. For example, to get only the Anderson-Darling, use

ods output TestsForNormality=AllTests(where=(TestLab="A-Sq"));

Contributor
Posts: 53

Re: Proc Univariate Question

Thank you so much worked like a charm.

Contributor
Posts: 53

Re: Proc Univariate Question

One quick question pertaining to this.  Is there a way to supress the results tab?  When i try the no print option it fails to create the output table and gives me this error

 

WARNING: Output 'Testsfornormality' was not created.  Make sure that the output object name, label, or path is spelled correctly.  
         Also, verify that the appropriate procedure options are used to produce the requested output object.  For example, verify 
         that the NOPRINT option is not used.
SAS Super FREQ
Posts: 3,755

Re: Proc Univariate Question

🔒 This topic is solved and locked.

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

Discussion stats
  • 4 replies
  • 371 views
  • 0 likes
  • 2 in conversation