variance              package:ifultools              R Documentation

_V_a_r_i_a_n_c_e _c_o_m_p_u_t_a_t_i_o_n, _u_s_a_b_l_e _i_n _b_o_t_h _S-_P_L_U_S _a_n_d _R

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

     A hybrid of S-PLUS and R definitions of the variance function.

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

     variance(x, na.rm=TRUE, unbiased=FALSE)

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

       x: a numeric 'vector', 'matrix', or 'data.frame'.

   na.rm: a logical flag. If 'TRUE', NA values are removed prior to
          computation. Default: 'TRUE'.

unbiased: a logical flag. If 'TRUE', the unbiased sample variance is
          returned. Default: 'FALSE'.

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

     Allows the user to calculate the biased/unbiased variance of the
     input and provides the option to eliminate NA values as well.

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

     the sample variance of the input.

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

     'var'.

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

     set.seed(100)
     x <- rnorm(100)
     variance(x, unbiased=TRUE)
     variance(x, unbiased=FALSE)
     variance(c(x,rep(NA,30)), na.rm=TRUE)

