fitgrid.utils.lmer module

fitgrid.utils.lmer.get_lmer_dfbetas(epochs, factor, **kwargs)[source]

Fit lmers leaving out factor levels one by one, compute DBETAS.

Parameters
  • epochs (Epochs) – Epochs object

  • factor (str) – column name of the factor of interest

  • **kwargs – keyword arguments to pass on to fitgrid.lmer, like RHS

Returns

dfbetas – dataframe containing DFBETAS values

Return type

pandas.DataFrame

Examples

Example calculation showing how to pass in model fitting parameters:

dfbetas = fitgrid.utils.lmer.get_lmer_dfbetas(
    epochs=epochs,
    factor='subject_id',
    RHS='x + (x|a)
)

Notes

DFBETAS is computed according to the following formula [NieGroPel2012]:

\[DFBETAS_{ij} = \frac{\hat{\gamma}_i - \hat{\gamma}_{i(-j)}}{se\left(\hat{\gamma}_{i(-j)}\right)}\]

for parameter \(i\) and level \(j\) of factor.