Meet the evidence

Coding Lesson 1 · Math Camp 2026

Rony Rodriguez-Ramirez

Before we begin

ARRIVAL PROMPT · ANSWER FOR YOURSELF

When code gives you an answer, what makes you willing to believe it?

Write one condition on a sticky note or in your field notebook. No technical vocabulary is required.

2 MINUTES

Welcome to Math Camp

THU AUG 13 · 1-4 PM

We begin with a policy question, meet the evidence, and learn what a coding agent changes about the work.

Welcome

Portrait of Rony Rodriguez-Ramirez

Rony Rodriguez-Ramirez

  • Education Policy, with a focus on the economics of education
  • Previous research experience at the World Bank—DIME and DECRG—and Innovations for Poverty Action
  • I like coding, especially when it helps us ask a better question
  • I will teach the four coding lessons and work with you during the labs

What you can expect from me

  • I will make the reasoning behind the code visible.
  • I will help you find the next useful question when something breaks.
  • I will never treat speed as a substitute for understanding.
  • I will give beginners a clear path and experienced coders room to extend it.

My goal: you leave ready for the semester, able to move in R, and able to find help without giving away the analytical decision.

Stop here: setup check

WE CANNOT BEGIN THE CODING WORK UNTIL EVERY LAPTOP PASSES

01Project

The math-camp/2026 folder is open as the workspace.

02R

R starts, and the console accepts a command.

03Packages

tidyverse and here load without an error.

04Quarto

quarto check finds both Quarto and R.

05Codex

You are signed in and can open the course project.

06Data

The frozen WDI teaching file is present in data/derived.

THE CLASS MOVES FORWARD WHEN ALL SIX CHECKS ARE GREEN.

Run the smoke test

In the R console

library(tidyverse)
library(here)

mean(c(2, 4, 6, 8))
here()

Expect 5 and the path to this project.

In the terminal

quarto check

Confirm that the report finds:

  • Quarto
  • R
  • the expected project path

Open the full setup guide

Make every laptop green

GreenAll six checks pass. Keep the outputs visible and help one nearby person.
YellowThe software opens, but a package, path, or Quarto check fails. Pair with the teaching team and repair it now.
RedR, Quarto, the project, or Codex access is missing. Pause here and complete the installation or sign-in.
NO ONE STARTS THE DATA EXERCISE WITH A KNOWN SETUP FAILURE.

Today has three movements

  1. Us: starting points, norms, and why coding is a collective skill.
  2. The tools: R, RStudio, Quarto, Codex, and Claude Code.
  3. The evidence: rows, variables, keys, missingness, and the first inspection loop.

By 4 PM

  • Open and run an R project.
  • Describe one row, one variable, and one key.
  • Inspect types, ranges, counts, and missingness.
  • Explain what Codex and Claude Code are.
  • Give an agent one bounded task.
  • Verify one generated claim with evidence.

AI + coding archetypes

Not a ranking.

  • Each position brings a useful instinct.
  • Your position can change with the task.
  • Coding experience and AI comfort are different dimensions.

Discuss briefly: Which axis feels less settled for you? What kind of evidence or support would help?

2 MINUTES

Classroom norms

  • Class is a collective enterprise.
  • Different levels of experience are expected.
  • Predict before running.
  • Ask what a line does before copying it.
  • Help a neighbor without taking over their keyboard.
  • Errors are evidence about our mental model.
  • Speed is not the same as understanding.

Coding is a skill

It is more useful to practice a skill with people you know than to perform competence alone.

Math Camp builds a repeatable way to ask, run, inspect, and repair. Memorizing commands is secondary.

Is it still worth learning to code?

Ask the question before hearing an answer:

If an agent can generate working code, what—if anything—is still worth learning?

Choose one position: more important, less important, or important in a different way. Write one reason.

3 MINUTES

Andrew Ng’s answer

Coding plus prompting can do more than prompting alone.
  • Natural language makes software easier to start.
  • Code makes an instruction inspectable, repeatable, and testable.
  • AI assistance shortens the distance between an idea and a working prototype.
  • That faster feedback makes small builds a powerful way to learn.

Paraphrased from Andrew Ng, “Coding Skill is More Valuable Than Ever” (2023) and “New Opportunities for the New Year” (2025), DeepLearning.AI.

Our answer for Math Camp

Yes—but the target has moved.

Use your coding knowledge to:

  1. read what it proposes,
  2. predict what should happen,
  3. change the right part,
  4. test the result,
  5. recognize when the policy question and the code no longer match.

Where I want to see you afterward

Adapted from the 2024 Math Camp promise:

  • Ready for the semester and prepared to keep learning.
  • Able to move in R without waiting for someone to type every line.
  • Able to craft a useful question before searching for an answer.
  • Able to find help in documentation, code, classmates, and agents.
  • Confident enough to make mistakes publicly and repair them.
Use every available form of help while keeping the analytical judgment in your own hands.

Why the workflow changed

Earlier loop

  • Write one line or function.
  • Run it and wait for an error.
  • Search the error message.
  • Try another line.
  • Keep most project context in your head.

Agent-assisted loop

  • Frame a task across one or several files.
  • Supply context before an error appears.
  • Authorize the actions the agent may take.
  • Inspect commands, output, and changes.
  • Design a check for the result.
The unit of work expands from a line of code to a project. Responsibility for the analytical decision stays with the researcher.

Faster code changes the bottleneck

When an agent can draft code quickly, more of the work moves into decisions that precede and follow the code:

  1. Question: Is the requested task connected to the policy question?
  2. Context: Did the agent receive the right files, definitions, and constraints?
  3. Permission: Should this action be read-only, reversible, or allowed to edit?
  4. Verification: What independent evidence would reveal a mistake?
  5. Communication: Can another person see what changed and why it was accepted?

The scarce skill is defensible judgment across the whole workflow.

From a studio to a supervised workshop

IDE-centered

  • You type every line.
  • Help arrives after an error.
  • Context lives mostly in your head.
  • Progress is visible in the script.

Agent-assisted

  • You define the task and constraints.
  • Help can inspect multiple files.
  • Context can be written into the project.
  • Progress must be checked in code and output.

What is AI?

Artificial intelligence is the umbrella.

For this camp, generative AI means systems that produce new text or code from instructions and context.

The tool can produce a remarkably useful continuation of your request. It does not directly observe truth, understand your policy setting as a person does, or guarantee that generated code is correct.

An LLM is a language engine

An LLM uses an instruction and its available context to generate language or code.

The engine can explain, draft, classify, and imitate patterns.

By itself, it cannot:

  • open your project,
  • run R,
  • inspect a graph,
  • or confirm a policy claim.

Five layers, five questions

MODEL

What can it generate?

CONTEXT

What can it currently see?

TOOLS

What actions can it request?

PERMISSIONS

What actions may actually run?

The loop asks: what result came back, and should the agent continue?

Model, chat, agent, harness

LAYERJOB
LLMGenerate text, code, or a request to use a tool.
Chat interfaceCarry messages between a person and the model.
Coding agentUse the model in a loop that can read, act, and observe results.
HarnessAssemble context, expose tools, enforce permissions, return results, and manage the loop.

The supervised workshop

The model is the language engine.

The harness is the workshop: workbench, toolbox, clipboard, locked cabinets, and measuring instruments.

The agent is the engine operating inside the workshop.

You are the investigator.

You write the work order, grant access, watch the work, and decide whether the evidence supports keeping it.

What happens during a tool call?

  1. The model generates: “Read data/README.md.”
  2. The harness checks the tool and permission.
  3. Ordinary software reads the file.
  4. The harness returns the file contents.
  5. The model receives new context and chooses the next step.
The harness converts the model’s request into a controlled action performed by ordinary software.

Human tool-call simulation

Four roles:

  1. Investigator: writes the work order.
  2. Model: may only request an action.
  3. Harness: checks permission and carries the request.
  4. R tool: returns a result.

Where can a mistake enter? Where can it be caught?

5 MINUTES

Chatbot or coding agent?

Classify each action:

  1. Explains an error pasted into a conversation.
  2. Reads data/README.md and finds the build script.
  3. Changes three files and shows the diff.
  4. Answers a conceptual question about a regression coefficient.

Which actions require project access?

Codex

OUR BASELINE TOOL

Codex is OpenAI’s coding agent—not the name of one fixed model. In this camp it can:

  • read the files you place in the project,
  • explain or edit R, Quarto, HTML, and documentation,
  • run terminal commands and tests,
  • show what changed,
  • continue a multi-step task using project context.

Codex proposes work. You authorize and verify it.

Claude Code

AN ALTERNATIVE TOOL

Claude Code is Anthropic’s coding agent for terminal and development workflows. It can also:

  • inspect a repository,
  • explain and edit code,
  • run commands,
  • help debug or restructure a workflow,
  • review a project against a stated standard.

The same verification obligations apply.

Codex and Claude Code

Question Codex Claude Code
Reads project context Yes Yes
Proposes file edits Yes Yes
Runs commands Yes Yes
Can be confidently wrong Yes Yes
Determines policy validity No No
Owns the final result No No

Compare the context, tools, permissions, changes, and checks that each harness makes visible.

Match the tool to the need

A
Compute a grouped mean from a data frame.
B
Keep code, console, files, and plots in one place.
C
Render code and interpretation into a document.
D
Inspect a project and propose a repair across files.

Match each need to R, RStudio, Quarto, or a coding agent.

Why use these tools?

  • Reduce time lost to syntax and environment friction.
  • Make invisible project assumptions easier to inspect.
  • Generate alternative explanations and checks quickly.
  • Help experienced students extend a task without leaving beginners behind.
  • Practice the workflow students will encounter in policy organizations.

These tools should free more attention for reasoning and learning.

Where agents fail

  • Invent a variable that does not exist.
  • Use an outdated package function.
  • silently drop rows with missing values.
  • produce a join that duplicates observations.
  • interpret association as causation.
  • cite a source that does not support the claim.
  • repair code without repairing the question.

Which failure would be hardest to notice if the code still runs?

Privacy boundary

Never give a coding agent:

  • personal or identifiable student records,
  • credentials, passwords, or API secrets,
  • confidential research data,
  • unpublished sensitive material,
  • a file you are not authorized to share.

This camp uses public World Bank data.

Responsibility stays human

YOU

choose the question, approve the action, inspect the evidence, and own the interpretation.

An agent does not absorb responsibility because it wrote the code.

The recurring protocol

A useful prompt has four parts

PARTQUESTION
GoalWhat concrete outcome do I want?
ContextWhich files, audience, and definitions matter?
ConstraintsWhat must not happen?
Done whenWhat observable evidence will show completion?

Repair this prompt

Fix my R code.

With a partner, add a goal, context, constraint, and done-when check. Make the task small enough to verify in five minutes.

4 MINUTES

Live agent demonstration

INSTRUCTOR DEMO · WATCH THE DECISIONS

  1. Ask the agent to read the data dictionary without editing.
  2. Inspect what it claims about the unit of observation.
  3. Ask it to propose an R inspection block.
  4. Review the proposed command before running it.
  5. Verify the row count and key in R.

Four tools, four jobs

TOOLWHAT IT DOESWHAT YOU STILL DECIDE
RExecutes instructions and computes results.Whether the question matters.
RStudioOrganizes scripts, console, files, and plots.Whether the code is substantively correct.
QuartoCombines narrative, code, and output.Whether the claim follows from the evidence.
Coding agentProposes, explains, edits, and checks.Whether its output deserves your trust.

One dataset, four policy paths

  1. Health: income and under-five mortality.
  2. Gender: female secondary enrollment and adolescent fertility.
  3. Access: electricity and internet access.
  4. Climate: renewable electricity, carbon intensity, and growth.

All four begin with the same question: What exactly does one row represent?

Meet the teaching file

4,991

country-year observations

217

economies and aggregate units

23

years from 2000 through 2022

9

policy indicators

Row, variable, key

Term In this file
Row One economy in one year
Variable A recorded attribute or policy indicator
Key iso3c + year
Missing value A value unavailable for that economy-year

If the key is not unique, later joins and summaries can silently lie.

The smallest R grammar

object <- function(input, argument = value)
wdi <- read_csv("data/derived/math-camp-wdi-2000-2022.csv")
  • wdi is the object.
  • <- assigns a value.
  • read_csv() is the function.
  • the file path is the input.

Read the file before analyzing it

library(tidyverse)

wdi <- read_csv(
  "data/derived/math-camp-wdi-2000-2022.csv",
  show_col_types = FALSE
)

glimpse(wdi)
count(wdi, year)
summarise(wdi, economies = n_distinct(iso3c))

Predict before run

wdi |>
  filter(year == 2022) |>
  summarise(
    rows = n(),
    observed_mortality = sum(!is.na(under5_mortality))
  )

Before running: Will rows and observed_mortality be equal? Why or why not?

Missing is not zero

Value Meaning
0 The indicator was observed and its recorded value is zero.
NA No usable value is present in this file.
Blank text May become NA, empty text, or an import problem.

Replacing missing values with zero changes the substantive claim.

No-agent checkpoint

Without an agent:

  1. Change the year in the inspection code.
  2. Predict which count can change.
  3. Run the code.
  4. Explain the result to your partner.

6 MINUTES

Agent explanation pass

Goal: Explain the selected R inspection block to a new programmer.
Context: Read the script and indicator dictionary in this project.
Constraints: Do not edit files. Separate facts from inferences.
Done when: I can state the unit, row count, year coverage,
and purpose of each line, with a check I can run for every number.

Verify the explanation

  • Did the agent identify a country-year as the unit?
  • Did it distinguish missing from zero?
  • Did it state the exact row count?
  • Can you reproduce that number in R?
  • What did it infer that the dictionary did not establish?

An explanation becomes useful when it points back to evidence.

Choose a policy track

Move or signal toward the question you want to follow:

  1. Health
  2. Gender
  3. Access
  4. Climate

Then tell one nearby person what you think the outcome variable is.

4 MINUTES

Lab 1 begins next

EVIDENCE INVENTORY · 3-4 PM

You will produce a personal evidence inventory with:

  • the question,
  • unit of observation,
  • outcome and comparison variables,
  • year coverage,
  • missingness evidence,
  • one limitation,
  • one agent claim you verified.

Exit ticket

Complete three sentences:

  1. A coding agent is…
  2. One claim I can verify in R is…
  3. One decision an agent cannot make for me is…

3 MINUTES