Learn R Programming

diffMeanVar (version 0.0.6)

AWvarTest: Test for equality of variance based on Ahn and Wang's (2013) score test

Description

Test for equality of variance based on Ahn and Wang's (2013) score test.

Usage

AWvarTest(value, group)

Arguments

value

numeric. Measurements to be compared between two groups.

group

numeric. Subject's group membership. Must be binary (i.e., taking values 0 or 1).

Value

A list with 6 elements:

U2

score statistic

varU2

estimated variance of the score statistic

T2

score statistic \(U_2^2/var(U_2)\)

pval

p-value of the score test

z

squared deviation of value from mean value

zbar

sample average of z

References

Ahn S. and Wang T. (2013) A Powerful Statistical Method for Indentifying Differentially Methylated Markers in Complex Diseases. Pacific Symposium on Biocomputing. 69-79.

Examples

Run this code
# NOT RUN {
    # generate simulated data set from t distribution
    set.seed(1234567)
    es.sim = genSimData.tDistr(nCpGs = 100, nCases = 20, nControls = 20,
      df0 = 10, ncp0 = 0, df1 = 6, ncp1 = 2.393, testPara = "var",
      eps = 1.0e-3, applier = lapply) 
    print(es.sim)
    print(exprs(es.sim)[1:2,1:3])

    # do AW score test for the first probe
    dat = exprs(es.sim)
    pDat = pData(es.sim)
    print(pDat[1:2,])

    res = AWvarTest(value = dat[1,], group = pDat$memSubj)
    print(names(res))
    print(res)
# }

Run the code above in your browser using DataLab