This example computes univariate statistics for two variables. The following statements create the data set BPressure
, which contains the systolic (Systolic
) and diastolic (Diastolic
) blood pressure readings for 22 patients:
data BPressure; length PatientID $2; input PatientID $ Systolic Diastolic @@; datalines; CK 120 50 SS 96 60 FR 100 70 CP 120 75 BL 140 90 ES 120 70 CP 165 110 JI 110 40 MC 119 66 FC 125 76 RW 133 60 KD 108 54 DS 110 50 JW 130 80 BH 120 65 JW 134 80 SB 118 76 NS 122 78 GS 122 70 AB 122 78 EC 112 62 HH 122 82 ;
The following statements produce descriptive statistics and quantiles for the variables Systolic
and Diastolic
:
title 'Systolic and Diastolic Blood Pressure'; ods select BasicMeasures Quantiles; proc univariate data=BPressure; var Systolic Diastolic; run;
The ODS SELECT statement restricts the output, which is shown in Output 4.1.1, to the "BasicMeasures" and "Quantiles" tables; see the section ODS Table Names. You use the PROC UNIVARIATE statement to request univariate statistics for the variables listed in the VAR statement, which specifies the analysis variables and their order in the output. Formulas for computing the statistics in the "BasicMeasures" table are provided in the section Descriptive Statistics. The quantiles are calculated using Definition 5, which is the default definition; see the section Calculating Percentiles.
A sample program for this example, uniex01.sas, is available in the SAS Sample Library for Base SAS software.
Output 4.1.1: Display Basic Measures and Quantiles
Systolic and Diastolic Blood Pressure |
Basic Statistical Measures | |||
---|---|---|---|
Location | Variability | ||
Mean | 121.2727 | Std Deviation | 14.28346 |
Median | 120.0000 | Variance | 204.01732 |
Mode | 120.0000 | Range | 69.00000 |
Interquartile Range | 13.00000 |
Note: The mode displayed is the smallest of 2 modes with a count of 4. |