View source: R/suggest_thresholds.R
| suggest_thresholds | R Documentation |
Recommends (c1, c2) threshold pairs for ForestSearch based on
the corrected null approximation. Uses the per-subgroup detection
probability and an L_{\text{eff}} multiplicity correction to
find the smallest c1 (screening threshold) such that the
corrected FPR is at most fpr_target.
suggest_thresholds(
d_eff,
N,
fpr_target = 0.1,
n_min = 60,
L_eff_C = 1,
L_eff_alpha = 0,
c1_range = c(1.05, 2.5),
c1_step = 0.05,
c2_candidates = seq(0.9, 2, by = 0.05),
effect_scale = c("ratio", "difference")
)
d_eff |
Numeric. Effective information in the expected harm
subgroup. Use |
N |
Integer. Total sample size. |
fpr_target |
Numeric. Maximum acceptable procedure-level FPR. Default: 0.10. |
n_min |
Integer. Minimum subgroup size. Default: 60. |
L_eff_C |
Numeric. Calibration constant for
|
L_eff_alpha |
Numeric. Calibration exponent. Default: 0.0 (no N-dependence; see Details). |
c1_range |
Numeric vector of length 2. Search range for c1.
Default: |
c1_step |
Numeric. Grid step for c1. Default: 0.05. |
c2_candidates |
Numeric vector. Candidate c2 values to evaluate
for each c1. Default: |
effect_scale |
Character. |
The corrected FPR is:
\text{FPR}_{\text{corr}} = 1 - (1 - P_1)^{L_{\text{eff}}}
where P_1 = compute_detection_probability_glm(1.0, d_eff, c1, c2)
and L_{\text{eff}} = C (N / n_{\min})^\alpha.
Default L_eff values (C=1, alpha=0) assume L_{\text{eff}} = 1,
which gives the per-subgroup approximation with no multiplicity
correction. This is appropriate when:
No calibration data is available
The analysis has few confounders and small N
For more accurate suggestions, calibrate L_{\text{eff}} from
an H0 simulation using calibrate_L_eff or
run_null_calibration.
Reference calibrations (from the forestsearch GLM extension analysis documents):
C = 0.220, alpha = 1.298 (binary_threshold_calibration.qmd, 5000 sims)
C = 0.029, alpha = 0.882 (cox_vs_glm_approximation.qmd, 500 sims per N)
A data.frame with columns:
Screening threshold.
Minimum consistency threshold achieving the target.
Corrected FPR at this (c1, min_c2).
Per-subgroup detection probability.
Effective number of candidates at this N.
Sorted by c1 ascending. The first row is the smallest c1 that achieves the target FPR.
compute_detection_probability_glm,
calibrate_L_eff,
predict_fpr_corrected
# Survival: paper defaults should be recovered
d <- d_eff_survival(n_sg = 60, prop_cens = 0.45)
suggest_thresholds(d_eff = d, N = 700)
# Binary: needs higher thresholds (shown, not run -- about 10 s)
# d <- d_eff_binary(n_sg = 150, p_event = 0.30)
# suggest_thresholds(d_eff = d, N = 500,
# L_eff_C = 0.220, L_eff_alpha = 1.298)
# Use calibration object from run_null_calibration()
# cal <- run_null_calibration(...)
# suggest_thresholds(d_eff = d, N = 700,
# L_eff_C = cal$C, L_eff_alpha = cal$alpha)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.