f.pvalue: A function for quickly calculating f statistic p-values for...

Description Usage Arguments Value Examples

View source: R/f.pvalue.R

Description

This function does simple linear algebra to calculate f-statistics for each row of a data matrix comparing the nested models defined by the design matrices for the alternative (mod) and and null (mod0) cases. The columns of mod0 must be a subset of the columns of mod.

Usage

1
f.pvalue(dat, mod, mod0)

Arguments

dat

The transformed data matrix with the variables in rows and samples in columns

mod

The model matrix being used to fit the data

mod0

The null model being compared when fitting the data

Value

p A vector of F-statistic p-values one for each row of dat.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(bladderbatch)
data(bladderdata)
dat <- bladderEset[1:50,]

pheno = pData(dat)
edata = exprs(dat)
mod = model.matrix(~as.factor(cancer), data=pheno)
mod0 = model.matrix(~1,data=pheno)

pValues = f.pvalue(edata,mod,mod0)
qValues = p.adjust(pValues,method="BH")

steveneschrich/msva documentation built on Dec. 23, 2021, 5:33 a.m.