cp.chisq.test {FunChisq} | R Documentation |
Comparative chi-squared tests on two or more contingency tables. This test does not consider functional dependencies.
cp.chisq.test( x, method=c("chisq", "nchisq", "default", "normalized"), log.p = FALSE )
x |
a list of at least two matrices representing contingency tables of the same dimensionality. |
method |
a character string to specify the method to compute the chi-squared statistic and its p-value. The default is Note: |
log.p |
logical; if |
The comparative chi-squared heterogeneity test determines whether the patterns underlying multiple contingency tables are heterogeneous. Its null test statistic is proved to asymptotically follow the chi-squared distribution (Song et al., 2014; Zhang et al., 2015), different from the widely used chi-squared heterogeneity test (Zar, 2010).
Two methods are provided to compute the chi-squared statistic and its p-value. When method = "chisq"
(or "default"
), the p-value is computed using the chi-squared distribution; when method =
"nchisq"
(or "normalized"
) a normalized statistic is obtained by shifting and scaling the original chi-squared and a p-value is computed using the standard normal distribution (Box et al., 2005). The normalized test is more conservative on the degrees of freedom.
A list with class "htest
" containing the following components:
statistic |
heterogeneity statistic if |
parameter |
degrees of freedom of the chi-squared statistic. |
p.value |
p-value of the comparative chi-squared test. By default, it is computed by the chi-squared distribution ( |
Joe Song
Box, G. E., Hunter, J. S. and Hunter, W. G. (2005) Statistics for Experimenters: Design, Innovation and Discovery, 2nd Ed., New York: Wiley-Interscience.
Song M., Zhang Y., Katzaroff A. J., Edgar B. A. and Buttitta L. (2014) Hunting complex differential gene interaction patterns across molecular contexts. Nucleic Acids Research 42(7), e57. Retrieved from https://nar.oxfordjournals.org/content/42/7/e57.long
Zar, J. H. (2010) Biostatistical Analysis, 5th Ed., New Jersey: Prentice Hall.
Zhang, Y., Liu, Z. L. and Song, M. (2015) ChiNet uncovers rewired transcription subnetworks in tolerant yeast for advanced biofuels conversion. Nucleic Acids Research 43(9), 4393–4407. Retrieved from https://nar.oxfordjournals.org/content/43/9/4393.long
For comparative functional chi-squared test, cp.fun.chisq.test
.
## Not run: x <- matrix(c(4,0,4,0,4,0,1,0,1), 3) y <- t(x) z <- matrix(c(1,0,1,4,0,4,0,4,0), 3) data <- list(x,y,z) cp.chisq.test(data) cp.chisq.test(data, method="nchisq") ## End(Not run)