home *** CD-ROM | disk | FTP | other *** search
-
- _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
-
- chisq.test(x, y = NULL, correct = TRUE,
- p = rep(1/length(x), length(x)))
-
- _A_r_g_u_m_e_n_t_s:
-
- x : a vector or matrix.
-
- y : a vector; ignored if x is a matrix.
-
- correct : a logical indicating whether to apply con-
- tinuity correction when computing the test
- statistic.
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- chisq.test performs chi-square tests on contingency
- tables.
-
- If x is a matrix with one row or column, or if x is a
- vector and y is not given, x is treated as a one-
- dimensional contingency table. In this case, the
- hypothesis tested is whether the population probabili-
- ties equal those in p, or are all equal if p is not
- given.
-
- If x is a matrix with at least two rows and columns, it
- is taken as a two-dimensional contingency table, and
- hence its entries should be nonnegative integers. Oth-
- erwise, x and y must be vectors or factors of the same
- length; incomplete cases are removed, the objects are
- coerced into factor objects, and the contingency table
- is computed from these. Then, Pearson's chi-square
- test of the null that the joint distribution of the
- cell counts in a 2-dimensional contigency table is the
- product of the row and column marginals is performed.
- Continuity correction is only used in the 2-by-2 case
- if correct is TRUE.
-
- _V_a_l_u_e_s:
-
- A list with class "htest" containing the following com-
- ponents:
-
- statistic : the value the chi-square test statistic.
-
- parameter : the degrees of freedom of the approximate chi-
- square distribution of the test statistic.
-
- p.value : the p-value for the test.
-
- method : a character string indicating the type of test
- performed, and whether continuity correction was
- used.
-
- data.name : a character string giving the name(s) of the
- data.
-
- observed : the observed counts.
-
- expected : the expected counts under the null hypothesis.
-
-