statsmodels.stats.meta_analysis.effectsize_2proportions

statsmodels.stats.meta_analysis.effectsize_2proportions(count1, nobs1, count2, nobs2, statistic='diff', zero_correction=None, zero_kwds=None)[source]

Effects sizes for two sample binomial proportions

Parameters:
count1, nobs1, count2, nobs2array_like

data for two samples

statistic{“diff”, “odds-ratio”, “risk-ratio”, “arcsine”}

statistic for the comparison of two proportions Effect sizes for “odds-ratio” and “risk-ratio” are in logarithm.

zero_correction{None, float, “tac”, “clip”}

Some statistics are not finite when zero counts are in the data. The options to remove zeros are:

  • float : if zero_correction is a single float, then it will be added to all count (cells) if the sample has any zeros.

  • “tac” : treatment arm continuity correction see Ruecker et al 2009, section 3.2

  • “clip” : clip proportions without adding a value to all cells The clip bounds can be set with zero_kwds[“clip_bounds”]

zero_kwdsdict

additional options to handle zero counts “clip_bounds” tuple, default (1e-6, 1 - 1e-6) if zero_correction=”clip” other options not yet implemented

Returns:
effect sizearray

Effect size for each sample.

var_esarray

Estimate of variance of the effect size

Notes

Status: API is experimental, Options for zero handling is incomplete.

The names for statistics keyword can be shortened to “rd”, “rr”, “or” and “as”.

The statistics are defined as:

  • risk difference = p1 - p2

  • log risk ratio = log(p1 / p2)

  • log odds_ratio = log(p1 / (1 - p1) * (1 - p2) / p2)

  • arcsine-sqrt = arcsin(sqrt(p1)) - arcsin(sqrt(p2))

where p1 and p2 are the estimated proportions in sample 1 (treatment) and sample 2 (control).

log-odds-ratio and log-risk-ratio can be transformed back to or and rr using exp function.