Last data update: 2014.03.03

R: Method "FisherExactTest"
FisherExactTestR Documentation

Method "FisherExactTest"

Description

The main function of the Fisher Exact Test framework. Creates n times 2 matrices with record counts, where n rows represent dependent variable levels and two columns represent genotype levels. Performs Fisher Exact Tests on calculated count matrices.

Three matrices can be created and three tests can be potentially perform depending on the dataset:

- all records together regardless the sex values - combined dataset,

- records where sex value is "Male" (if such exists) - males only dataset,

- records where sex value is "Female" (if such exists) - females only dataset.

Together with count matrices creates percentage matrices, calculates effect sizes and statistics for count matrices. Performs Fisher Exact Tests.

The results (matrices, statistics and Fisher Exact Test outputs) are stored in PhenTestResult object.

The funciton is called from "testDataset" function when "method" argument is set to "FE" meaning "Fisher Exact Test".

Usage

    FisherExactTest(phenList, depVariable, outputMessages=TRUE)

Arguments

phenList

instance of the PhenList class; mandatory argument

depVariable

a character string defining the dependent variable of interest; mandatory argument

outputMessages

flag: "FALSE" value to suppress output messages; "TRUE" value to show output messages; default value TRUE

Value

Returns results stored in instance of the PhenTestResult class

Author(s)

Natalja Kurbatova, Natasha Karp, Jeremy Mason

References

Karp N, Melvin D, Sanger Mouse Genetics Project, Mott R (2012): Robust and Sensitive Analysis of Mouse Knockout Phenotypes. PLoS ONE 7(12): e52410. doi:10.1371/journal.pone.0052410

West B, Welch K, Galecki A (2007): Linear Mixed Models: A practical guide using statistical software New York: Chapman & Hall/CRC 353 p.

See Also

PhenTestResult

Examples

    file <- system.file("extdata", "test_categorical.csv", package="PhenStat")
    test <- PhenList(dataset=read.csv(file),
            testGenotype="Aff3/Aff3")
    # "FisherExactTest" function is called from "testDataset" function.
    result <- testDataset(test,depVariable="Thoracic.Processes",method="FE")  
    # Fisher Exact Test results can be printed out using function "summaryOutput"
    summaryOutput(result)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PhenStat)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/PhenStat/FisherExactTest.Rd_%03d_medium.png", width=480, height=480)
> ### Name: FisherExactTest
> ### Title: Method "FisherExactTest"
> ### Aliases: FisherExactTest
> 
> ### ** Examples
> 
>     file <- system.file("extdata", "test_categorical.csv", package="PhenStat")
>     test <- PhenList(dataset=read.csv(file),
+             testGenotype="Aff3/Aff3")
Warning:
Dataset's column 'Assay.Date' has been renamed to 'Batch' and will be used for the batch effect modelling.

Warning:
Dataset has been cleaned by filtering out records with genotype value other than test genotype 'Aff3/Aff3' or reference genotype '+/+'.

Warning:
Dataset's 'Weight' column is missed.
You can define 'dataset.colname.weight' argument to specify column for the weight effect modeling.

Information:
Dataset's 'Genotype' column has following values: '+/+', 'Aff3/Aff3'

Information:
Dataset's 'Sex' column has following value(s): 'Female', 'Male'

Warning:
Weight column is not present in the database.

>     # "FisherExactTest" function is called from "testDataset" function.
>     result <- testDataset(test,depVariable="Thoracic.Processes",method="FE")  
Information:
Dependent variable: 'Thoracic.Processes'.

Information:
Method: Fisher Exact Test framework with filtered dataset.

>     # Fisher Exact Test results can be printed out using function "summaryOutput"
>     summaryOutput(result)

Test for dependent variable:
*** Thoracic.Processes ***

Method:
*** Fisher Exact Test framework ***

----------------------------------------------------------------------------
Model Output ('*' highlights results with p-values less than threshold 0.01)
----------------------------------------------------------------------------
All
                     
* p-value:     0.0000
* Effect size: 76%   


Males only
                     
* p-value:     0.0003
* Effect size: 70%   


Females only
                     
* p-value:     0.0000
* Effect size: 81%   



----------------------------------------------------------------------------
Classification Tag
----------------------------------------------------------------------------
With phenotype threshold value 0.01 - significant in males, females and in combined dataset

----------------------------------------------------------------------------
Count Matrices
----------------------------------------------------------------------------
All
         +/+ Aff3/Aff3
Abnormal 142        12
Normal   753         1


Males only
         +/+ Aff3/Aff3
Abnormal  59         5
Normal   390         1


Females only
         +/+ Aff3/Aff3
Abnormal  83         7
Normal   363         0


> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>