test_independence: Fisher Test for 'hetset' Objects

Description Usage Arguments Details Value Note Author(s) Examples

Description

Test for independence of subpopulations assigned from mixture model and classification of samples following supplemental information (e.g. sex, clinical groups)

Usage

1
test_independence(H, feature, S)

Arguments

H

hetset object with partitioning of samples (H$prt) as well as supplemental information stored as sample information in H$[name].

feature

name of the feature to be tested for independence

S

reference value for classification of samples according to feature which must be one of type logical, factor or double (e.g. S = TRUE, S = "MALE", S = 1.5)

Details

A partitioning of samples found by scan_hetset is tested for association with sample classes formed by external categories (e.g. sex, smoking, age > 50 years, etc.).

Fisher's exact test for independence is applied.

Value

Returns output of fisher.test function

Note

If scan_hetset was initiated by a given classification (e.g. sex), the test must not be executed for the partitioning found by the mixture model and the initial classification information. Since this would represent some kind of a tautology.

Author(s)

Daniel Samaga

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
n_A <- 100
n_B <- 50
A <- matrix(data = rnorm(n = n_A*15,mean = 1,sd = 1),ncol = n_A)
B <- matrix(data = rnorm(n = n_B*15,mean = 3,sd = 2),ncol = n_B)
Hds <- hetset(D = cbind(A,B))
Hds$"group" <- c(rep("A",n_A),rep("B",n_B))
Hds$"score" <- rnorm(ncol(Hds))
rm(A,B,n_A,n_B)
Hds <- scan_hetset(H = Hds,level = "univariate",min_size = 2,
    max_size = 3,rel_imp = 0.1,em_steps = 5)
test_independence(H = Hds,feature = "group","A")
test_independence(H = Hds,feature = "group","B")
test_independence(H = Hds,feature = "score",0)

ZytoHMGU/hetset documentation built on June 6, 2019, 2:16 p.m.