marginal.change.test {DiffXTables}R Documentation

Test for Marginal Change Across Contingency Tables

Description

The test detects change in either row or column marginal distributions across given contingency tables.

Usage

  marginal.change.test(tables)

Arguments

tables

a list of at least two non-negative matrices or data frames representing contingency tables of the same dimensions.

Details

The marginal change test determines whether the patterns underlying multiple input contingency tables have changed row or column marginal distributions. Its test statistic is proved to asymptotically follow the chi-squared distribution under the null hypothesis of same row and marginal distributions across tables (Sharma et al. 2020).

The test statistic is minimized to zero if and only if observed row marginal distributions are the same across tables and so do the column marginal distributions.

Value

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

statistic

the chi-squared test statistic.

parameter

the degrees of freedom of the null chi-squared distribution.

p.value

the p-value for the test, computed using the chi-squared distribution.

Author(s)

Ruby Sharma and Joe Song

References

Sharma R, Luo X, Kumar S, Song M (2020). “Three Co-Expression Pattern Types across Microbial Transcriptional Networks of Plankton in Two Oceanic Waters.” In Proceedings of the 11th ACM International Conference on Bioinformatics, Computational Biology and Health Informatics, BCB '20. ISBN 9781450379649, doi: 10.1145/3388440.3412485, https://doi.org/10.1145/3388440.3412485.

See Also

sharma.song.test, strength.test, and type.analysis.

Examples

  # Two first-order differential tables:
  tables <- list(
   matrix(c(30,0,0,
            0,10,0,
            0,0,20), nrow=3),
   matrix(c(10,0,0,
            0,20,0,
            0,0,30), nrow=3)
  )
  marginal.change.test(tables)
  
  # Tables differ in the second-order but not first-order:
  tables <- list(
    matrix(c(4,0,0,
             0,4,0,
             0,0,4), nrow=3),
    matrix(c(0,0,4,
             0,4,0,
             4,0,0), nrow=3)
  )
   marginal.change.test(tables)

[Package DiffXTables version 0.1.3 Index]