IQR                  package:stats                  R Documentation

_T_h_e _I_n_t_e_r_q_u_a_r_t_i_l_e _R_a_n_g_e

_D_e_s_c_r_i_p_t_i_o_n:

     computes interquartile range of the 'x' values.

_U_s_a_g_e:

     IQR(x, na.rm = FALSE)

_A_r_g_u_m_e_n_t_s:

       x: a numeric vector.

   na.rm: logical. Should missing values be removed?

_D_e_t_a_i_l_s:

     Note that this function computes the quartiles using the
     'quantile' function rather than following Tukey's recommendations,
     i.e., 'IQR(x) = quantile(x,3/4) - quantile(x,1/4)'.

     For normally N(m,1) distributed X, the expected value of 'IQR(X)'
     is '2*qnorm(3/4) = 1.3490', i.e., for a normal-consistent estimate
     of the standard deviation, use 'IQR(x) / 1.349'.

_R_e_f_e_r_e_n_c_e_s:

     Tukey, J. W. (1977). _Exploratory Data Analysis._ Reading:
     Addison-Wesley.

_S_e_e _A_l_s_o:

     'fivenum', 'mad' which is more robust, 'range', 'quantile'.

_E_x_a_m_p_l_e_s:

     data(rivers)
     IQR(rivers)

