moment                 package:e1071                 R Documentation

_S_t_a_t_i_s_t_i_c_a_l _M_o_m_e_n_t

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

     Computes the (optionally centered and/or absolute) sample moment
     of a certain order.

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

     moment(x, order=1, center=FALSE, absolute=FALSE, na.rm=FALSE)

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

       x: a numeric vector containing the values whose moment is to be
          computed.

   order: order of the moment to be computed, the default is to compute
          the first moment, i.e., the mean.

  center: a logical value indicating whether centered moments are to be
          computed.

absolute: a logical value indicating whether absolute moments are to be
          computed.

   na.rm: a logical value indicating whether 'NA' values should be
          stripped before the computation proceeds.

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

     When 'center' and 'absolute' are both 'FALSE', the moment is
     simply 'sum(x ^ order) / length(x)'.

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

     Kurt Hornik and Friedrich Leisch

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

     'mean', 'var'

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

     x <- rnorm(100)

     ## Compute the mean
     moment(x)
     ## Compute the 2nd centered moment (!= var)
     moment(x, order=2, center=TRUE)

     ## Compute the 3rd absolute centered moment
     moment(x, order=3, center=TRUE, absolute=TRUE)

