linearmodels.panel.model.BetweenOLS.fit

BetweenOLS.fit(self, *, reweight: bool = False, cov_type: str = 'unadjusted', debiased: bool = True, **cov_config: Union[bool, float, str, numpy.ndarray, pandas.core.frame.DataFrame, linearmodels.panel.data.PanelData]) → linearmodels.panel.results.PanelResults[source]

Estimate model parameters

Parameters
reweightbool

Flag indicating to reweight observations if the input data is unbalanced using a WLS estimator. If weights are provided, these are accounted for when reweighting. Has no effect on balanced data.

cov_typestr, optional

Name of covariance estimator. See Notes.

debiasedbool, optional

Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment.

**cov_config

Additional covariance-specific options. See Notes.

Returns
PanelResults

Estimation results

Notes

Three covariance estimators are supported:

  • ‘unadjusted’, ‘homoskedastic’ - Assume residual are homoskedastic

  • ‘robust’, ‘heteroskedastic’ - Control for heteroskedasticity using White’s estimator

  • ‘clustered` - One or two way clustering. Configuration options are:

    • clusters - Input containing containing 1 or 2 variables. Clusters should be integer values, although other types will be coerced to integer values by treating as categorical variables

When using a clustered covariance estimator, all cluster ids must be identical within an entity.

Examples

>>> from linearmodels import BetweenOLS
>>> mod = BetweenOLS(y, x)
>>> res = mod.fit(cov_type='robust')
Return type

PanelResults