home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / ctest / chisq.test < prev    next >
Encoding:
Text File  |  1997-09-13  |  2.2 KB  |  65 lines

  1.     
  2.     _P_e_a_r_s_o_n'_s _C_h_i-_s_q_u_a_r_e _T_e_s_t _f_o_r _C_o_u_n_t _D_a_t_a
  3.     
  4.          chisq.test(x, y = NULL, correct = TRUE,
  5.                     p = rep(1/length(x), length(x)))
  6.     
  7.     _A_r_g_u_m_e_n_t_s:
  8.     
  9.                x : a vector or matrix.
  10.     
  11.                y : a vector; ignored if x is a matrix.
  12.     
  13.          correct : a logical indicating whether to apply con-
  14.                    tinuity correction when computing the test
  15.                    statistic.
  16.     
  17.     _D_e_s_c_r_i_p_t_i_o_n:
  18.     
  19.          chisq.test performs chi-square tests on contingency
  20.          tables.
  21.     
  22.          If x is a matrix with one row or column, or if x is a
  23.          vector and y is not given, x is treated as a one-
  24.          dimensional contingency table.  In this case, the
  25.          hypothesis tested is whether the population probabili-
  26.          ties equal those in p, or are all equal if p is not
  27.          given.
  28.     
  29.          If x is a matrix with at least two rows and columns, it
  30.          is taken as a two-dimensional contingency table, and
  31.          hence its entries should be nonnegative integers.  Oth-
  32.          erwise, x and y must be vectors or factors of the same
  33.          length;  incomplete cases are removed, the objects are
  34.          coerced into factor objects, and the contingency table
  35.          is computed from these.  Then, Pearson's chi-square
  36.          test of the null that the joint distribution of the
  37.          cell counts in a 2-dimensional contigency table is the
  38.          product of the row and column marginals is performed.
  39.          Continuity correction is only used in the 2-by-2 case
  40.          if correct is TRUE.
  41.     
  42.     _V_a_l_u_e_s:
  43.     
  44.          A list with class "htest" containing the following com-
  45.          ponents:
  46.     
  47.     statistic : the value the chi-square test statistic.
  48.     
  49.     parameter : the degrees of freedom of the approximate chi-
  50.               square distribution of the test statistic.
  51.     
  52.     p.value : the p-value for the test.
  53.     
  54.      method : a character string indicating the type of test
  55.               performed, and whether continuity correction was
  56.               used.
  57.     
  58.     data.name : a character string giving the name(s) of the
  59.               data.
  60.     
  61.     observed : the observed counts.
  62.     
  63.     expected : the expected counts under the null hypothesis.
  64.     
  65.