Skip to content
Join our email list to get $100 off Ally. The code expires October 31 →
R for the Rest of Us Logo

Ally Lesson

Your first data analysis with AI

Free preview: first minute

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

I recently tested handing AI a data analysis on deportation data and found I preferred having it write code I could inspect over letting it do the analysis as a black box. I started with a profiling prompt in Claude, then moved to a Quarto document so I could read its reasoning next to code I could run myself.

You'll learn:

  • How to prompt AI to profile a dataset before any analysis, asking what one row represents, what time period it covers, and what looks odd, while telling it not to write analysis code
  • Why asking AI to just do the analysis creates a black box, and how having it write reviewable code avoids that
  • How to ask AI for a Quarto document that walks through exploratory data analysis, with explanatory text and runnable code together
  • A trust-but-verify workflow: run the code AI writes so you can check whether its claims about your data are accurate
  • How to spot caveats in AI output, such as a codebook page that blocked automated fetches, so you know what the AI could not read

Tools mentioned: Claude, Quarto, R

Key moments:

  • 00:09 Why not to ask AI to just do the analysis
  • 00:48 Introducing the deportation data used in the test
  • 01:04 Profiling prompt in Claude, no analysis code
  • 01:50 Summary of what one row represents and the time period
  • 02:35 Caveat about the codebook website blocking fetches
  • 03:03 Switching to a Quarto document for the walkthrough
  • 03:52 Trust but verify workflow
  • 04:16 Why Quarto fits this kind of AI-assisted analysis