Module 7: AI as a Skeptical Reviewer

AI-Powered Coding and Data Analysis

Exercise: Download ZIP

GitHub repository

The project has a finished analysis, notebooks/analysis.qmd. It renders without errors, and its numbers come from code. It may still be wrong. You ask an AI tool to review it the way a skeptical collaborator would.

Exercise

Open the project in your tool and give it this prompt:

Review notebooks/analysis.qmd as a skeptical statistical collaborator.
Look for:
- logic errors
- incorrect assumptions about variables
- statistical modeling issues
- conclusions the results don't support
- missing diagnostics or sensitivity checks
Do not rewrite the code. Give me a list of concerns with line
references and suggestions for fixing them.

To review a notebook in a chat tool instead, paste the notebook into the chat with the same prompt. The chatbot can’t run the code, so it can only read it.

Judging the review

  • Check each concern against the code and the output. Which ones are real?
  • Which concerns change the conclusion, and which are minor?
  • Did the tool run the code to check its claims, or only read it?
  • Did it raise concerns that don’t hold up? A reviewer can be confidently wrong.
  • Compare the reviews from different tools as a class.

The planted mistake

Open this after the review.

The notebook groups the data by gender to count each group for the figure legend. It standardizes systolic pressure inside that same grouped step, so each gender is scaled to its own mean and standard deviation. Both genders end up with mean 0, which removes the gender difference before the model is fit.

The notebook concludes that men and women don’t differ after adjusting for age: −0.01 SD (95% CI −0.07 to 0.04). Standardized across all adults, men are 0.28 SD higher (0.23 to 0.33), or 4.1 mm Hg (3.3 to 4.9). The figure overlaps because of the same mistake, and the summary table shows only age, so nothing in the output gives it away.

Did your tool find it? Did it rerun the model to confirm the size of the difference?

Limits of AI review

  • A second model can catch errors, and it can also invent concerns.
  • An AI review usually lists more concerns than matter. You decide which ones do.
  • You still read the code, run it, inspect the output, and check it against the scientific question.