Author: Hua Zhong and Joe Song

# Using the exact functional test

#### Hua Zhong and Joe Song

#### Updated October 24, 2018; September 1, 2016; Created April 30, 2016

We illustrate the exact functional test with an example. An epigenetic indicator called CpG island methylator phenotype (CIMP) is strongly associated with liver cancers. Specimens (Shen et al. 2002) to study CIMP were collected and divided into three groups with different CIMP status: negative (no methylated genes), intermediate (1~2 methylated genes) and positive (>2 methylated genes).

The following table gives the frequencies of observed tumor protein p53 mutations and CIMP status:

CpG Island Methylator Phenotype (CIMP) and p53 mutation.
p53 mutation | CIMP Negative | CIMP Intermediate | CIMP Positive
--- | --- | --- | ---
No | 12 | 26 | 18
Yes | 0 | 8 | 12

    require(FunChisq)
    # x is a contingency table with row variable for p53 mutation and
    #   column variable for CIMP
    x <- matrix(c(12,26,18,0,8,12), nrow=2, ncol=3, byrow=TRUE)
    x
    #>      [,1] [,2] [,3]
    #> [1,]   12   26   18
    #> [2,]    0    8   12
    # Test the functional dependency: p53 mutation -> CIMP
    res <- fun.chisq.test(x, method="exact")
    print(res)
    #>
    #>  Exact functional test
    #>
    #> data:  x
    #> statistic = 5.6436, p-value = 0.04256
    #> sample estimates:
    #> non-constant function index xi.f
    #>                        0.1999521
    pval.text <- format.pval(res$p.value, digits=2)
    xif.text <- format.pval(res$estimate, digits=2)
    plot_table(
      x, xlab="CIMP", ylab="p53 mutation", col="seagreen3",
      main=bquote(italic(P)~'='~.(pval.text)*','~~italic(xi[f])~'='~.(xif.text)))

## References

Shen, L., N. Ahuja, Y. Shen, N. A. Habib, M. Toyota, A. Rashid, and J.-P. J. Issa. 2002. “DNA Methylation and Environmental Exposures in Human Hepatocellular Carcinoma.” Journal of the National Cancer Institute 94 (10): 755–61.