Causal Inference in Spatial Analysis

Authors

Levi John Wolf

Nicholas Dorward

Published

October 15, 2026

Preface

To Gemma, whose support carries me through, and Lewis,

who brings me joy and gives me hope.

ND

To Maev, whose presence in my life made this book possible, and baby Rowan, whose presence in my lap ensured its text remained so mercifully brief.

LJW

George Bernard Shaw, the Nobel Prize-winning Anglo-Irish playwright, argues in Man and Superman that prefaces are best read after the main text. This may also be true of this preface. In this sense, we hope to explain how Causal Inference in Spatial Analysis came to be, and how our current perspective is shaped by the material and intellectual conditions in which this work arose.

Why did we write this book

We think spatial analysis is quite important for causal inference as actually encountered in social science for a variety of reasons. To understand this point fully, it helps to provide a bit of background about common arguments made by geographers against causal inference and made by causal social scientists against geography. In short, we see a crucial synergy between geography (and spatial analysis as an approach within it) and causal inference that simply transcends these two arguments for disengagement between the two communities.

To explain this, it helps to consider a few of the unique properties of spatial processes and causal inference. Indeed, spatial data itself is special for a lot of reasons best explored in dedicated texts about spatial analysis. However, one of the most relevant reasons why spatial data is unique for causal inference is that spatial data is often secondary data—data collected for some specific purpose (such as a legally mandated census, movement information to provide relevant advertisements, or to list a property to rent) and then re-analysed for an entirely different purpose. Indeed, some kinds of ubiquitous spatial data, such as the contemporary trends towards remotely-sensed data, may not necessarily be collected with a specific identified analysis or purpose in mind beyond visualising the target of the imaging!

However, this means that our view of most spatial processes (i.e. the underlying geographical structures and relations that shape our behaviours and outcomes) is strongly limited by what someone else decided to measure. Indeed, most spatial analyses are pursued by investigators with no direct control over the sampling process or frame over which their data arises. As a consequence, these secondary investigators lack a substantial amount of control over the data which they analyse. Thus, techniques for spatial analysis are quite commonly used to draw interesting conclusions about substantive questions arising in quite different times, theoretical contexts, or material environments where our data tends to arise.

We think this makes causal inference quite challenging for spatial processes—not because of the classic concerns mentioned for why spatial is special, such as how processes change over space or observations interfere with nearby others, but rather that we simply do not have the control over the relationships between treatments, controls, and outcomes that we must have in order to make rigorous arguments about causality.

Some geographers argue that the “right” way to deal with this is to refuse to engage with secondary data or causal inference methods at all. As this argument goes, we should refuse to try to fit ourselves into someone else’s data and/or methods. Instead, we must demand that the data we need to answer pressing social questions are collected as needed, and insist on the importance of geography to answer real world questions. Geographers have what other disciplines need, and the failure to recognise this is largely a failure of geographers to demand (or earn) a seat at the table. This perspective, advocated by senior geographers in data-focused roles, sees any attempt to work with secondary data or applying causal inference approaches originating outside of geography as futile appeasement of the broader social pressures rendering geography (and Geographers) irrelevant to the academy.

We think this leaves non-geographers high and dry, without the necessary conceptual scaffolding to do good science. If geographers don’t engage with secondary data and refuse to use methods developed “outside of geography,” then we make the geographical literature inaccessible to people outside of the discipline. This lets the foundational thinking that much of social and environmental sciences share go stale. It also siloes geographical knowledge into a special, mystical region where only the bravest need tread. As a consequence, these geographers perpetuate a neocolonial understanding of knowledge, whereby authors must enter the dark and poorly understood areas of other disciplines to extract needed theories or techniques and then return home to profit from the spoils of research. In short, insisting on our relevance as a unique and distinct domain of the social and environmental sciences is both misguided and likely ineffective.

In contrast, some non-geographers see geography as only capable of showing us what we don’t know (to paraphrase Gary King’s 1996 paper on why geographic “Context Should Not Count” in social science). In this view, spatial models, insofar as they can ever be estimated, are never truly identified: they do not correspond to any real description of how any process actually works. This is because space is always a proxy for something else yet unmeasured; if and when we really need to care about it, we must go measure that thing.

We think this writes off how geographical concepts like proximity or place shape individual behaviour, environmental outcomes, and social processes. It leaves geography no room to have theories of why things unfold where they do, or in relation to one another. And, it precludes the possibility of geography as a thing itself that matters—identifying as “a real New Yorker” or a “proper Londoner” expresses an individual’s alignment to a vague and unmeasurable set of attitudes about heritage, experience, identity, and implies a continued engagement with that place as a meaningful category. Place creates distinctions, even though place itself is created by people. Similar arguments apply to distance, interaction, and many other geographical constructs. Further, spillovers and interference is real, especially in environmental processes—we simply cannot assume that interventions can be made at isolated locations and only affect the individuals at those locations. There are real, substantive, and challenging questions for causal inference, particularly those around interference, intervention targeting, and identifiability, that must seriously engage with geographical concepts like place and proximity.

All this to say—geography plays a central role in the contemporary science of causal inference, and causal inference is increasingly important for making meaningful interventions on social and environmental systems. Given the lack of texts that handle these topics together, Nick and Levi decided to write this book.

Reflections on the book—format, function, and future

We wrote the book using Quarto, an open-source plain-text document rendering system that integrates computational content directly into an academic publishing workflow. We intended for the book’s website, spatialcausal.org, to contain short videos for every chapter, plus the full text with code and images in colour. We understand the importance of open-source software and open pedagogy for the future of academia, especially as the training of large language models increasingly demonstrates that intellectual property exists that can be stolen will be stolen. Making text open demonstrates that the value of a book often comes from the medium in which it is consumed, while videos are useful supplements to a website full of written text, and a hardcopy book is often better for leaners to truly grasp the content. We hoped this “book” would be a meta-textual document, more of a collection of content arranged around the same set of topics than simply a physical entity.

Alas, this was not to be. Through negotiations with the eventual publishers of this book, what was feasible met with what was possible to give rise to this specific text. We hope to keep the website updated with content as packages evolve, and appreciate any bug-fixes sent directly to the book’s issue tracker. We intend to keep the book’s code up to date, but are not yet sure how such a live text can be shared within the constraints of this production medium.

The role of programming in this book

This book is not a programming book, and presumes reasonable prior experience with Python or R. However, we admit that a few passages, especially towards the end of section 2 of the book, require a significant amount of code to realise their analytical aim. We hope that this is understood in the spirit of its necessity—without code, we can’t easily analyse or visualise data, and the code itself is not the purpose of this book. While learning new concepts requires learners to engage with the intrinsic complexity of new ideas, we hope we have removed as much incidental complexity from our code as possible. If we have failed in this regard, we encourage learners to share questions on our book’s issue tracker, and only engage responsibly with artificially-intelligent tutors to learn more about the code if absolutely necessary. We think struggle is part of learning, and getting comfortable reading and understanding code is important, even if a large language model will write most of it in the future.

How to use this book

This book was designed explicitly with a front-half and back-half to support two separate kinds of courses. The first half supports learners who do not (or are not yet) interested in empirical analysis, and provides higher-level discussions (with no code or significant math) to carry out the theory being taught. In the second half, we introduce additional code and mathematics to carry out the theory being discussed. While every effort was made to ensure that individual chapters can “stand alone” as analytical or conceptual exercises in the second half of the book, this is not always the case. In particular, the regression chapters forming the start of the second half of book make frequent reference to the other chapter’s concepts, framings, and methods, as does the difference in differences chapter back to these two regression chapters. Regardless, no chapter data or code directly depends on any other chapter, so they chapters should be able to be used independently if appropriate care is taken to support the references to the wider analytical context offered within the book.

Who are the authors?

LEVI JOHN WOLF is an Associate Professor in Spatial Analysis at the University of Bristol. He completed his PhD research on electoral boundary drawing at Arizona State University in Geography in 2017. His research spans many different areas of application from analyzing segregation in neighborhoods to modeling oceanic plankton distributions, but is underwritten by methodological innovation in spatial analysis, open science, and pedagogy. Before his time in academia, Levi worked in industrial geographic data science at MondialRelay, Inpost.PL, Nextdoor.com and CARTO.

NICK DORWARD is a Lecturer (Assistant Professor) in Human Geography at the University of Southampton. Prior to joining Southampton, he was a Lecturer and ESRC Postdoctoral Fellow in the School of Geographical Sciences at the University of Bristol, where he also completed an ESRC funded PhD in 2022. A quantitative human geographer, his research interests lie at the intersection of political science, global development, and urban studies. The primary focus of his research surrounds the demographic causes and political consequences of urbanisation in low- and middle-income countries. He also works on topics including urban protest mobilisation, urban systems and boundary analysis, and poverty mapping.

TOGETHER, Nick and Levi bring a broad cross-disciplinary perspective on cutting edge research and applications of causal inference in spatial analysis. This provides the authors with depth in foundational spatial analysis and causal inference, as well as breadth to cover how these techniques are applied in diverse empirical settings across a range of social and environmental sciences. The authors have written together in publications on spatial analysis of armed conflict, cities, rural poverty mapping, and the 2023 Boundary Commission for England’s parliamentary constituency boundary review.