Learn R Programming

FunChisq (version 2.3.1)

cp.chisq.test: Comparative Chi-Square Test for Association Heterogeneity

Description

Comparative chi-square tests on two or more contingency tables. This test does not consider functional dependencies.

Usage

cp.chisq.test(x, method = "chisq", log.p = FALSE)

Arguments

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-square statistic and its p-value. The default is "chisq". See Details.
log.p
logical; if TRUE, the p-value is given as log(p). Taking the log improves the accuracy when p-value is close to zero. The default is FALSE.

Value

A list with class "htest" containing the following components:
statistic
heterogeneity chi-square if method = "chisq" (equivalent to "default"), or normalized chi-square if method = "nchisq" (equivalent to "normalized").
parameter
degrees of freedom of the chi-square statistic.
p.value
p-value of the comparative chi-square test. By default, it is computed by the chi-square distribution (method = "chisq" or "default"). If method = "nchisq" (or "normalized"), it is the p-value of the normalized chi-square statistic using the standard normal distribution.

Details

The comparative chi-square heterogeneity test determines whether the patterns underlying multiple contingency tables are heterogeneous. Its null test statistic is proved to asymptotically follow the chi-square distribution (Song et al., 2014; Zhang et al., 2015), different from the widely used chi-square heterogeneity test (Zar, 2010).

Two methods are provided to compute the chi-square statistic and its p-value. When method = "chisq" (or "default"), the p-value is computed using the chi-square distribution; when method = "nchisq" (or "normalized") a normalized chi-square is obtained by shifting and scaling the original chi-square 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.

References

Box, G. E., Hunter, J. S., and Hunter, W. G. (2005). Statistics for Experimenters: Design, Innovation and Discovery, 2nd Edition. Wiley-Interscience, New York.

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 http://nar.oxfordjournals.org/content/42/7/e57.long

Zar, J. H. (2010). Biostatistical Analysis, 5th Edition. Prentice Hall, New Jersey.

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 http://nar.oxfordjournals.org/content/43/9/4393.long

See Also

For comparative functional chi-square test, cp.fun.chisq.test.

Examples

Run this code
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")

Run the code above in your browser using DataLab