pymare.core.Dataset

class Dataset(y=None, v=None, X=None, n=None, data=None, X_names=None, add_intercept=True)[source]

Bases: object

Container for input data and arguments to estimators.

Parameters:
  • y (None or numpy.ndarray of shape (K,) or str, optional) – 1d array of study-level estimates with length K, or the name of the column in data containing the y values. Default = None.

  • v (None or numpy.ndarray of shape (K,) or str, optional) – 1d array of study-level variances with length K, or the name of the column in data containing v values. Default = None.

  • X (None or numpy.ndarray of shape (K,[P]) or list of str, optional) – 1d or 2d array containing study-level predictors (dimensions K x P), or a list of strings giving the names of the columns in data containing the X values. Default = None.

  • n (None or numpy.ndarray of shape (K,) or str, optional) – 1d array of study-level sample sizes (length K), or the name of the corresponding column in data. Default = None.

  • data (None or pandas.DataFrame, optional) – A pandas DataFrame containing y, v, X, and/or n values. By default, columns are expected to have the same names as arguments (e.g., the y values will be expected in the ‘y’ column). This can be modified by passing strings giving column names to any of the y, v, X, or n arguments. Default = None.

  • X_names (None or list of str, optional) – List of length P containing the names of the predictors. Ignored if data is provided (use X to specify columns). Default = None.

  • add_intercept (bool, optional) – If True, an intercept column is automatically added to the predictor matrix. If False, the predictors matrix is passed as-is to estimators. Default = True.

to_df()[source]

Convert the dataset to a pandas DataFrame.

Returns:

A DataFrame containing the y, v, X, and n values.

Return type:

pandas.DataFrame