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.
I'd really appreciate if anyone could help me.
Thanks in advance.
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.
I'd really appreciate if anyone could help me.
Thanks in advance.
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.
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.
I'd really appreciate if anyone could help me.
Thanks in advance.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.