View source: R/winners_curse_adj.R
snp_beta_rb | R Documentation |
Selected SNP are selected at |beta / se_beta + Z| > lambda; Z ~ N(0, sd = eta)
snp_beta_rb(
beta,
se_beta,
eta = 0.5,
alpha = 5e-08,
lambda = qnorm(1 - alpha/2),
est_se_beta = TRUE
)
beta |
Selected SNP effect size estimates (numeric or matrix) |
se_beta |
Selected SNP effect size standard error (numeric or matrix) |
eta |
a prespecified constant that reflects the noise level of the pseudo SNPs |
alpha |
significance level. |
lambda |
quantile of the standard normal distribution. If specified, overrides 'alpha'. |
DOI: 10.1214/22-AOS2247
list with elements: beta_rb, se_rb if 'est_se_beta' = TRUE and only a vector of Rao-Blackwellized estimates if 'est_se_beta' = FALSE
alpha <- 5e-5
lambda <- qnorm(1 - alpha / 2)
sim_beta1 <- rnorm(1e5, lambda, 1)
sim_beta1_rand <- abs(sim_beta1 + rnorm(1e5, 0, eta))
res_beta_rb <- t(mapply(
snp_beta_rb, beta = sim_beta1[sim_beta1_rand > lambda], se_beta = 1))
hist(as.numeric(res_beta_rb[, 1]))
# Add the naive selection
hist(sim_beta1[sim_beta1 > lambda], add = TRUE, col = 'red')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.