Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Functions

PROBMED Function

computes cumulative probabilities for the sample median.

Syntax

PROBMED(n,x)

where

nis the sample size.
xis the point of interest; that is, the PROBMED function calculates the probability that the median is less than or equal to x.

Description

The PROBMED function computes the probability that the sample median is less than or equal to x for a sample of n independent, standard normal random variables (mean 0, variance 1).

Let n represent the sample size and X(i) represent the ith order statistic. Then, when n is odd, the function calculates

\Pr[X_{((n+1)/2)}\leq x] = I_{\Phi(x)} ( \frac{n+1}2,
 \frac{n+1}2 )

where

I_p(a,b) = \frac{1} {B(a,b) }
 \displaystyle \int_0^p t^{a-1}(1-t)^{b-1}\, dt
and B(a,b) = \Gamma(a)\Gamma(b)/\Gamma(a+b), where \Gamma(\cdot)is the gamma function. If n is even, the PROBMED function calculates
{Pr} [ \frac{ X_{(n/2)} + X_{((n/2)+1)} }
 2 \leq x ]
 =
{} \frac 2
 { B(\frac{n}2,\frac{n}2) }
 {\displaystyle \int_{-\infty}^x}
 \{ [1-\Phi(u)]^{n/2}-[1-\Phi(2x-u)]^{n/2} \}
 [\Phi(u)]^{(n/2)-1} \, \phi(u) \, du

where B(n/2,n/2) = [\Gamma(n/2)]^2/ \Gamma(n) and \Phi(\cdot) and \phi(\cdot) are the standard normal cumulative distribution function and density function, respectively.

For more information, refer to David (1981).

Examples

The statements

   data;
      b=probmed(5,-0.1);
      put b;
   run;

result in a value of 0.4256380897.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.