A practical econometrics companion

Regression
with R & Python

Description, Prediction, and Causal Analysis for Applied Social Science and Econometrics

Per Johansson and Jiajing Sun

14 chaptersR + Py parallel code09 learning modules
Original abstract artwork of rising data points, a fitted curve, and two interwoven translucent ribbons
Original artwork created for this website
One framework, three questions

Start with the question.
Then choose the model.

The book builds a bridge from statistical reasoning to reproducible practice. It shows how the same regression toolkit changes when the goal is to describe a relationship, predict an outcome, or estimate a causal effect.

01

Description

Summarise patterns and communicate how variables move together.

02

Prediction

Evaluate out-of-sample performance and manage model complexity.

03

Causal analysis

Connect assumptions, research design, and credible counterfactuals.

Learn by translating

The idea stays the same.
The syntax changes.

Examples are developed side by side so readers can focus on the statistical idea while becoming fluent in both ecosystems.

R Python
simple_regression
# Estimate a linear relationship
model <- lm(y ~ x, data = sample)

summary(model)
predict(model, newdata = future)

Contents

A guided path through regression

Fourteen chapters move from foundations to flexible prediction and research designs for causal analysis. Companion code is linked where available.

New Explore all 14 chapters, six concept notes, and three slide-based deep dives. Open learning map

Open companion

Run the examples.
Make them your own.

The public repository contains chapter-organised R and Python scripts, runnable workbooks, and example datasets.

Browse the repository

Public companion scope

This site intentionally does not reproduce the manuscript, slides, solutions, or publisher files. Availability of additional teaching materials is determined by the authors and publisher.