Package 'STAREG'

Title: An Empirical Bayes Approach for Replicability Analysis Across Two Studies
Description: A robust and powerful empirical Bayesian approach is developed for replicability analysis of two large-scale experimental studies. The method controls the false discovery rate by using the joint local false discovery rate based on the replicability null as the test statistic. An EM algorithm combined with a shape constraint nonparametric method is used to estimate unknown parameters and functions. [Li, Y. et al., (2023), <https://www.biorxiv.org/content/10.1101/2023.05.30.542607v1>].
Authors: Yan Li [aut, cre, cph], Xiang Zhou [aut], Rui Chen [aut], Xianyang Zhang [aut], Hongyuan Cao [aut, ctb]
Maintainer: Yan Li <[email protected]>
License: GPL-3
Version: 1.0.3
Built: 2024-12-09 06:46:21 UTC
Source: CRAN

Help Index


EM algorithm to estimate local false discovery rate

Description

Estimate the local false discovery rate across two studies and apply a step-up procedure to control the FDR of replicability null.

Usage

em_lfdr(pa_in, pb_in, pi0a_in, pi0b_in)

Arguments

pa_in

A numeric vector of p-values from study 1.

pb_in

A numeric vector of p-values from study 2.

pi0a_in

An initial estimate of the null probability in study 1.

pi0b_in

An initial estimate of the null probability in study 2.

Value

Lfdr

The estimated local false discovery rate for replicability null.

fdr

The adjusted values based on local false discovery rate for FDR control.

xi00

An estimate of the prior probability for joint state (0, 0).

xi01

An estimate of the prior probability for joint state (0, 1).

xi10

An estimate of the prior probability for joint state (1, 0).

xi11

An estimate of the prior probability for joint state (1, 1).

f1

A non-parametric estimate for the non-null probability density function in study 1.

f2

A non-parametric estimate for the non-null probability density function in study 2.


An empirical Bayes approach for replicability analysis across two studies

Description

An empirical Bayes approach for replicability analysis across two studies

Usage

stareg(pa, pb, init.pi0 = TRUE)

Arguments

pa

A numeric vector of p-values from study 1.

pb

A numeric vector of p-values from study 2.

init.pi0

A logistic value for deciding whether to initialize the prior probabilities based on the estimates of pi0's. If true, estimate the marginal pi0's in two studies using qvalue; otherwise, specify pi0_pa = pi_pb = 0.9.

Value

A list:

Lfdr

The estimated local false discovery rate for replicability null.

fdr

The adjusted Lfdr values based on the step-up procedure for FDR control.

xi00

An estimate of the prior probability for joint state (0, 0) in two studies.

xi01

An estimate of the prior probability for joint state (0, 1) in two studies.

xi10

An estimate of the prior probability for joint state (1, 0) in two studies.

xi11

An estimate of the prior probability for joint state (1, 1) in two studies.

f1

A non-parametric estimate for the non-null probability density function in study 1.

f2

A non-parametric estimate for the non-null probability density function in study 2.

Examples

# Simulate p-values in two studies
m = 10000
h = sample(0:3, m, replace = TRUE, prob = c(0.9, 0.025, 0.025, 0.05))
states1 = rep(0, m); states2 = rep(0, m)
states1[which(h==2|h==3)] = 1; states2[which(h==1|h==3)] = 1
z1 = rnorm(m, states1*2, 1)
z2 = rnorm(m, states2*3, 1)
p1 = 1 - pnorm(z1); p2 = 1 - pnorm(z2)
# Run STAREG to identify replicable signals
res.stareg = stareg(p1, p2)
sig.idx = which(res.stareg$fdr <= 0.05)