lm_qvalue: Estimation of qvalues conditioned on covariates

Description Usage Arguments Value Examples

View source: R/lm_qvalue.R

Description

The recipe for turning pvalues into qvalues is adapted from package 'qvalue' and articles by Storey, Tibshirani, Taylor, Siegmund.

Usage

1
2
3
4
5
6
7
8
lm_qvalue(
  p,
  X,
  pfdr = FALSE,
  pi0 = NULL,
  smoothing = c("unit.spline", "smooth.spline"),
  ...
)

Arguments

p

numeric vector of p-values

X

matrix of covariates (can be missing if pi0 is specified instead)

pfdr

logical, making estimates robust for small p-values and a small sample size

pi0

list with pi0 estimates from lm_pi0. If this is not provided, pi0 is estimated using function lm_pi0.

smoothing

character, type of smoothing used to fit pi0. Note the default in this function is different than in lm_pi0.

...

other parameters (passed on to lm_pi0 if pi0 is not provided)

Value

object of class ‘lm_qvalue’, which is a list with several components

call

matched function call

pvalues

numeric vector of original p-values

qvalues

numeric vector of q-values

other list elements transferred from pi0

Examples

1
2
3
4
5
6
# define a covariate
X <- rep(c(0, 1), each=1000)
# generate p-values, randomly for group 0 and with low values for group 1
pVal <- c(runif(1000), rbeta(1000, 0.2, 1))
# compute qvalues, using the covariate
qVal <- lm_qvalue(pVal, X=X)

leekgroup/swfdr documentation built on Dec. 11, 2020, 11:40 a.m.