Project guide for Claude
This is a social-science data analysis project. Read this before doing anything.
What this project is
- Research question: ...
- Data source: ... (survey / administrative / scraped / interviews)
- Unit of analysis: ... (individual, household, country-year, ...)
Data rules — read carefully
| Folder | What it holds | What you may do |
|---|---|---|
data/raw/ |
Original downloads, never modified | Read only. Never edit or overwrite. |
data/restricted/ |
Personal or confidential microdata, interview transcripts | Off limits. Blocked in .claude/settings.json. Do not read, print, or copy its contents. |
data/processed/ |
Cleaned, de-identified, derived files | Read and write freely. |
If an analysis needs restricted data, the student must first produce a de-identified
extract in data/processed/ themselves, and you work from that.
Never paste raw respondent-level rows, names, addresses, emails, or verbatim interview quotes into your replies or into committed files.
How to work here
- Python via
uv. Run things withuv run python ...oruv run pytest. Add packages withuv add <pkg>, neverpip install. - Scripts over notebooks for logic. Reusable cleaning and modelling code goes in
src/analysis/. Notebooks innotebooks/import from it and show results. Never copy-paste the same cleaning code into three notebooks. - One script, one output. Each script in
scripts/reads fromdata/, writes todata/processed/oroutputs/, and prints nothing else. - Reproducibility is the deliverable. Set random seeds. No absolute paths — use
pathlib.Path(__file__).parents[1]. Anyone should be able to clone, runuv sync, runscripts/in order, and get identical numbers.
Statistical conventions
- State the estimand before writing the model. Say what the coefficient means in substantive units, not just "significant".
- Report effect sizes and uncertainty (CIs), not only p-values.
- Missing data: never drop silently. Report how many cases were dropped and why; prefer explicit handling (listwise, imputation) stated in the output.
- Survey data: apply the survey weights the codebook specifies. If a dataset has a weight variable and it isn't used, say so out loud.
- Don't invent variable names or value labels. Check the codebook or the actual
columns with
df.info()/df["x"].value_counts()first.
What to do when uncertain
Ask, don't guess. Wrong assumptions about coding of a variable (e.g. 99 = "missing" vs. 99 = a real value) silently ruin results. If the codebook is ambiguous, flag it in your answer and pick the conservative reading.
Teaching mode
The people working here are learning. When you write analysis code, add a one-line comment explaining why a methodological choice was made, not what the line does. When asked to explain output, explain it at the level of a second-year social science student.