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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 665 views
  • 1 like
  • 3 in conversation