Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Normality Tests in SAS

Tags:

sas

I'm completely new to SAS and I'm desperate.
So, my code is:

DATA abc;
INPUT AA BB CC DD EE;
CARDS;

;
RUN;  

PROC PRINT DATA = abc;  
TITLE "My_Data";  
RUN;

PROC UNIVARIATE DATA = abc OUTTABLE = Table NOPRINT;  
VAR AA BB CC DD EE;  
RUN;

PROC PRINT DATA = Table LABEL NOOBS;  
TITLE "Univariate Normality Tests per Variable";  
VAR _VAR_ _NORMAL_ _PROBN_;  
LABEL _VAR_ = 'VARIABLE';  
RUN;

I have a problem with the 'Univariate Normality Tests per Variable' table -- it contains zeros. My wish is to have only a table of normality tests statistics for every variable to compare them as it is advised (i.e. here). I've implemented a SAS macro but it contains only one such a test. Please, help me.

like image 582
abc Avatar asked Oct 08 '22 07:10

abc


2 Answers

If you just want the Normality test statistics in one table for all variables, I'd suggest using ODS.

e.g.

ods listing close;
ods output TestsForNormality=NormaliltyTest;
PROC UNIVARIATE DATA = abc normal;  
VAR AA BB CC DD EE;  
RUN;

ods listing;
PROC PRINT DATA = NormaliltyTest LABEL NOOBS;  
TITLE "Univariate Normality Tests per Variable";  
RUN;
like image 137
cmjohns Avatar answered Oct 18 '22 15:10

cmjohns


It appears that you need the NORMAL option in the PROC UNIVARIATE statement.

PROC UNIVARIATE DATA = abc OUTTABLE = Table NORMAL NOPRINT;  
VAR AA BB CC DD EE;  
RUN;

This does not output a test for each variable per test, but it is a start.

PROC UNIVARIATE Documentation

like image 20
Justin Giboney Avatar answered Oct 18 '22 16:10

Justin Giboney