hdquantile               package:Hmisc               R Documentation

_H_a_r_r_e_l_l-_D_a_v_i_s _D_i_s_t_r_i_b_u_t_i_o_n-_F_r_e_e _Q_u_a_n_t_i_l_e _E_s_t_i_m_a_t_o_r

_D_e_s_c_r_i_p_t_i_o_n:

     Computes the Harrell-Davis (1982) quantile estimator and jacknife
     standard errors of quantiles.  The quantile estimator is a
     weighted linear combination or order statistics in which the order
     statistics used in traditional nonparametric quantile estimators
     are given the greatest weight.  In small samples the H-D estimator
     is more efficient than traditional ones, and the two methods are
     asymptotically equivalent.  The H-D estimator is the limit of a
     bootstrap average as the number of bootstrap resamples becomes
     infinitely large.

_U_s_a_g_e:

     hdquantile(x, probs = seq(0, 1, 0.25),
                se = FALSE, na.rm = FALSE, names = TRUE, weights=FALSE)

_A_r_g_u_m_e_n_t_s:

       x: a numeric vector

   probs: vector of quantiles to compute

      se: set to 'TRUE' to also compute standard errors

   na.rm: set to 'TRUE' to remove 'NA's from 'x' before computing
          quantiles

   names: set to 'FALSE' to prevent names attributions from being added
          to quantiles and standard errors

 weights: set to 'TRUE' to return a '"weights"' attribution with the
          matrix of weights used in the H-D estimator corresponding to
          order statistics, with columns corresponding to quantiles.

_D_e_t_a_i_l_s:

     A Fortran routine is used to compute the jackknife leave-out-one
     quantile estimates.  Standard errors are not computed for
     quantiles 0 or 1 ('NA's are returned).

_V_a_l_u_e:

     A vector of quantiles.  If 'se=TRUE' this vector will have an
     attribute 'se' added to it, containing the standard errors.  If
     'weights=TRUE', also has a '"weights"' attribute which is a
     matrix.

_A_u_t_h_o_r(_s):

     Frank Harrell

_R_e_f_e_r_e_n_c_e_s:

     Harrell FE, Davis CE (1982): A new distribution-free quantile
     estimator.  Biometrika 69:635-640.

     Hutson AD, Ernst MD (2000): The exact bootstrap mean and variance
     of an L-estimator.  J Roy Statist Soc B 62:89-94.

_S_e_e _A_l_s_o:

     'quantile'

_E_x_a_m_p_l_e_s:

     set.seed(1)
     x <- runif(100)
     hdquantile(x, (1:3)/4, se=TRUE)

     ## Not run: 
     # Compare jackknife standard errors with those from the bootstrap
     library(boot)
     boot(x, function(x,i) hdquantile(x[i], probs=(1:3)/4), R=400)
     ## End(Not run)

