type.analysis: Comprehensive Type Analysis for Difference Across Contingency...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/type-analysis.R

Description

Four types (0, 1, 2, null) are assigned to a collection of contingency tables to categorize their differences.

Usage

1
  type.analysis(tables, alpha = 0.05)

Arguments

tables

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

alpha

a numerical value representing the significance level for all involved hypothesis tests. Default is 0.05.

Details

The function determines whether differences across patterns underlying multiple input contingency tables are type 0, 1, 2, or null. The function calls strength.test, marginal.change.test, and sharma.song.test to obtain three p-values and use them to decide on the type of difference among input contingency tables \insertCitesharma2020COPTYPDiffXTables.

Type null: association absent from the input tables. These tables can still differ in joint distribution, but a strong relationship is lacking between row and column variables. No mechanisms are implied.

Type 0: association present and patterns are conserved. These tables show strong row and column association but have no difference in distribution. Conserved mechanisms with conserved trajectories are implied.

Type 1: association present; the difference is up to the first order. These tables show strong row and column association, differ in marginal distribution, and do not differ deviation from joint distribution to product of marginals. Conserved mechanisms with differential trajectories are implied. Differences in trajecotry can be due to changed stimuli.

Type 2: association present; the difference is up to the second order. These tables show strong row and column association and differ in deviation from joint distribution to the product of marginals. Differential mechanisms are implied.

Value

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

Zeroth.order

a list with class "htest" containing the test statistic, degrees of freedom and p-value of the strength.test.

First.order

a list with class "htest" containing the test statistic, degrees of freedom and p-value of the marginal.change.test.

Second.order

a list with class "htest" containing the test statistic, degrees of freedom and p-value of the sharma.song.test.

Type

the type of differences across the input contingency tables. Possible values are 0, 1, 2, and NULL.

Author(s)

Ruby Sharma and Joe Song

References

\insertAllCited

See Also

strength.test, marginal.change.test, and sharma.song.test.

A related function is the comparative chi-squared test cp.chisq.test.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  # Type-null tables:
  tables <- list(
   matrix(c(7, 4, 1,
            3, 6, 9,
            2, 4, 4), nrow=3),
   matrix(c(2, 1, 2,
            2, 0, 8,
            6, 2, 7), nrow=3)
  )
  type.analysis(tables, alpha = 0.05)

  # Type-0 tables:
  tables <- list(
   matrix(c(30,0,0,
            0,10,0,
            0,0,20), nrow=3),
   matrix(c(30,0,0,
            0,10,0,
            0,0,20), nrow=3)
  )
  type.analysis(tables, alpha = 0.05)
  
  # Type-1 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)
  )
  type.analysis(tables, alpha = 0.05)
  
  # Type-2 differential tables:
  tables <- list(
    matrix(c(4,0,0,
             0,4,0,
             0,0,4), nrow=3),
    matrix(c(0,4,4,
             4,0,4,
             4,4,0), nrow=3)
  )
  type.analysis(tables, alpha = 0.05)

DiffXTables documentation built on May 16, 2021, 9:07 a.m.