QUANTILE Function

Returns the quantile from a distribution when you specify the left probability (CDF).

Category:Quantile
Returned data type:DOUBLE
See:CDF Function

Syntax

Required Arguments

distribution

is a character constant, variable, or expression that identifies the distribution.

Note: The arguments for each of the QUANTILE distribution functions are identical to those of the corresponding CDF distribution functions.

Here are valid distributions:

Function Examples

Distribution

Argument

Bernoulli

'BERNOULLI'

Beta

'BETA'

Binomial

'BINOMIAL'

Cauchy

'CAUCHY'

Chi-Square

'CHISQUARE'

Conway-Maxwell-Poisson

'CONMAXPOI'

Exponential

'EXPONENTIAL'

F

'F'

Gamma

'GAMMA'

Generalized Poisson

'GENPOISSON'

Geometric

'GEOMETRIC'

Hypergeometric

'HYPERGEOMETRIC'

Laplace

'LAPLACE'

Logistic

'LOGISTIC'

Lognormal

'LOGNORMAL'

Negative binomial

'NEGBINOMIAL'

Normal

'NORMAL'|'GAUSS'

Normal mixture

'NORMALMIX'

Pareto

'PARETO'

Poisson

'POISSON'

T

'T'

Tweedie

'TWEEDIE'

Uniform

'UNIFORM'

Wald (inverse Gaussian)

'WALD'|'IGAUSS'

Weibull

'WEIBULL'

Note: Except for T, F, and NORMALMIX, you can minimally identify any distribution by its first four characters.

probability

is a numeric constant, variable, or expression that specifies the value of a random variable.

parameter-1, …, parameter-k

are optional shape, location, or scale parameters appropriate for the specific distribution.

Details

The QUANTILE function computes the quantile from the specified continuous or discrete distribution, based on the probability value that is provided. For more information, see the individual distributions noted in the table above.

The Conway-Maxwell-Poisson distribution for the QUANTILE function returns the counts value y that is the largest whole number whose CDF value is less than or equal to p. The syntax for the Conway-Maxwell-Poisson distribution in the QUANTILE function has the following form:

QUANTILE('CONMAXPOI',p,λ,ν)
p

is a real number between 0 and 1, inclusively.

λ

is similar to the mean, as in the Poisson distribution.

ν

is a dispersion parameter.

For more information, see “Conway-Maxwell-Poisson” distribution in the PDF function.

Example

The following program illustrates the QUANTILE function:

Note: In this example, DS2 statements are sent to SAS using PROC DS2.
proc ds2;
data _null_;
   dcl double a b c d e f g h i j k l m n o p q r x t;
   method init();
      a=quantile('BERN', .75, .25);
      b=quantile('BETA', 0.1,3,4);
      c=quantile('BINOM',.4, .5, 10);
      d=quantile('CAUCHY', .85);
      e=quantile('CHISQ', .6,11);
      f=quantile('CONMAXPOI',0.2,2.3,.4);
      g=quantile('EXPO', .6);
      h=quantile('F',.8,2,3);
      i=quantile('GAMMA', .4,3);
      j=quantile('GENPOI', .9, 1, .7);
      k=quantile('HYPER', .5, 200, 50, 10);
      l=quantile('LAPLACE', .8);
      m=quantile('LOGISTIC', .7);
      n=quantile('LOGNORMAL', .5);
      o=quantile('NEGB', .5, .5, 2);
      p=quantile('NORMAL', .975);
      q=quantile('NORMALMIX',0.5, 1, 0.2, 1.1,0.1);
      r=quantile('PARETO', .01,1);
      s=quantile('POISSON', .9, 1);
      t=quantile('T', .8, 5);
      u=quantile('TWEEDIE', .8, 5);
      v=quantile('UNIFORM', 0.25);
      w=quantile('WALD', .6, 2);
      x=quantile('WEIBULL', .6, 2);
      put a=;
      put b=;
      put c=;
      put c=;
      put e=;
      put f=;
      put g=;
      put h=;
      put i=;
      put j=;
      put k=;
      put l=;
      put m=;
      put n=;
      put o=;
      put p=;
      put q=;
      put r=;
      put s=;
      put t=;
      put u=;
      put v=;
      put w=;
      put x=;
   end;
enddata;
run;
quit;

SAS writes the following output to the log:

a=0
b=0.2009088788569
c=5
d=1.96261050550515
e=11.5298338409688
f=5
g=0.91629073187415
h=2.88602660731929
i=2.28507690400338
j=9
k=2
l=0.91629073187415
m=0.8472978603872
n=1
o=1
p=1.95996398454005
q=1.1
r=1.01010101010101
s=2
t=0.91954378024082
u=1.26111981969517
v=0.25
w=0.95262099270959
x=0.95723076208099

See Also

Last updated: September 2, 2026