biopsykit.stats.regression module¶
Functions for performing regression analysis.
- biopsykit.stats.regression.stepwise_backwards_linear_regression(predictors, dv)[source]¶
Perform a stepwise backwards linear regression.
The stepwise backwards linear regression is performed iteratively by running a linear regression on the predictors and removing the predictor with the highest p-value. The best-fitting model is obtained by choosing the regression model with the highest adjusted R-squared value.
- Parameters
predictors (
pandas.DataFrame
) – Dataframe with predictors for the regression.dv (
pandas.DataFrame
orpandas.Series
) – Dependent variable for the regression.
- Returns
Best-fitted regression model.
- Return type