By MCP Analytics Team | Published , updated
Upload your data and get a linear regression report. Free.
The practical guide behind this tool: when it applies, how to read the output, and the traps that make it say the wrong thing.
The numbers below come from made-up data, made by the code on this page. They show the method. They are not output from this tool and not a finding about your data.
Question: How much of an outcome do a few drivers explain, which ones matter, and in which direction?
Inputs: Simulated data, not real customers. Seed 3 makes 100 rows with three standardized drivers: ad_spend, price and unrelated. Built in by construction: outcome = 10 + 2.0*ad_spend + 0.5*price + 0.0*unrelated + random error with standard deviation 4. The repeat check uses seeds 2000 to 2299 (300 runs of 100 rows).
Method: Ordinary least squares, the standard way to fit a linear regression (the tool's exact output is not shown here): fit the outcome on all three drivers at once, then report each coefficient with its standard error, 95% confidence interval and p-value (the probability, assuming the true effect is zero, of a result at least this extreme), plus R-squared and adjusted R-squared. A residual check compares the spread of the leftover errors in the lower and upper halves of the fitted values. The example then repeats the whole thing 300 times to see how often the intervals and p-values behave.
Result: In seed 3 the estimate for ad_spend was 2.59 (95% interval 1.84 to 3.34) against 2.0 built in, price was 0.30 (interval -0.52 to 1.12, p=0.468) against 0.5, and unrelated was -0.02 (p=0.966) against 0.0. R-squared was 0.336 and adjusted R-squared 0.315. Residual spread was 3.81 in the lower half and 4.10 in the upper half. Across 300 seeds the ad_spend interval covered 2.0 in 277 runs, the unrelated driver had p below 0.05 in 14 runs (about the 15 expected by chance), and price, a real but small effect, reached p below 0.05 in only 70 of 300 runs.
Limit: The data has straight-line effects, independent drivers and constant error spread by construction. Real data can have curved effects, drivers that move together, outliers or errors that grow with the outcome, none of which this example shows. It also does not show how the tool reports its results, which diagnostics it includes, or a causal reading: a coefficient is an association in the data you give it.
Python script (numpy and scipy only):
import numpy as np
from scipy import stats
# Simulated data. Built in: y = 10 + 2.0*ad_spend + 0.5*price + 0.0*unrelated + error (sd 4).
rng = np.random.default_rng(3)
n = 100
x1, x2, x3 = rng.normal(0, 1, (3, n)) # ad_spend, price, unrelated (standardized units)
y = 10 + 2.0 * x1 + 0.5 * x2 + 0.0 * x3 + rng.normal(0, 4, n)
def ols(X, y):
X = np.column_stack([np.ones(len(y)), X]); b = np.linalg.lstsq(X, y, rcond=None)[0]
res = y - X @ b; df = len(y) - X.shape[1]; s2 = res @ res / df
se = np.sqrt(np.diag(s2 * np.linalg.inv(X.T @ X)))
p = 2 * stats.t.sf(abs(b / se), df)
r2 = 1 - res @ res / ((y - y.mean()) @ (y - y.mean()))
return b, se, p, r2, 1 - (1 - r2) * (len(y) - 1) / df, df, res
b, se, p, r2, adj, df, res = ols(np.column_stack([x1, x2, x3]), y)
print("Built in: intercept 10, ad_spend 2.0, price 0.5, unrelated 0.0, error sd 4, n =", n)
for name, bi, si, pi, tr in zip(["intercept", "ad_spend", "price", "unrelated"], b, se, p, [10, 2.0, 0.5, 0.0]):
h = stats.t.ppf(.975, df)
print(f"{name:9s} est {bi:6.2f} 95% CI [{bi-h*si:6.2f}, {bi+h*si:6.2f}] p={pi:.3f} built-in {tr}")
print(f"R-squared {r2:.3f}, adjusted {adj:.3f}")
fit = y - res; lo = fit < np.median(fit)
print("Residual sd, low fitted half:", round(res[lo].std(ddof=1), 2), "high fitted half:", round(res[~lo].std(ddof=1), 2))
cov = sig3 = sig2 = 0
for s in range(300):
g = np.random.default_rng(2000 + s); a = g.normal(0, 1, (3, n)); yy = 10 + 2 * a[0] + .5 * a[1] + g.normal(0, 4, n)
bb, ss, pp, *_ = ols(a.T, yy); h = stats.t.ppf(.975, n - 4)
cov += bb[1] - h * ss[1] <= 2.0 <= bb[1] + h * ss[1]; sig3 += pp[3] < 0.05; sig2 += pp[2] < 0.05
print("Across 300 seeds: ad_spend interval covers 2.0 in", cov, "; 'unrelated' has p<0.05 in", sig3, "; price (true 0.5) has p<0.05 in", sig2)
Printed output from running the code above:
Built in: intercept 10, ad_spend 2.0, price 0.5, unrelated 0.0, error sd 4, n = 100
intercept est 10.02 95% CI [ 9.21, 10.82] p=0.000 built-in 10
ad_spend est 2.59 95% CI [ 1.84, 3.34] p=0.000 built-in 2.0
price est 0.30 95% CI [ -0.52, 1.12] p=0.468 built-in 0.5
unrelated est -0.02 95% CI [ -0.85, 0.81] p=0.966 built-in 0.0
R-squared 0.336, adjusted 0.315
Residual sd, low fitted half: 3.81 high fitted half: 4.1
Across 300 seeds: ad_spend interval covers 2.0 in 277 ; 'unrelated' has p<0.05 in 14 ; price (true 0.5) has p<0.05 in 70
How much a set of drivers explains an outcome, which of them matter most and in which direction, and how well the model actually fits.
Analysis with charts and tables.
Plain-English reading of the results.
See our FAQ for pricing, privacy and how the analysis works.
By MCP Analytics Team. Last updated 5 November 2026. Cite as: MCP Analytics Team (2026). Linear regression. Free tool. https://mcpanalytics.ai/free/standard_linear_regression_v2. Accessed the date you used it.
Tell us what went wrong, in your own words. We capture the page you're on automatically, so no need to describe where you are.