quantile                package:stats                R Documentation

_S_a_m_p_l_e _Q_u_a_n_t_i_l_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     The generic function 'quantile' produces sample quantiles
     corresponding to the given probabilities. The smallest observation
     corresponds to a probability of 0 and the largest to a probability
     of 1.

_U_s_a_g_e:

     quantile(x, ...)

     ## Default S3 method:
     quantile(x, probs = seq(0, 1, 0.25), na.rm = FALSE,
              names = TRUE, ...)

_A_r_g_u_m_e_n_t_s:

       x: numeric vectors whose sample quantiles are wanted.

   probs: numeric vector with values in [0,1].

   na.rm: logical; if true, any 'NA' and 'NaN''s are removed from 'x'
          before the quantiles are computed.

   names: logical; if true, the result has a 'names' attribute.  Set to
          'FALSE' for speedup with many 'probs'.

     ...: further arguments passed to or from other methods.

_D_e_t_a_i_l_s:

     A vector of length 'length(probs)' is returned; if 'names = TRUE',
     it has a 'names' attribute.

     'quantile(x,p)' as a function of 'p' linearly interpolates the
     points ( (i-1)/(n-1), ox[i] ), where 'ox <- sort(x)' and 'n <-
     length(x)'.

     This gives 'quantile(x, p) == (1-f)*ox[i] + f*ox[i+1]', where 'r
     <- 1 + (n-1)*p', 'i <- floor(r)', 'f <- r - i' _and_ 'ox[n+1] := 
     ox[n]'.

     'NA' and 'NaN' values in 'probs' are propagated to the result.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'ecdf' (in the 'stats' package) for empirical distributions of
     which 'quantile' is the "inverse"; 'boxplot.stats' and 'fivenum'
     for computing "versions" of quartiles, etc.

_E_x_a_m_p_l_e_s:

     quantile(x <- rnorm(1001))# Extremes & Quartiles by default
     quantile(x,  probs=c(.1,.5,1,2,5,10,50, NA)/100)

