Problem Note 1852: VARSTAT function might return incorrect value for MEDIAN statistic with
an even number of observations
The VARSTAT function in SAS Component Language (SCL) function might
return an incorrect value for the MEDIAN statistic if the data being
used contains an even number of observations.
To circumvent the problem, use PROC UNIVARIATE to compute the MEDIAN
instead. You can write the output from UNIVARIATE to a SAS data set and
read in the value from within SCL code. For example, the following SAS
code uses the UNIVARIATE procedure to calculate the MEDIAN of variable X
and stores it as the value for variable XMED:
proc univariate data=my.data;
var x;
output out=work.median median=xmed;
run;
Operating System and Release Information
| Product Family | Product | System | Reported Release | Fixed Release* |
| SAS System | SAS/AF | OpenVMS Alpha | 8 TS M0 | 8.2 TS2M0 |
| CMS | 8 TS M0 | 8.2 TS2M0 |
| 64-bit Enabled HP-UX | 8 TS M0 | 8.2 TS2M0 |
| HP-UX | 8 TS M0 | 8.2 TS2M0 |
| ABI+ for Intel Architecture | 8 TS M0 | 8.2 TS2M0 |
| z/OS | 8 TS M0 | 8.2 TS2M0 |
| OS/2 | 8 TS M0 | 8.2 TS2M0 |
| IRIX | 8 TS M0 | 8.2 TS2M0 |
| 64-bit Enabled Solaris | 8 TS M0 | 8.2 TS2M0 |
| Microsoft Windows NT Workstation | 8 TS M0 | 8.2 TS2M0 |
| Microsoft Windows 95/98 | 8 TS M0 | 8.2 TS2M0 |
| OpenVMS VAX | 8 TS M0 | 8.2 TS2M0 |
| Microsoft Windows 2000 Professional | 8 TS M0 | 8.2 TS2M0 |
| Solaris | 8 TS M0 | 8.2 TS2M0 |
| 64-bit Enabled AIX | 8 TS M0 | 8.2 TS2M0 |
| Tru64 UNIX | 8 TS M0 | 8.2 TS2M0 |
| AIX | 8 TS M0 | 8.2 TS2M0 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Problem Note |
| Priority: | high |
| Topic: | SAS Reference ==> SCL (SAS Component Language)
|
| Date Modified: | 2000-06-06 16:49:31 |
| Date Created: | 2000-03-20 13:19:06 |