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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2065 views
  • 3 likes
  • 3 in conversation