Skip to contents

This method calculates pooled variance for related binomial experiments with confidence intervals. Instead of relying on the normal approximation, the user can calculate or estimate their own confidence intervals. The method adjusts the calculated binomial variance to account for an arbitrary given confidence interval, and then calculates pooled variance across all experiments.

Usage

BinomVarCustom(n, p_values, ci_intervals)

Arguments

n

integer. Number of trials per experiment

p_values

numeric. Probability of success for each experiment.

ci_intervals

list of numeric vectors. The list has length equal to length of p_values. Each element of the list contains a numeric vector of length 2 denoting the lower and upper confidence limits.

Examples


n <- 10  # Number of trials for each experiment

p_values <- c(0.2, 0.3, 0.4) # Probability of success for each experiment

# Wilson score intervals for each p
wilson_intervals <- list(
  c(0.1, 0.3),
  c(0.2, 0.4),
  c(0.3, 0.5)
)

# Calculate pooled variance with custom confidence intervals
BinomVarCustom(n, p_values, wilson_intervals)
#> [1] NA