pymare.estimators.Hedges

class Hedges[source]

Bases: BaseEstimator

Hedges meta-regression estimator.

Estimates the between-subject variance tau^2 using the Hedges and Olkin1 approach.

Notes

This estimator accepts 2-D inputs for y and v–i.e., it can produce estimates simultaneously for multiple independent sets of y/v values (use the 2nd dimension for the parallel iterates). The X matrix must be identical for all iterates.

References

1

Larry V Hedges and Ingram Olkin. Statistical methods for meta-analysis. Academic press, 2014.

fit(y, v, X)[source]

Fit the estimator to data.

Parameters
  • y (numpy.ndarray of shape (n, d)) – The dependent variable(s) (y).

  • v (numpy.ndarray of shape (n, d)) – Sampling variances.

  • X (numpy.ndarray of shape (n, p)) – The independent variable(s) (X).

Return type

Hedges

fit_dataset(dataset, *args, **kwargs)[source]

Apply the current estimator to the passed Dataset container.

A convenience interface that wraps fit() and automatically aligns the variables held in a Dataset with the required arguments.

Parameters
  • dataset (Dataset) – A PyMARE Dataset instance holding the data.

  • *args – Optional positional arguments to pass onto the fit() method.

  • **kwargs – Optional keyword arguments to pass onto the fit() method.

get_v(dataset)[source]

Get the variances, or an estimate thereof, from the given Dataset.

Parameters

dataset (Dataset) – The dataset to use to retrieve/estimate v.

Returns

2-dimensional array of variances/variance estimates.

Return type

numpy.ndarray

Notes

This is equivalent to directly accessing dataset.v when variances are present, but affords a way of estimating v from sample size (n) for any estimator that implicitly estimates a sigma^2 parameter.

summary()[source]

Generate a MetaRegressionResults object for the fitted estimator.

Return type

MetaRegressionResults

Examples using pymare.estimators.Hedges