lrasm.homoscedasticity_tst
Module Contents
Functions
|
This function recieves a linear regression model and outputs a |
- lrasm.homoscedasticity_tst.homoscedasticity_test(X, y, threshold=0.05)[source]
This function recieves a linear regression model and outputs a scatter plot figure of residuals plotted against fitted values. It prints a statement indicating the results of the homoscedasticity test and outputs a dataframe containing spearman correlation coefficients between the absolute residuals and the fitted y values.
- Parameters
X (pd.Dataframe) – Dataframe containing exploratory variable data
y (pd.series) – Dataframe containing response variable data
- Returns
Scatter plot of residuals plotted against fitted values
- Return type
pd.DataFrame
Examples
>>> homoscedasticity_test(X_train, y_train) >>> >>> correlation_coefficient p_value >>> 0.038 0.427