Module 6: Practice With Skills
AI-Powered Coding and Data Analysis
Exercise: Download ZIP
The project has three tasks, each with its own skill. Complete as many as time allows. The tasks are independent. Tasks B and C read the raw survey file, so neither needs Task A’s output.
| Task | Skill | Skill rules |
|---|---|---|
| A. Clean subgroup estimates | data-cleaning |
Inspect first, keep raw data read-only, check before and after |
| B. Model blood pressure | regression-modeling |
Report dropped rows, ask about survey weights, run diagnostics |
| C. Write a short report | analysis-report |
Fixed sections, inline numbers, clean render |
A. Cleaning (data-cleaning skill)
Clean inputs/raw/subgroup_estimates.csv in notebooks/01_cleaning.qmd.B. Modeling (regression-modeling skill)
In notebooks/02_modeling.qmd, use inputs/raw/neighborhood_health_survey.csv to model how mean systolic blood pressure relates to age, gender, and family income-to-poverty ratio among adults.C. Report (analysis-report skill)
In notebooks/03_report.qmd, write a short report on how mean daily sodium intake relates to mean systolic blood pressure among adults in inputs/raw/neighborhood_health_survey.csv. Render it when you're done.For each one: run it → check it against the skill → change one rule in the skill → run it again in a fresh session. If the agent asks a question, answer it.
Rule changes with a visible effect
- A: switch labels from sentence case to lowercase, or add “Drop rows whose estimate is missing; report how many.”
- B: define adults as 20 and older, or add “Save a coefficient plot to outputs/figures/.”
- C: make the summary one sentence, or show the results as a table only.
Every number in the text should come from code output. Module 7 covers using AI to review an analysis.
Task B’s skill tells the agent to stop and ask about the survey weights. Expect questions before a notebook. That is the skill working. Answer all the questions in one message, with a decision and what to disclose. For example:
Use unweighted lm() and state that it ignores the survey design. Adults are 18 and older. Complete-case analysis is fine; report how many rows were dropped and why.