calculateSwfdr: Calculate the science-wise FDR (swfdr)

Description Usage Arguments Value Examples

View source: R/calculateSwfdr.R

Description

Calculate the science-wise FDR (swfdr)

Usage

1
2
3
4
5
6
7
8
9
calculateSwfdr(
  pValues,
  truncated,
  rounded,
  pi0 = 0.5,
  alpha = 1,
  beta = 50,
  numEmIterations = 100
)

Arguments

pValues

Numerical vector of p-values

truncated

Vector of 0s and 1s with indices corresponding to those in pValues; 1 indicates that the p-values is truncated, 0 that it is not truncated

rounded

Vector of 0s and 1s with indices corresponding to those in pValues; 1 indicates that the p-values is rounded, 0 that it is not rounded

pi0

Initial prior probability that a hypothesis is null (default is 0.5)

alpha

Initial value of parameter alpha from Beta(alpha, beta) true positive distribution (default is 1)

beta

Initial value of parameter beta from Beta(alpha, beta) true positive distribution (default is 50)

numEmIterations

The number of EM iterations (default is 100)

Value

pi0

Final value of prior probability - estimated from EM - that a hypothesis is null, i.e. estimated swfdr

alpha

Final value of parameter alpha - estimated from EM - from Beta(alpha, beta) true positive distribution

beta

Final value of parameter beta - estimated from EM - from Beta(alpha, beta) true positive distribution

z

Vector of expected values of the indicator of whether the p-value is null or not - estimated from EM - for the non-rounded p-values (values of NA represent the rounded p-values)

n0

Expected number of rounded null p-values - estimated from EM - between certain cutpoints (0.005, 0.015, 0.025, 0.035, 0.045, 0.05)

n

Number of rounded p-values between certain cutpoints (0.005, 0.015, 0.025, 0.035, 0.045, 0.05)

Examples

1
2
3
pVals <- runif(100)
tt <- rr <- rep(0, 100)
resSwfdr <- calculateSwfdr(pValues = pVals, truncated = tt, rounded = rr, numEmIterations=100)

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