4.2 C
London
Friday, December 20, 2024
HomeSASDescriptive Statistics in SASSAS: How to Use Proc Univariate for Normality Tests

SAS: How to Use Proc Univariate for Normality Tests

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

You can use proc univariate in SAS with the normal statement to perform several normality tests on a variable in a dataset.

This procedure uses the following basic syntax:

proc univariate data=my_data normal;
    var my_variable;
run;

The following example shows how to use this procedure in practice.

Example: Proc Univariate for Normality Tests in SAS

Suppose we have the following dataset in SAS that contains information about various basketball players:

/*create dataset*/
data my_data;
    input team $ points rebounds;
    datalines;
A 12 8
A 12 8
A 12 8
A 23 9
A 20 12
A 14 7
A 14 7
B 20 2
B 20 5
B 29 4
B 14 7
B 20 2
B 20 2
B 20 5
;
run;

/*view dataset*/
proc print data=my_data;

We can use proc univariate with the normal statement to perform various normality tests on the points variable:

proc univariate data=my_data normal;
    var points;
run;

Several tables will be shown in the output but the one titled Tests for Normality contains the results of the normality tests:

SAS proc univariate normality test

By default, SAS performs four normality tests and displays each of their test statistics and corresponding p-values:

  • Shapiro-Wilk Test: W = .867, p = .0383
  • Kolmogorov-Smirnov Test: D = .237, p = .0318
  • Cramer-von Mises Test: W-Sq = .152, p = .0200
  • Anderson-Darling Test: A-Sq = .847, p = .0223

Each normality test uses the following null and alternative hypotheses:

  • H0: The data are normally distributed.
  • HA: The data are not normally distributed.

Since the p-value for each normality test is less than .05, we would reject the null hypothesis for each normality test.

This means there is sufficient evidence to conclude that the points variable is not normally distributed.

Note that you can also create a histogram with a normal curve overlaid on it to visualize the distribution of values for the points variable:

proc univariate data=my_data;
    histogram points / normal;
run;

From the histogram we can see that the distribution of values doesn’t follow the normal curve very well, which agrees with the results of the normality tests that we performed.

Additional Resources

The following tutorials explain how to perform other common tasks in SAS:

How to Use Proc Summary in SAS
How to Use Proc Tabulate in SAS
How to Use Proc Rank in SAS

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories