scores               package:outliers               R Documentation

_C_a_l_c_u_l_a_t_e _s_c_o_r_e_s _o_f _t_h_e _s_a_m_p_l_e

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

     This function calculates normal, t, chi-squared, IQR and MAD
     scores of given data.

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

     scores(x, type = c("z", "t", "chisq", "iqr", "mad"), prob = NA, lim = NA)

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

       x: a vector of data. 

    type: "z" calculates normal scores (differences between each value
          and the mean divided by sd), "t" calculates t-Student scores
          (transformed by '(z*sqrt(n-2))/sqrt(z-1-t^2)' formula,
          "chisq" gives chi-squared scores (squares of differences
          between values and mean divided by variance. For the "iqr"
          type, all values lower than first and greater than third
          quartile is considered, and difference between them and
          nearest quartile divided by IQR are calculated. For the
          values between these quartiles, scores are always equal to
          zero. "mad" gives differences between each value and median,
          divided by median absolute deviation.

    prob: If set, the corresponding p-values instead of scores are
          given. If value is set to 1, p-value are returned. Otherwise,
          a logical vector is formed, indicating which values are
          exceeding specified probability. In "z" and "mad" types,
          there is also possibility to set this value to zero, and then
          scores are confirmed to (n-1)/sqrt(n) value, according to 
          Shiffler (1998). The "iqr" type does not support
          probabilities, but "lim" value can be specified.

     lim: This value can be set for "iqr" type of scores, to form
          logical vector, which values has this limit exceeded. 

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

     A vector of scores, probabilities, or logical vector.

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

     Lukasz Komsta

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

     Schiffler, R.E (1998). Maximum Z scores and outliers. Am. Stat.
     42, 1, 79-80.

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

     '\ref{mad}', '\ref{IQR}', '\ref{grubbs.test}',

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

     set.seed(1234)
     x = rnorm(10)
     scores(x)
     scores(x,prob=1)
     scores(x,prob=0.5)
     scores(x,prob=0.1)
     scores(x,prob=0.93)
     scores(x,type="iqr")
     scores(x,type="mad")
     scores(x,prob=0)

