num.sv: A function for calculating the number of surrogate variables...

Description Usage Arguments Value Examples

View source: R/num.sv.R

Description

This function estimates the number of surrogate variables that should be included in a differential expression model. The default approach is based on a permutation procedure originally prooposed by Buja and Eyuboglu 1992. The function also provides an interface to the asymptotic approach proposed by Leek 2011 Biometrics.

Usage

1
num.sv(dat, mod, method = c("be", "leek"), vfilter = NULL, B = 20, seed = NULL)

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

method

One of "be" or "leek" as described in the details section

vfilter

You may choose to filter to the vfilter most variable rows before performing the analysis

B

The number of permutaitons to use if method = "be"

seed

Set a seed when using the permutation approach

Value

n.sv The number of surrogate variables to use in the sva software

Examples

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

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

n.sv = num.sv(edata,mod,method="leek")

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