sampleSize: User friendly interface to class 'SampleSize'

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/SampleSizeClass.R

Description

User friendly interface to class "SampleSize"

Usage

1
2
3
4
5
sampleSize(
  PilotData,
  method = c("deconv", "congrad", "tikhonov", "ferreira"),
  control = list(from = -6, to = 6, resolution = 2^9)
)

Arguments

PilotData

object of class 'PilotData'.

method

estimation method one of 'deconv', 'congrad', 'tikhonov' or 'ferreira'. See 'Details'.

control

A list of control parameters. See 'Details'.

Details

The default method is 'deconv' which is a kernel deconvolution density estimator implementated using fft. The 'nncg' is a nonnegative conjugate gradient algorithm based on R's implementation see optim. 'tikonov' implements ridge-regression with optimal penalty selection using the L-curve approach. Higher order penalties are possible as well using a transformation to standard form. The 'control' argument is a list that can supply any of the following components, however per method some logical checks are built-in:

Value

object of class SampleSize.

Author(s)

Maarten van Iterson

References

Langaas, Storey, Ferreira, Hansen, van Iterson

See Also

optim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
m <- 5000 ##number of genes
J <- 10 ##sample size per group
pi0 <- 0.8 ##proportion of non-differentially expressed genes
m0 <- as.integer(m*pi0)
mu <- rbitri(m - m0, a = log2(1.2), b = log2(4), m = log2(2)) #effect size distribution
data <- simdat(mu, m=m, pi0=pi0, J=J, noise=NULL)
library(genefilter)
stat <- rowttests(data, factor(rep(c(0, 1), each=J)), tstatOnly=TRUE)$statistic
pd <- pilotData(statistics=stat, samplesize=sqrt(J/2), distribution='norm')
ss <- sampleSize(pd, method='deconv')
plot(ss)

SSPA documentation built on Nov. 8, 2020, 5:50 p.m.