Free sample

Chapter 1: Beyond Point-and-Click--–- In the winter of 2014, a graduate student named Bethany watched her thesis advisor perform a statistical analysis that would determine whether she would graduate on time. The advisor, a distinguished professor with three decades of experience, opened a spreadsheet containing six months of laboratory measurements. He sorted a column. He deleted several rows that contained outliers—by his own visual inspection. He clicked through a series of dropdown menus to run a t-test.

He copied the p-value into a Power Point slide. The entire process took ninety seconds. "See?" he said, gesturing at the screen. "Simple."Bethany nodded. But something troubled her.

She had been the one who collected that data. She knew that the "outliers" he had deleted were not measurement errors; they represented a real biological phenomenon that her entire project was designed to investigate. When she politely mentioned this, the advisor shrugged. "We can run it both ways and see what happens," he said. He reopened the original spreadsheet.

He did not delete the rows this time. He ran the t-test again. The p-value changed from 0.03 to 0.09. "Hmm," he said. "Well, we'll go with the first one.

It's cleaner."This story—which Bethany told me years later, after she had left academia for a job in data science—illustrates something profound about the way research is actually conducted. Not the fraud, though that is worth naming: the advisor was not trying to deceive anyone. He genuinely believed that removing "outliers" made the analysis "cleaner." The problem was not his intent. The problem was his method. Every step he performed—the sorting, the deleting, the menu-clicking, the p-value copying—was ephemeral.

There was no record of which rows he deleted. There was no record of why he deleted them. There was no record of the fact that he had run the analysis two different ways and chosen the one that supported his preferred conclusion. All of that vanished the moment he closed the spreadsheet. All that remained was the Power Point slide and the published paper that would eventually cite it.This is the hidden crisis of modern research.

It is not a crisis of fraud or incompetence. It is a crisis of method. The tools that most researchers use to analyze data—spreadsheets, point-and-click statistical software, manual file organization—were not designed for the kinds of questions we now ask, the volumes of data we now collect, or the standards of transparency we now demand. They were designed for an era when a dataset fit on a single printed page, when a single researcher worked alone at a desk, and when "reproducibility" meant that you trusted the author's word. That era is over.

This chapter explains why, and why scripting is the only way forward.The Myth of the Perfect Click Every researcher who has worked with data knows the feeling. You have spent weeks collecting measurements, cleaning spreadsheets, and running preliminary analyses. You are finally ready to produce the results that will become the centerpiece of your paper. You open your statistical software. You navigate through a series of menus.

You click a button. A p-value appears. You feel a rush of satisfaction—or disappointment—depending on what the screen shows. But then a doubt creeps in. Did you select the right options?

Did you accidentally include the control group in the treatment condition? Did you mis-specify the model? You close the program. You reopen the data file. You start over, more carefully this time.

The numbers are slightly different. You are not sure why.This is the myth of the perfect click: the assumption that each click in a graphical user interface (GUI) performs a single, unambiguous, error-free operation. In reality, each click is a black box. You do not see the code that executes behind the menu. You do not know what default assumptions the software is making about your data—whether it is excluding missing values listwise or pairwise, whether it is using type I or type II sums of squares, whether it is applying a continuity correction to the chi-square test.

You cannot inspect these defaults because they are hidden. You cannot change them unless you know they exist. And you cannot document them for future readers because the only record of your choices is the fleeting state of the graphical interface.Consider a simple operation: deleting a row from a spreadsheet. In Microsoft Excel or Google Sheets, you right-click on the row number and select "Delete." The row vanishes. No log entry is created.

No audit trail records which row was deleted, what data it contained, or why you deleted it. If you close the file and reopen it a week later, the row is simply gone. You might remember that you deleted it. You might remember why. But you cannot prove either, even to your future self.

The operation is invisible, unreproducible, and untraceable.Now consider the same operation in a script. In Python using the pandas library, you would write something like: df = df[df['value'] > 0]. This line of code says: "Create a new dataframe that contains only the rows from the original dataframe where the 'value' column is greater than zero." Every part of this operation is explicit. The condition is visible. The output is generated from the input by a rule that anyone can read.

If you want to know which rows were deleted, you could modify the script to save them to a separate file. If you want to change the threshold from zero to something else, you change the number and rerun the script. The operation is visible, reproducible, and traceable.This difference—between invisible clicks and visible code—is the single most important distinction in modern research methodology. Everything else in this book follows from it.Defining Scripting: What It Is, What It Is Not Let me be precise about what I mean by "scripting." A script is a plain text file containing a sequence of instructions that a computer can execute. When you run a script, the computer reads each instruction in order and performs exactly what it says—no more, no less.

Scripts can be short (five lines that clean a single column) or long (five thousand lines that simulate a national economy). They can be written in many languages (Python, R, Julia, MATLAB, Stata's do-file language, SAS's SAS language, and dozens of others). But all scripts share a common property: they are explicit, readable, and executable.Scripting is not the same as programming. Programming typically refers to the development of large, complex software systems: operating systems, databases, web applications, video games. Programmers worry about memory management, algorithmic efficiency, software architecture, and user interface design.

Scripting, as we will practice it in this book, is much simpler. Scripts are usually short—tens or hundreds of lines, not thousands. Scripts are usually written for a single purpose: to clean a dataset, to run a statistical model, to generate a figure. Scripts are often written quickly, used a few times, and then discarded or archived. You do not need to become a professional programmer to script your research.

You need to learn perhaps twenty to thirty core concepts—variables, functions, loops, conditionals, data structures—and you will be equipped to…

This is the end of the free sample. Get the eBook to keep going. Buy now

About this book

undefined

Details

Author
Stowe Junior
Publisher
SamEnrico
Language
English
Genre
research, Self-Help / Science
Released
2026-06-06
Pages (approx.)
156
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 Stowe Junior

See all

You may also like

See all