TapCub is live — analytics, insights and live chat, free on one platform
Analytics

Regression analysis for marketers and analysts: a worked example

Regression analysis estimates how an outcome changes with its drivers. A 12-week example shows how leaving out organic traffic inflated the value of ad spend by a third, plus how to read output, check assumptions and avoid common mistakes.

Su He Published Nov 5, 2026 7 min read Analytics
Regression analysis for marketers and analysts: a worked exampleSample data

Regression turns a scatter of points into numbers you can budget with: how much the outcome moves per unit of each driver, and how sure you can be. This guide walks through 12 weeks of ad spend, organic traffic and sign-ups, where a one-variable model credits ads with 14 sign-ups per $1,000 and a model that controls for organic demand says 10.6.

What you will learn

  • Regression estimates effect size, uncertainty and predictions
  • Omitting a correlated driver biases coefficients
  • Use adjusted R² to compare models with different predictors
  • Check linearity, independence, normality and equal variance
  • Coefficients from observational data are associations, not causes

What is regression analysis?

Regression analysis is a family of statistical methods that estimate how an outcome (the dependent variable) changes when one or more inputs (the independent variables or predictors) change. It gives you three things a chart alone cannot: the size of each relationship, how uncertain that size is, and a way to predict the outcome for new values.

In analytics, typical questions are: how many extra sign-ups come with each extra $1,000 of ad spend, holding organic traffic constant? How much does each second of load time cost in conversion? Which customer behaviors predict churn?

The simplest form is a line through a scatter plot:

y = β₀ + β₁x + ε

where β₀ is the intercept, β₁ the slope (change in y per one-unit change in x), and ε the error the line does not explain. Ordinary least squares (OLS) picks the line that minimizes the sum of squared errors.

Types of regression

TypeOutcomeAnalytics example
Simple linearContinuous, one predictorSign-ups vs ad spend
Multiple linearContinuous, several predictorsSign-ups vs spend, organic traffic, holidays
LogisticYes / noWill this trial convert? Will this account churn?
Poisson / negative binomialCountsSupport tickets per account per month
Polynomial / splineCurved relationshipsConversion vs load time with diminishing returns
Regression with time termsTime seriesWeekly sales with trend and seasonality
TypeOutcomeExample
Simple linearContinuous, one predictorSign-ups vs spend
Multiple linearContinuous, several predictorsSign-ups vs spend and organic
LogisticYes / noWill a trial convert?
PoissonCountsTickets per account

Choose the type by the outcome you are modeling.

Worked example: does ad spend drive sign-ups?

Twelve weeks of data for a SaaS site (sample data): weekly paid spend in thousands of dollars, organic sessions in thousands, and sign-ups.

WeekAd spend ($k)Organic sessions (k)Sign-ups
12.08.0109
22.59.6116
33.08.6121
42.210.4121
53.59.0131
64.011.2140
73.210.8135
84.510.0139
95.012.2162
104.211.6142
115.511.0158
126.012.8170

Model 1: sign-ups on spend only

Sign-ups = 83.1 + 14.2 × spend. Standard error of the slope 1.2, R² = 0.93.

Read naively: each extra $1,000 brings 14 sign-ups, so a sign-up costs about $70.

Model 2: add organic sessions

Sign-ups = 53.3 + 10.6 × spend + 4.2 × organic sessions (k). Standard errors 1.2 and 1.0, R² = 0.976, adjusted R² = 0.971.

The spend coefficient fell by a quarter. Why? Spend and organic traffic rose together over the quarter (their correlation is 0.76) because the team spent more during the busy season, when organic interest was also high. Model 1 credited spend with sign-ups that came from seasonal organic demand. Organic traffic was a confounding variable, and leaving it out biased the estimate upward. That is omitted variable bias.

Holding organic sessions constant, an extra $1,000 goes with about 10.6 sign-ups: cost per sign-up closer to $94 than $70, a difference that changes a budget decision.

Prediction: for a week with $5,000 spend and 11,000 organic sessions, Model 2 predicts 53.3 + 53.0 + 45.8 ≈ 152 sign-ups. The residual standard error is about 3 sign-ups, so a week far outside that range is worth investigating.

app.tapcub.com/analytics/sources

Sign-ups per $1k (naive)

14.2

Controlling for organic

10.6

▼ 25%

Cost per sign-up

$94 vs $70

▲ 34%

Weekly sign-ups · two regression models

12 weeks
TermModel 1Model 2
Intercept83.153.3
Ad spend ($k)14.2 (SE 1.2)10.6 (SE 1.2)
Organic sessions (k)—4.2 (SE 1.0)
R²0.9330.976
Adjusted R²0.9270.971

Sample data. Spend and organic sessions correlate at 0.76.

Sample data

How to read regression output

OutputWhat it tells youWatch out for
CoefficientChange in y per one-unit change in x, others held constantUnits: per $1 or per $1k?
Standard errorUncertainty of the coefficientSmall samples give wide errors
t / p-valueIs the coefficient distinguishable from zero?Significant is not the same as large; see effect size
Confidence intervalPlausible range for the coefficientOften more useful than the p-value; see confidence intervals
R²Share of variance in y explainedAlways rises when you add predictors
Adjusted R²R² penalized for extra predictorsUse it to compare models of different size
ResidualsWhat the model missesPatterns mean the model is missing something

Assumptions to check

Linear regression relies on four assumptions, often remembered as LINE:

  1. Linearity: the relationship is roughly a straight line. Check with a scatter plot or residuals vs fitted values.
  2. Independence: errors are not related to each other. Weekly and daily data often break this because this week resembles last week; use regression with time terms or models built for time series.
  3. Normality: residuals are roughly normal (matters most for small samples and intervals).
  4. Equal variance: the spread of residuals does not grow with the predicted value. Revenue data often fails; a log transform helps.

Also check for multicollinearity: when two predictors are highly correlated, the model cannot separate their effects and the coefficients swing wildly with small data changes. In our example the correlation of 0.76 is manageable with 12 weeks; at 0.95 it would not be.

Common mistakes

  • Reading coefficients as causal effects. Regression on observational data shows association after controlling for what you included, nothing more. Confounders you did not measure still bias it. See correlation vs causation.
  • Extrapolating. The model was fit on $2–6k weeks. It says nothing reliable about a $20k week, where saturation kicks in.
  • Overfitting. Ten predictors on twelve weeks will fit perfectly and predict nothing. A common rule of thumb is at least 10 to 20 observations per predictor.
  • Letting outliers drive the line. One bad tracking week can swing a slope; check residuals and outliers.
  • Ignoring regression to the mean. Pages chosen for fixing because they had the worst week will look better next week regardless.
  • **Chasing R².** A high R² in a time series often just means both variables trended upward.

Regression with TapCub data

TapCub gives you the inputs: daily or weekly sessions by channel, goal conversions, revenue, page-level performance and UTM campaign data. Pull them with SQL queries or an export, add your spend data from ad platforms, and fit the model in a spreadsheet (LINEST), Python (statsmodels) or R (lm). Use UTM parameters consistently so spend and conversions join cleanly by campaign. When a coefficient matters for a budget decision, confirm it with an experiment such as a geo or time-based holdout, because only an experiment removes confounders you have not measured.

See also: Descriptive statistics, Inferential statistics.

Sources

Was this article helpful?

We use your answers to fix and expand this page.

Su He

Data Analyst

Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.

Get clean inputs for your models

Sessions by channel, campaign conversions and revenue, ready to query or export.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics