BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Anita_n
Pyrite | Level 9

Hello all,

Am tring to use proc capability to do a test of normal distribution. But since this procedure is very new to me, I will be grateful for any help. Here is my code

proc capability data=sashelp.heart normaltest; 
*CHECKINDICES(test=SW );
var agechddiag;
run;

I only wish to output the Shapiro-Wilk (SW), Kolmogorov-Smirnov (KS) test. I taught I could use the 

CHECKINDICES(test=SW|KS) statements as stated in the sas documentation but I still get all tables outputted. I only need the table with the Normaldistribution. 

 

My second question is how can I output this as a sas table. I used output out= myoutdata but I got 0 observations outputted. 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I don't know why you get all tests when you use CHECKINDICES

 

ods output testsfornormality=tests;

This outputs all tests of normality to data set TESTS. If you don't want certain ones, then you can delete the ones you don't want.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

I don't know why you get all tests when you use CHECKINDICES

 

ods output testsfornormality=tests;

This outputs all tests of normality to data set TESTS. If you don't want certain ones, then you can delete the ones you don't want.

--
Paige Miller
Rick_SAS
SAS Super FREQ

To test the normality of a variable in the data set, use the NORMALTEST option. You will get a table that contains four statistics, including the KS.

 

In addition, the CHECKINDICES option will output a message such as

Warning: Normality is rejected for alpha = 0.05 using the Shapiro-Wilk test

 

proc capability data=sashelp.heart normaltest CHECKINDICES(test=SW );
   var agechddiag;
   specs lsl=40 usl=90;
run; 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 648 views
  • 1 like
  • 3 in conversation