cp.chisq.test {FunChisq}R Documentation

Comparative Chi-Squared Test for Association Heterogeneity

Description

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

Usage

cp.chisq.test(
  x, method=c("chisq", "nchisq", "default", "normalized"),
  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-squared statistic and its p-value. The default is "chisq". See Details.

Note: "default" and "normalized" are deprecated.

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.

Details

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.

Value

A list with class "htest" containing the following components:

statistic

heterogeneity statistic if method = "chisq" (equivalent to "default"), or normalized statistic if method = "nchisq" (equivalent to "normalized").

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 (method = "chisq" or "default"). If method = "nchisq" (or "normalized"), it is the p-value of the normalized chi-squared statistic using the standard normal distribution.

Author(s)

Joe Song

References

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

See Also

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

Examples

## 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)

[Package FunChisq version 2.4.8-1 Index]