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]#

Effect sizes for two sample binomial proportions

Parameters:
count1, nobs1, count2, nobs2array_like

Data for two samples.

statistic{“diff”, “odds-ratio”, “risk-ratio”, “arcsin”}, optional

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

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

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 Sweeting et al 2004 and Ruecker et al 2009, section 3.2. The constants that are added to the cells of each sample are proportional to the sample size and add up to one, so that a study without events in both samples has no effect.

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

zero_kwdsdict, optional

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:
effarray

Effect size for each sample.

var_effarray

Estimate of variance of the effect size.

Notes

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

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 odds-ratio and risk-ratio using exp function.

Lists and tuples are converted to arrays, arrays and pandas objects are used as they are and the results have the same type.

References

Sweeting, Michael J., Alexander J. Sutton, and Paul C. Lambert. 2004. What

to Add to Nothing? Use and Avoidance of Continuity Corrections in Meta-Analysis of Sparse Data. Statistics in Medicine 23 (9): 1351-75.

Ruecker, Gerta, Guido Schwarzer, James Carpenter, and Ingram Olkin. 2009.

Why Add Anything to Nothing? The Arcsine Difference as a Measure of Treatment Effect in Meta-Analysis with Zero Cells. Statistics in Medicine 28 (5): 721-38.