Ravix

Ravix Logo

Python package for applied regression analytics — built for business students

What is Ravix?

Ravix is a Python package developed to support the textbook Applied Linear Regression with Python — A Practical Guide Using Ravix with Case Studies. It wraps standard Python libraries (NumPy, pandas, scikit-learn, matplotlib, SciPy) into concise, readable functions so students can focus on regression concepts and business interpretation rather than boilerplate code.

All datasets from the textbook are bundled directly with the package and can be loaded with a single call to get_data().

Core Functions

ols
Fit OLS regression using an R-style formula string.
model = ols("y ~ x1 + x2", df)
summary
Formatted output: coefficients, p-values, R², F-test.
model.summary()
plot
Scatter plot with fitted regression line.
plot(model)
hist
Histogram of a variable or model residuals.
hist(model)
boxplot
Boxplot for outlier detection.
boxplot(df["salary"])
barplot
Bar chart for categorical variable summaries.
barplot(df["industry"])
plot_cor
Correlation matrix heatmap for predictor screening.
plot_cor(df)
ncv
Breusch-Pagan test for heteroscedasticity.
ncv(model)
shapiro
Shapiro-Wilk normality test on residuals.
shapiro(model)
step
Stepwise variable selection (AIC/BIC).
step(model)
bsr
Best subset regression across all predictor combinations.
bsr(model)

Installation

Requires Python 3.8+ with numpy, pandas, matplotlib, scikit-learn, and scipy.

pip install ravix