Linear Regression

Predict a continuous outcome from one or more predictors and quantify the unique contribution of each variable.

Linear regression models the relationship between a continuous outcome variable and one or more predictor variables by fitting a straight line (or hyperplane) that minimises the sum of squared residuals. The slope coefficients (B) tell you how many units the outcome changes for each one-unit increase in the predictor, holding all other predictors constant. Standardised coefficients (β) allow you to compare the relative importance of predictors measured on different scales.

Simple linear regression uses a single predictor; multiple linear regression uses two or more. Multiple regression is one of the most common analytical techniques across psychology, epidemiology, economics, and business analytics. It allows researchers to control for confounding variables, test theoretical models, and build predictive equations. The R² statistic tells you what proportion of variance in the outcome is explained by the full model.

StatRyx checks all OLS assumptions automatically: linearity (component-plus-residual plots), independence of errors, homoscedasticity (Breusch-Pagan test), normality of residuals (Shapiro-Wilk on residuals), and multicollinearity (Variance Inflation Factor for each predictor). The full regression table — unstandardised B, standardised β, standard errors, t-statistics, p-values, and 95% CIs — is formatted in APA 7 style.

When to use the Linear Regression

When not to use it

Worked example

PredictorBSE Bβtp95% CI
(Intercept)24.313.127.79< .001[18.15, 30.47]
Job Satisfaction0.480.09.385.33< .001[0.30, 0.66]
Training Hours0.310.10.213.10.003[0.11, 0.51]
Tenure (years)0.070.05.081.40.163[−0.03, 0.17]

How to report it (APA 7)

Multiple linear regression was used to predict employee performance from job satisfaction, tenure, and training hours. The model was statistically significant, F(3, 196) = 18.74, p < .001, R² = .22, adjusted R² = .21. Job satisfaction was the strongest predictor (β = .38, p < .001), followed by training hours (β = .21, p = .003). Tenure was not a significant predictor (β = .08, p = .19).

Frequently asked questions

Is linear regression free on StatRyx?

Yes. You can run it without an account (3 free analyses), and a free account adds 10 more — a one-time allowance, no payment needed. Every result includes the APA 7 write-up. Paid plans (Student from $9/month) add more analyses and Word, PDF and Excel export.

Do I need to code to run a regression?

No coding required. Specify your outcome and predictors in plain English and StatRyx builds the regression model, checks all OLS assumptions, and produces a publication-ready results table.

What sample size do I need for multiple regression?

A commonly cited guideline is at least 10–20 cases per predictor variable to avoid overfitting. For stable coefficient estimates, larger samples are better. StatRyx also reports the adjusted R² which corrects for the number of predictors and sample size.

What is multicollinearity and how do I detect it?

Multicollinearity occurs when predictors are highly correlated with each other, making it difficult to isolate their individual effects. VIF (Variance Inflation Factor) values above 5–10 indicate problematic multicollinearity. StatRyx reports VIF for every predictor and warns you if any exceed the threshold.

What is the difference between R² and adjusted R²?

R² (coefficient of determination) is the proportion of variance in the outcome explained by the model. Adjusted R² penalises for the number of predictors and gives a more accurate picture of model fit in the population, especially when you have many predictors relative to your sample size.

Run a Linear Regression on your data →

Related analyses