BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
GDzws
Calcite | Level 5

Dear all

I am having trouble with obtaining a normality test result using the Shapiro-Wilk test.

I perform like this:

proc univariate data=bbbbb;
var Weight_kg_Base Height_m_Base Systolic_BP_mmHg_Base Diastolic_BP_mmHg_Base;
histogram Weight_kg_Base Height_m_Base Systolic_BP_mmHg_Base Diastolic_BP_mmHg_Base / normal;
run;

the sample size is 60. But no Shapiro-Wilk test results in my output interface.

GDzws_0-1659540161124.png

I'd really appreciate if anyone could help me.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Add the NORMAL option to your PROC UNIVARIATE statement.

 

NORMAL
NORMALTEST

requests tests for normality that include a series of goodness-of-fit tests based on the empirical distribution function. The table provides test statistics and p-values for the Shapiro-Wilk test (provided the sample size is less than or equal to 2,000), the Kolmogorov-Smirnov test, the Anderson-Darling test, and the Cramér–von Mises test. This option does not apply if you use a WEIGHT statement.

 


@GDzws wrote:

Dear all

I am having trouble with obtaining a normality test result using the Shapiro-Wilk test.

I perform like this:

proc univariate data=bbbbb;
var Weight_kg_Base Height_m_Base Systolic_BP_mmHg_Base Diastolic_BP_mmHg_Base;
histogram Weight_kg_Base Height_m_Base Systolic_BP_mmHg_Base Diastolic_BP_mmHg_Base / normal;
run;

the sample size is 60. But no Shapiro-Wilk test results in my output interface.

GDzws_0-1659540161124.png

I'd really appreciate if anyone could help me.

 

Thanks in advance.


 

 

View solution in original post

3 REPLIES 3
FreelanceReinh
Jade | Level 19

Hello @GDzws and welcome to the SAS Support Communities!

 

Add the NORMAL option to the PROC UNIVARIATE statement:

proc univariate data=bbbbb normal;

Then you should find the Shapiro-Wilk test results in section "Tests for Normality" of the output (not in the section "Goodness-of-Fit Tests for Normal Distribution") if your sample size is 2000 or less.

GDzws
Calcite | Level 5
You are right. Thank you so much! Really appreciate!
Reeza
Super User

Add the NORMAL option to your PROC UNIVARIATE statement.

 

NORMAL
NORMALTEST

requests tests for normality that include a series of goodness-of-fit tests based on the empirical distribution function. The table provides test statistics and p-values for the Shapiro-Wilk test (provided the sample size is less than or equal to 2,000), the Kolmogorov-Smirnov test, the Anderson-Darling test, and the Cramér–von Mises test. This option does not apply if you use a WEIGHT statement.

 


@GDzws wrote:

Dear all

I am having trouble with obtaining a normality test result using the Shapiro-Wilk test.

I perform like this:

proc univariate data=bbbbb;
var Weight_kg_Base Height_m_Base Systolic_BP_mmHg_Base Diastolic_BP_mmHg_Base;
histogram Weight_kg_Base Height_m_Base Systolic_BP_mmHg_Base Diastolic_BP_mmHg_Base / normal;
run;

the sample size is 60. But no Shapiro-Wilk test results in my output interface.

GDzws_0-1659540161124.png

I'd really appreciate if anyone could help me.

 

Thanks in advance.


 

 

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
  • 2584 views
  • 3 likes
  • 3 in conversation