5

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.

Community
  • 1
  • 1
abc
  • 167
  • 1
  • 4
  • 18

2 Answers2

3

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;
cmjohns
  • 4,465
  • 17
  • 21
  • cmjohns: thanks a lot :)! now I have the statistics combined! but still there is a lot of tables... – abc Mar 30 '12 at 17:23
  • Yet not a single table but the relevant ones only: `PROC UNIVARIATE DATA = abc NORMALTEST; VAR AA BB CC DD EE; ODS EXCLUDE CIBASIC BASICMEASURES TESTSFORLOCATION EXTREMEOBS MODES MOMENTS QUANTILES; RUN;` – abc Apr 01 '12 at 08:02
1

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

Justin Giboney
  • 3,271
  • 2
  • 19
  • 18
  • Justin thanks for the hints. I'd already probed the manual. I tested your code -- in my hand it didn't provide the statistics in question... I want to suppress the output with the exception of the tests for normality per each variable I have in my dataset. Thanks again – abc Mar 26 '12 at 19:19