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
Us: starting points, norms, and why coding is a collective skill.
The tools: R, RStudio, Quarto, Codex, and Claude Code.
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
MORE CODING EXPERIENCE →MORE COMFORT WORKING WITH AI →
CURIOUS NEWCOMER“The agent made a plot. Now I want to know what it did.”
AUGMENTED BUILDER“I can read the code, and I want the agent to handle the boring parts.”
CAREFUL BEGINNER“Please show me one step before anyone automates five.”
CODE-FIRST SKEPTIC“I trust the script I wrote. Convince me the agent helps.”
CALENDAR ENTHUSIAST“I am here, I have coffee, and I remain open to evidence.”
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:
read what it proposes,
predict what should happen,
change the right part,
test the result,
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:
Question: Is the requested task connected to the policy question?
Context: Did the agent receive the right files, definitions, and constraints?
Permission: Should this action be read-only, reversible, or allowed to edit?
Verification: What independent evidence would reveal a mistake?
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?
The model generates: “Read data/README.md.”
The harness checks the tool and permission.
Ordinary software reads the file.
The harness returns the file contents.
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:
Investigator: writes the work order.
Model: may only request an action.
Harness: checks permission and carries the request.
R tool: returns a result.
Where can a mistake enter? Where can it be caught?
5 MINUTES
Chatbot or coding agent?
Classify each action:
Explains an error pasted into a conversation.
Reads data/README.md and finds the build script.
Changes three files and shows the diff.
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
01Predict
Frame the question and state what you expect.
02Delegate
Give the agent one bounded assignment.
03Observe
Watch the files, commands, output, and diff.
04Verify
Run an independent check that bears on the claim.
05Narrate
Record what you accepted, revised, rejected, or left open.
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
Ask the agent to read the data dictionary without editing.
Inspect what it claims about the unit of observation.
Ask it to propose an R inspection block.
Review the proposed command before running it.
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
Health: income and under-five mortality.
Gender: female secondary enrollment and adolescent fertility.
Access: electricity and internet access.
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.
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:
Change the year in the inspection code.
Predict which count can change.
Run the code.
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:
Health
Gender
Access
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: