Perform ordinary least squares (OLS) multiple regression with up to 10 predictors. Obtain coefficient estimates, R², adjusted R², F-statistic, p-values, and diagnostic residual plots. Upload CSV or enter data directly.
Multiple linear regression (MLR) is a statistical technique that models the linear relationship between a dependent (response) variable Y and two or more independent (predictor) variables X1, X2, …, Xk. The model takes the form:
Y = β₀ + β₁·X₁ + β₂·X₂ + … + βk·Xk + ε
where β₀ is the intercept, βⱼ are the slope coefficients, and ε is the error term.
The coefficients are estimated using the ordinary least squares (OLS) method, which minimizes the sum of squared residuals. This calculator computes the OLS solution via matrix algebra: β = (X'X)−1 X'Y, providing unbiased estimates under the Gauss–Markov assumptions.
The tool constructs the design matrix X with a column of ones for the intercept, followed by the predictor columns. The response vector Y is the first column of your data. The normal equations X'X β = X'Y are solved using Gaussian elimination with partial pivoting. From the coefficient vector, we compute:
The residual plot displays standardized residuals against fitted values, with a horizontal zero line. Patterns in this plot can indicate model misspecification.
For valid inference, multiple linear regression relies on several key assumptions:
Use the residual plot to check for heteroscedasticity (fanning or funnel shape) and non-linearity (curvature). The calculator also flags potential multicollinearity if the matrix (X'X) is near-singular.
A marketing team wants to understand how TV and radio advertising budgets influence product sales. Using the Advertising example dataset, the regression model estimates:
Sales = 2.94 + 0.045·TV + 0.188·Radio
The model explains 89.7% of the variance in sales (R² = 0.897). Both TV and radio coefficients are statistically significant (p < 0.001), with radio having a larger marginal effect. This insight helps allocate budget efficiently: radio advertising yields a higher return per dollar than TV in this dataset.
A real estate analyst builds a model to predict home prices using square footage, number of bedrooms, and age. The model reveals that square footage is the strongest predictor, while age has a negative coefficient (older homes sell for less). The adjusted R² indicates the model generalizes well to new data. This tool enables rapid what-if analysis: “What is the predicted price for a 2,000 sq ft, 3-bedroom, 10-year-old house?”