Description Usage Arguments Examples
Plotting the outputs of adapt
when x
is 1-dimensional, including threshold curves and level curves of local FDR.
1 2 3 4 5 |
obj |
an 'adapt' object |
x |
covariates (i.e. side-information). Should be compatible to |
pvals |
a vector of values in [0, 1]. P-values |
alpha |
a positive scalar in (0, 1). Target FDR level |
title |
a string. Title of the figure |
xlab |
a string. Label of the x-axis |
xlim |
a vector of length 2. Limits of x-axis |
disp_ymax |
a positive scalar in (0, 1]. Maximum value displayed in the y-axis |
num_yticks |
a positive integer. Number of ticks in the y-axis |
rand_seed_perturb |
random seed if jitter is added. NA if no jittering is needed |
... |
other arguments passed to |
legend_pos |
a string. Position of the legend |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # Load estrogen data
data(estrogen)
pvals <- as.numeric(estrogen$pvals)
x <- data.frame(x = as.numeric(estrogen$ord_high))
dist <- beta_family()
# Subsample the data for convenience
inds <- (x$x <= 5000)
pvals <- pvals[inds]
x <- x[inds,,drop = FALSE]
# Run adapt_glm
library("splines")
formulas <- paste0("ns(x, df = ", 6:10, ")")
res <- adapt_glm(x = x, pvals = pvals, pi_formulas = formulas,
mu_formulas = formulas, dist = dist, nfits = 10)
# Plots
par(mfrow = c(2, 1))
plot_1d_thresh(res, x, pvals, 0.1, "P-value Thresholds (alpha = 0.1)",
disp_ymax = 0.5)
plot_1d_lfdr(res, x, pvals, 0.1, "Level Curves of lfdr (alpha = 0.1)",
disp_ymax = 0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.