Computes the confidence-distribution probability that the parameter lies below, above, or inside a specified region, from any concurve intervals dataframe – whether produced analytically by curve_analytic() or numerically by curve_gen(), curve_boot(), curve_meta(), and the other interval functions. Also reports the counternull value (Rosenthal & Rubin 1994) for a supplied null value.

curve_region(data, lower = -Inf, upper = Inf, nullvalue = NULL)

Arguments

data

The intervals dataframe produced by one of the interval functions (e.g. x[[1]]).

lower

The lower bound of the region of interest. Use -Inf for "everything below upper".

upper

The upper bound of the region of interest. Use Inf for "everything above lower".

nullvalue

Optional null value for which the two-sided P-value, S-value, and counternull are reported.

Value

A data frame with one row containing the region, the confidence-distribution probability of the region, and (if nullvalue was supplied) the two-sided P-value, S-value, and counternull.

Details

The confidence distribution \(H(\theta)\) is reconstructed from the stored interval limits: each two-sided level \(1 - \alpha\) places its lower limit at \(H^{-1}(\alpha/2)\) and its upper limit at \(H^{-1}(1 - \alpha/2)\), so the pairs (limit, quantile) trace out the whole distribution and intermediate values are obtained by monotone interpolation. Region probabilities are then differences of \(H\). This is the "confidence in a treatment effect" analysis of Marschner (2024): confidence in benefit is \(H(\theta_0)\) (or its complement, depending on direction), confidence in equivalence is \(H(b) - H(a)\) for an equivalence region \((a, b)\).

References

Marschner IC. Confidence distributions for treatment effects in clinical trials: posteriors without priors. Stat Med. 2024;43(6):1271-1289.

Rosenthal R, Rubin DB. The counternull value of an effect size: a new statistic. Psychol Sci. 1994;5(6):329-334.

Examples

hr <- curve_analytic(estimate = log(0.80), se = 0.16, dist = "z", log = TRUE)
# Confidence that the hazard ratio shows any benefit (HR < 1):
curve_region(hr[[1]], lower = 0, upper = 1, nullvalue = 1)
#>   lower upper conf.region    pvalue   svalue counternull
#> 1     0     1   0.9184389 0.1631223 2.615974        0.64
# Confidence in equivalence, HR within (0.9, 1.1):
curve_region(hr[[1]], lower = 0.9, upper = 1.1)
#>   lower upper conf.region
#> 1   0.9   1.1   0.2075446