Convenience function to construct consonance functions from ratio measures (odds ratios, hazard ratios, risk ratios) given a point estimate and confidence interval bounds.
curve_from_ratio(ratio, lower, upper, conf.level = 0.95, steps = 1000,
cores = getOption("mc.cores", 1L), table = TRUE)Point estimate of the ratio.
Lower bound of the confidence interval.
Upper bound of the confidence interval.
Confidence level of the provided interval. Default is 0.95.
Number of consonance levels to compute. Default is 1000.
Number of cores for parallel computation.
Logical. If TRUE (default), includes a summary table.
A list with class "concurve" containing the intervals dataframe, density dataframe, and optionally a summary table.
This is a convenience wrapper around curve_rev specifically
for ratio measures. It automatically handles the log transformation
and sets appropriate measure type.
curve_from_se() for constructing from standard error
curve_rev() for the underlying function
if (FALSE) { # \dontrun{
# From a published odds ratio: OR = 1.5, 95% CI [1.1, 2.0]
result <- curve_from_ratio(ratio = 1.5, lower = 1.1, upper = 2.0)
ggcurve(result[[1]], type = "c", nullvalue = TRUE)
# Hazard ratio from survival analysis: HR = 0.75, 95% CI [0.60, 0.95]
result <- curve_from_ratio(ratio = 0.75, lower = 0.60, upper = 0.95)
ggcurve(result[[1]], type = "c", nullvalue = TRUE)
} # }