Linear Regression

Online Linear Regression Calculator

A free calculator for simple and multiple linear regression. Paste your data, choose a dependent variable and one or more predictors, and get coefficients, standard errors, p-values, R-squared, residual plots and prediction intervals — without writing a line of code.

Open the calculator

Run this analysis in the DeepStats analyzer. Free, no sign-up required, results appear instantly after you paste or upload data.

Open the calculator — run it in /analyze

When to use this test

  • You want to predict a continuous outcome from one or more numeric predictors (simple or multiple regression).
  • You need to quantify how much Y changes per unit change in X while holding other variables constant.
  • You want to test whether each predictor contributes significantly to explaining the outcome.
  • You need a baseline model before trying more flexible methods like polynomial regression or random forests.
  • You want to generate predictions with confidence or prediction intervals for new observations.

How to use it

  1. 1

    Upload or paste your dataset

    Drop a CSV or XLSX into the analyzer, or paste rows into the spreadsheet grid. Each column represents a variable; each row is one observation. Mark all numeric predictors as metric.

  2. 2

    Pick Simple or Multiple Regression from the catalog

    Under the Regression category, choose Simple Linear Regression (one predictor) or Multiple Linear Regression (two or more predictors). The analyzer only enables the test when you have the required column types.

  3. 3

    Assign the dependent variable and predictors

    Drag the outcome column into the Y (Dependent) slot and each predictor into the X slot. For categorical predictors, DeepStats automatically creates dummy variables behind the scenes.

  4. 4

    Review the coefficient table and diagnostics

    The output shows the intercept and every predictor with its coefficient, standard error, t-statistic, p-value and 95% confidence interval. R-squared, adjusted R-squared, F-statistic and residual plots (Q-Q, residual vs fitted) follow underneath so you can check assumptions.

  5. 5

    Export the model or make predictions

    Download the coefficient table, the fitted plot and the residual diagnostics. Enter new values into the prediction box to get a point estimate plus confidence and prediction intervals.

Example with sample data

Eight observations of advertising spend (thousands of USD) against product sales (units). Run Simple Linear Regression with Sales as Y and Ad_Spend as X.

Ad_Spend,Sales
5,120
7,141
9,159
11,182
13,201
15,225
17,240
19,265

The analyzer reports Sales = 62.5 + 10.6 × Ad_Spend, R² ≈ 0.998, F(1, 6) ≈ 2600, p < 0.001. Each extra thousand dollars of advertising is associated with about 10.6 additional units sold, and the model explains 99.8% of the variance in sales — exceptionally tight, because the example was engineered.

How to interpret the results

You will see: coefficient estimates with standard errors, t-statistic and p-value for each coefficient, 95% confidence intervals, R-squared and adjusted R-squared, overall F-statistic and model p-value, residual plots and Q-Q plot.

Intercept (β₀)
The predicted value of Y when all predictors equal zero. Often not meaningful in itself — zero advertising or zero age rarely makes physical sense — but it is needed to position the regression line correctly.
Slope coefficients (β₁, β₂, …)
Each β tells you how much Y changes for a one-unit increase in that predictor, holding other predictors constant. The sign indicates direction; the magnitude depends on the scale of the predictor.
p-values for coefficients
Test the null that the population coefficient is zero. Below 0.05 means the predictor is a statistically significant contributor in the presence of the other predictors. Watch for multicollinearity — correlated predictors can split credit and inflate p-values.
R-squared and adjusted R-squared
R-squared is the proportion of variance in Y explained by the model (0 to 1). Adjusted R-squared penalises adding predictors that do not improve fit — always prefer it when comparing models of different sizes.
F-statistic and model p-value
An omnibus test asking whether the model as a whole predicts Y better than the mean. A significant F means at least one predictor is contributing; individual t-tests then tell you which.
Residual diagnostics
The residual-vs-fitted plot should look like a featureless cloud; funnels suggest heteroscedasticity. The Q-Q plot should trace a straight line; large departures mean non-normal residuals. Anything else is a sign to transform variables or use a robust method.

Assumptions

  • Linearity.The relationship between each predictor and Y should be approximately linear. Curvature in the residual-vs-fitted plot means you should consider polynomial terms, a log transform or a non-linear model.
  • Independence of residuals.Residuals should be independent of one another. Time series data, clustered observations or repeated measurements violate this; use a mixed-effects model or a Durbin-Watson correction instead.
  • Homoscedasticity.Residual variance should stay constant across fitted values. A trumpet-shaped residual plot points to heteroscedasticity — fix with weighted least squares, log-transforming Y, or use robust (HC3) standard errors.
  • Normality of residuals.Matters mostly for small samples and for accurate confidence and prediction intervals. The Q-Q plot is the fastest check. For seriously skewed residuals consider a Box-Cox transform.
  • Low multicollinearity (multiple regression only).Predictors should not be too strongly correlated with each other. DeepStats reports variance inflation factors (VIF); values above 5–10 indicate the coefficients are unstable and difficult to interpret.

Related calculators

Frequently asked questions

Is the linear regression calculator really free?+

Yes — both simple and multiple linear regression are free, with no limits on predictors or sample size. Residual plots, coefficient tables and prediction intervals are all included.

Do I need to install Python, R or SPSS?+

No installation required. DeepStats fits the model server-side with statsmodels and returns results in your browser. You will see the same output an experienced analyst would produce by hand.

What is the difference between regression and correlation?+

Correlation summarises how strongly two variables move together with a single coefficient. Regression goes further: it gives you an equation that predicts Y from X (and other variables), plus the uncertainty around that prediction.

How many predictors can I include?+

There is no hard limit, but for stable estimates a rule of thumb is at least 10–20 observations per predictor. With fewer, consider penalised methods like ridge or lasso regression.

Can I use this for my thesis?+

Yes. The coefficient table, R-squared, F-statistic and residual diagnostics reported here match what you would get in SPSS, Stata or R. Report them exactly as written and cite DeepStats in your methods.

What do I do if my residual plot looks bad?+

Try transforming Y (log, square root), adding polynomial terms, switching to robust regression, or — if the problem is heteroscedasticity — requesting HC3 robust standard errors in the analyzer options.

Ready to run your own analysis?

Open the full DeepStats analyzer — free, browser-based, no account required.