statistic-methods            package:coin            R Documentation

_E_x_t_r_a_c_t _T_e_s_t _S_t_a_t_i_s_t_i_c_s, _L_i_n_e_a_r _S_t_a_t_i_s_t_i_c_s _a_n_d _S_t_a_n_d_a_r_d_i_z_e_d
_S_t_a_t_i_s_t_i_c_s

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

     Extract the test statistic and, possibly multivariate, linear
     statistics in their raw and standardized form from objects of
     class 'IndependenceTest-class'.

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

     statistic(object, type = c("test", "linear", "standardized"), ...)

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

  object: an object inheriting from class 'IndependenceTest-class'.

    type: either 'test' for test statistic, 'linear' for the
          unstandardized linear statistic or 'standardized' for the
          standardized linear statistic.

     ...: further arguments (currently ignored).

_M_e_t_h_o_d_s:

     _s_t_a_t_i_s_t_i_c extracts the specified statistic from 'object'.

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

     df <- data.frame(y = gl(4, 5), x = gl(5, 4))

     ### Cochran-Mantel-Haenzel Test
     ct <- cmh_test(y ~ x, data = df)

     ### chisq-type statistics
     statistic(ct)

     ### the linear statistic, i.e, the contingency table
     statistic(ct, type = "linear")

     ### the same
     table(df$x, df$y)

     ### and the standardized contingency table for illustrating
     ### departures from the null hypothesis of independence of x and y
     statistic(ct, type = "standardized")

