grouped.grouped_linear_regression

grouped.grouped_linear_regression(ind: Array, x: Array, y: Array, filtered: bool = True, chunks: int | tuple[int, ...] | None = None, error: Literal['bootstrap', 'parametric'] | None = 'parametric', bootstrap_config: BootstrapConfig | None = None, verbose: bool = False) RegressionResult

Compute the linear regression at each index.

Parameters:
  • ind (array-like) – index labels

  • x (array-like) – Independent variables. Must have more one more dimension than y, the last dimension is the number of independent variables

  • y (array-like) – dependent variable

  • filtered (bool, optional) – Filter the output in a pandas dataframe, which is the default. If False, this function returns the raw output, where the index of the value corresponds to the index labels.

  • chunks (int or tuple of ints, optional) – Optional chunking of the data, which can be run in parallel in a joblib context

  • error ({'bootstrap', 'parametric'}, optional) – Compute the uncertainty of the linear regression parameters using either a bootstrap or parametric method. If not set, the function does not return the uncertainty.

  • bootstrap_config (BootstrapConfig, optional) – Configuration for the bootstrap if error is ‘bootstrap’

  • verbose (bool, optional) – Print timing

Returns:

The linear regression at each index. * df: degrees of freedom * beta: the slope * se: the standard error of the slope * t: the t-statistic * p: the p-value

Return type:

RegressionResult