Why include code in teaching?

Teaching
Accounting research
Research methods
R
Python
Author

Ian D. Gow

Published

20 May 2026

Originally shared on LinkedIn.

Including code in Empirical Research in Accounting: Tools and Methods had some downsides. For one, many instructors might feel uncomfortable with teaching material with code, especially if they are less familiar with the more modern languages (R and Python) used in the book. Another is the potential misperception that the book is about the code.

A good illustration of why including code makes sense is Chapter 21 (“Panel data”). While the book chapter explains the data sources and mechanics of the empirical analysis of the main paper, it’s only in doing the exercises that students can really appreciate what’s driving the paper’s results (and how unconvincing these results seem to be when probed).

The solutions are available here as an updated PDF, with an HTML version. The notes version incorporates corrections and clarifications made since the original post.

The “Panel data” chapter in Empirical Research in Accounting: Tools and Methods: