pymare.stats.q_gen

q_gen(y, v, X, tau2)[source]

Calculate a generalized form of Cochran’s Q-statistic.

This version of the Q statistic is described in Veroniki et al.[1].

Parameters:
  • y (numpy.ndarray) – 1d array of study-level estimates

  • v (numpy.ndarray) – 1d array of study-level variances

  • X (numpy.ndarray) – 1d or 2d array containing study-level predictors (including intercept); has dimensions K x P, where K is the number of studies and P is the number of predictor variables.

  • tau2 (float) – Between-study variance. Must be >= 0.

Returns:

A float giving the value of Cochran’s Q-statistic.

Return type:

float

References