Non-FictionStudent's ShortcutData Prep
Data Cleaning for Econ eBook
Clean and prepare messy economic datasets in Excel
Clean and prepare messy economic datasets in Excel before analysis.
Formats
Free sample
Chapter 1: The Hidden Tax--–- In 2014, a Federal Reserve economist named James submitted a working paper on regional employment trends. The paper was careful, the regressions were robust, and the conclusion was clear: during a period of documented national expansion, the Midwest had experienced negative GDP growth. James presented the findings to a small internal audience. One attendee raised a hand. "Did you check the CSV import?" James had.
Twice. But when they walked through the data together, they found it: a single misplaced comma in the raw file had shifted 847 rows of employment data one column to the left. The Midwest wasn't shrinking. The data was just misaligned. That comma cost James three weeks of re-analysis, one withdrawn paper, and a quiet conversation with a division chief about "quality control procedures." He never made that mistake again.
But he also never forgot the lesson: the hardest part of economics is not the theory. It is not even the econometrics. The hardest part is getting the data ready so the econometrics can trust you.This chapter opens with that story for a reason. It is not an outlier. It is the rule.
Ask any working economist—in academia, at a central bank, in a think tank, or inside a government agency—what fraction of their time goes to cleaning data. The answers range from 60 to 80 percent. Ask them what fraction of their training went to cleaning data. The answers range from zero to five percent. There is a chasm between what economists are taught to do (derive estimators, interpret coefficients, write proofs) and what economists actually do (wrangle Excel files, merge inconsistent naming conventions, track down why 2019 inflation data looks like text).
This book is the bridge across that chasm.This is not a statistics textbook. It is not an econometrics textbook. It is not a programming manual for Python or R. It is a practical, irreverent, war-story-filled guide to cleaning economic data in the tool that the vast majority of economists actually use for preliminary work: Microsoft Excel. You may prefer Stata.
You may love R. You may swear by Python's pandas library. But when the data first arrives—when you download that CSV from the World Bank, when you open that PDF table from the BLS, when your co-author emails you an Excel file with seventeen merged cells and a pivot table that no longer works—you open Excel. Everyone does. This book assumes you already know basic Excel navigation.
It assumes you have run a regression before. It assumes nothing else.The Hidden Tax of Messy Data Let us put a number on it. Suppose you earn 80,000peryearasaresearcheconomist.Supposeyouspend70percentofyourtimecleaningdata.Thatis80,000 per year as a research economist. Suppose you spend 70 percent of your time cleaning data. That is 80,000peryearasaresearcheconomist.Supposeyouspend70percentofyourtimecleaningdata.Thatis56,000 worth of your employer's money spent on formatting dates, removing duplicates, and figuring out why SUM returns zero.
Now suppose this book saves you just 20 percent of that cleaning time. That is $11,200 per year in recovered productivity—for the price of a single book. For a Ph D student, the math is different but the stakes are higher. A dissertation delayed by six months because of data cleaning issues is six months of forgone salary, delayed graduation, and postponed job market entry. The hidden tax is real.
It is large. And it is almost entirely avoidable.The problem is not that economic data is uniquely messy. It is that economic data comes from a thousand different sources with a thousand different conventions. The Census Bureau suppresses small cells with a dash. The BLS sometimes uses "N/A" and sometimes uses "." and sometimes leaves cells blank.
The IMF's World Economic Outlook database prints time series across columns for human readability, which is the opposite of what regression software needs. FRED exports CSV files with footnotes embedded inside the data rows. World Bank indicators change names across vintages. The list goes on. Each source is reasonable on its own.
Together, they form a Tower of Babel that the economist must translate.This book is that translator. It does not assume you have a computer science background. It does not assume you know what a regular expression is. It assumes you are an economist—trained to think about incentives, trade-offs, and marginal returns—and it applies that economic lens to the problem of data cleaning.The Opportunity Cost of Perfection Before we clean a single cell, we need a framework for deciding when to stop. Perfection is an asymptote.
You will never have perfectly clean data. Every additional hour of cleaning has diminishing returns, and beyond some point, those returns become negative because over-cleaning introduces bias. Consider a missing value. You could delete the row. You could impute the mean.
You could run a model that accounts for missingness. Each choice has costs. The perfect choice depends on context, but the perfect choice might take four hours to implement. If the variable is a minor control, those four hours are wasted. If the variable is your main outcome, they are essential.We need a decision rule.
Here is the one used throughout this book: the clean versus discard versus flag matrix. It has two dimensions. The first is missingness percentage—what fraction of observations lack a value for this variable? The second is variable importance—how central is this variable to your main research question? Variable importance is subjective, but it can be approximated: a dependent variable is high importance; a key independent variable of interest is high importance; a standard control like population or GDP per capita is medium importance; a peripheral control that could be replaced is low importance.With these two dimensions, the decision matrix becomes simple:High importance, low missingness (under 5 percent): Clean thoroughly.
Use multiple imputation or carefully justified deletion. Document every decision.High importance, medium missingness (5 to 20 percent): Flag missing observations with a dummy variable. Impute cautiously. Test sensitivity to different imputation methods.High importance, high missingness (over 20 percent): Question whether this variable is usable at all. Consider dropping it and redefining your question.Low importance, any missingness: Drop the variable or use listwise deletion.
Do not spend hours cleaning a control variable that will appear in one robustness table.This matrix is not mechanical. It is a guide. But it solves the problem that paralyzes many researchers: the fear of making the wrong choice. There is rarely one right answer. There is only a trade-off between bias and variance, between precision and effort.
Economists understand trade-offs. This book just makes them explicit.The Tidy Data Principle for Economists Before we can clean data, we need to know what clean data looks like. The most useful definition comes from Hadley Wickham, a statistician who formalized the concept of tidy data. Tidy data has three properties:Each variable forms a column.Each observation forms a row.Each value forms a cell.This sounds trivial. It is not.
Most economic datasets violate tidy principles in ways that are obvious once you see them but invisible when you are in the middle of a project. Consider a common format for international macro data: rows are countries, columns are years, and cells are GDP. Is this…
This is the end of the free sample. Get the eBook to keep going. Buy now
About this book
Details
- Author
- Ginn Lorriane
- Publisher
- SamEnrico
- Language
- English
- Genre
- Non-Fiction, Student's Shortcut, Data Prep
- Released
- 2026-05-30
- Pages (approx.)
- 124
- Available as
- eBook, Audiobook
Read better in the ZLOADR app
Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.
More by Ginn Lorriane
Dumbbell Only Strength GuideGinn Lorriane$11.99
Genetic Testing for SchizophreniaGinn Lorriane$11.99
Workplace Esteem HandbookGinn Lorriane$11.99
Self Worth Adoption Origins GuideGinn Lorriane$11.99
Meiji Annexation of Korea GuideGinn Lorriane$11.99
The Moonlit Vow: A Yokai’s Forbidden LoveGinn Lorriane$11.99
The Lost Fleet of the Chola Dynasty: Surviving the Bay of BengalGinn Lorriane$11.99
Kratochvilite MiningGinn Lorriane$11.99
How to Become a Seconds HandlerGinn Lorriane$11.99
Non Compete Trap PrimerGinn Lorriane$12.99
Understanding Glossopalatine Ankylosis Micrognathia Ear AnomaliesGinn Lorriane$17.99You may also like
Hong Kong Handover 1997Dunn Johnnie$11.99
Zumba For Postnatal Recovery CourseNeal Christian$11.99
Zumba for BeginnersLadner Nikia$11.99
YouTube Comment Mining GuideHumes Pandora$12.99
Worry Box MeditationCarlin Rudy$11.99
Workplace Stress MeditationNguyen Lynn$11.99
Workplace Stress and Sleep RepairHawley Ivory$11.99
Workplace Perfectionism CureDelaney Jeffry$11.99
Workplace Injustice Anger GuideWallen Isabelle$11.99
Work Addiction and Burnout LinkGreenwood Ester$11.99
Women in Yoga and WellnessBeattie Galina$11.99
Women in Stand Up ComedyChun Evangeline$11.99