The UNIVARIATE Procedure

Example 4.12 Testing for Location

This example, which is a continuation of Example 4.9, illustrates how to carry out three tests for location: the Student’s t test, the sign test, and the Wilcoxon signed rank test. These tests are discussed in the section Tests for Location.

The following statements demonstrate the tests for location by using the Heights data set introduced in Example 4.9. Because the data consists of adult female heights, the researchers are not interested in testing whether the mean of the population is equal to zero inches, which is the default value. Instead, they are interested in testing whether the mean is equal to 66 inches. The following statements test the null hypothesis :

title 'Analysis of Female Height Data';
ods select TestsForLocation LocationCounts;
proc univariate data=Heights mu0=66 loccount;
   var Height;

The ODS SELECT statement restricts the output to the "TestsForLocation" and "LocationCounts" tables; see the section ODS Table Names. The MU0= option specifies the null hypothesis value of for the tests for location; by default, . The LOCCOUNT option produces the table of the number of observations greater than, not equal to, and less than 66 inches.

Output 4.12.1 contains the results of the tests for location. All three tests are highly significant, causing the researchers to reject the hypothesis that the mean is 66 inches.

A sample program for this example,, is available in the SAS Sample Library for Base SAS software.

Output 4.12.1: Tests for Location with MU0=66 and LOCCOUNT

Analysis of Female Height Data

The UNIVARIATE Procedure
Variable: Height (Height (in))

Tests for Location: Mu0=66
Test Statistic p Value
Student's t t -5.67065 Pr > |t| <.0001
Sign M -20 Pr >= |M| <.0001
Signed Rank S -849 Pr >= |S| <.0001

Location Counts: Mu0=66.00
Count Value
Num Obs > Mu0 16
Num Obs ^= Mu0 72
Num Obs < Mu0 56