Statistics track

Statistics · Phase 11

Tools & Programming

Python, R, SQL and Excel — the stack employers screen on.

In plain English

Tools are how the analysis actually gets done: a spreadsheet for structure and communication, SQL for getting the data, Python or R for anything repeated.

The advanced view

Choose the tool by the failure mode you fear. Spreadsheets fail silently at scale and version control; SQL is declarative and set-based, so performance follows from indexing and join cardinality; scripting gives reproducibility, testing and automation. Production analytics needs all three with clear boundaries between them.

Python is the primary language for data work in finance: pandas for manipulation, numpy for numerics, scipy for distributions and tests, statsmodels for econometrics and GARCH, scikit-learn for machine learning, matplotlib and seaborn for charts. R remains dominant in academic statistics and some quant shops — tidyverse, forecast, tidymodels, rugarch.

SQL is mandatory: SELECT, all JOIN types, GROUP BY and HAVING, subqueries, CTEs, and especially window functions (ROW_NUMBER, RANK, LAG, LEAD, running aggregates) for rolling averages, rankings and year-on-year comparisons. Excel is still the lingua franca of corporate finance: INDEX-MATCH/XLOOKUP, SUMPRODUCT, IF/IFS, pivot tables, data tables for sensitivity, Goal Seek and Solver, named ranges — and keyboard speed, which interviewers do notice.

Stack to demonstrate

pandas / numpy

Data manipulation and numerics. The default working environment.

statsmodels / scikit-learn

Econometrics and ML. OLS, logit, time series, pipelines, cross-validation.

SQL window functions

Rolling aggregates, ranks, lags. The most-tested SQL skill in analyst interviews.

Excel modelling

Three-statement models, sensitivity tables, Goal Seek, clean formula discipline.

Why it works

Reproducibility works because a script is an executable record of every decision. When a number is challenged — and in consulting it always is — a re-runnable pipeline turns a two-day rebuild into two minutes, which is why the discipline pays for itself on the first revision cycle.

Common pitfalls

  • ×Hard-coding assumptions inside formulas instead of keeping a labelled input block.
  • ×Mixing inputs and calculations in the same cells, making audit impossible.
  • ×Reporting a number that no one, including you, can regenerate.

How it is used — a model that survives review

Step 1 of 4

  1. 1Blue cells = inputs, black =

Deeper

Deeper: an analysis that survives review

The technical standard is reproducibility: someone else runs your file and gets your number. That means raw data untouched, transformations in code or documented formulas, hard-coded inputs in one clearly marked block, and every output traceable to a source.

In Excel specifically: colour-code inputs against formulas, never bury a constant inside a formula, build one row per driver, and add check rows (balance sheet balances, sources = uses, sum of segments = total). Those checks catch most modelling errors before an interviewer does.

Must know cold

  • Separate inputs, calculations and outputs.
  • Add explicit check rows and let them show red when broken.
  • SQL: GROUP BY for aggregation, window functions for running and ranked measures.
  • Version and date every file you send.

Exercises

Try each one on paper before revealing the worked solution.

Exercise 1

You inherit a model where WACC is typed inside 14 formulas. What do you do, and what check do you add?

Exercise 2

Write the logic (not the exact syntax) for revenue by segment per quarter, with the share of total.

References

  • Wickham, H. and Grolemund, G. (2017). R for Data Science. O'Reilly, Sebastopol.
  • James, G., Witten, D., Hastie, T. and Tibshirani, R. (2021). An Introduction to Statistical Learning. 2nd Edition, Springer, New York.

Statistics glossary for this phase

The terms an interviewer expects you to use precisely — with the pitfall attached to each.

Mean (average)

Sum of the values divided by how many there are.

In finance

The base case in any sizing or margin estimate: revenue per customer, ticket size, cost per unit.

Pitfall

×Averaging averages. Average margin across segments is only valid when weighted by revenue.

Median

The middle value once the data is sorted.

In finance

Use it for skewed data such as deal sizes, household income or customer spend.

Pitfall

×Quoting a mean where a few whales dominate makes the typical customer look far richer than they are.

Order of magnitude

The nearest power of ten of a quantity.

In finance

In market sizing, being right to a factor of two beats being precise and wrong.

Pitfall

×Losing a factor of 1,000 between thousands, millions and billions late in the arithmetic.

Weighted average

Average where each value counts in proportion to its size.

In finance

Blended margin, blended price, WACC — all weighted averages.

Pitfall

×Using unweighted averages across segments of very different size.

Practise this

The drills and cases where this phase turns into arithmetic you do out loud.