Session 7: Using AI Tools — Advanced Visualisations as an Example

Published

11 06 2026

Modified

19 05 2026

Note

Date: Thursday, 11 June 2026, 16:00–19:00

Business question

Does management quality explain wage variation across firms — and how can we build and communicate the evidence at publication standard using AI tools?

Learning goals

  • Distinguish three modes of AI use in a data science workflow — autocomplete, thought partner, code reviewer — and apply each deliberately
  • Name and diagnose three predictable AI failure modes: package hallucination, stale API knowledge, and vibe coding
  • Apply the prompt → inspect → run → diagnose habit consistently across all AI interactions
  • Choose an appropriate chart type for a given research question before prompting an AI
  • Build a publication-ready figure in ggplot2 using patchwork, ggrepel, gghighlight, ggtext, and scales with AI assistance
  • Evaluate AI-generated code and figure output using Wilke’s ugly/bad/wrong taxonomy

Datasets

Slides and live demo — World Management Survey (WMS)

Manufacturing firms across 24 countries, multiple survey waves 2004–2015. Used here to revisit the management-quality/wages relationship from Session 6 as the worked example for AI-assisted visualisation.

Variable Description
management Management quality score (1–5 scale)
ln_wage Log hourly wage
industry Industry category
firmid Unique firm identifier
wave Survey wave (year)

Source: Békés & Kézdi (2021). Download: https://osf.io/t6zdp/

Exercise — WMS + CPS earnings (student’s choice)

Track A1 uses the WMS dataset to compare management score distributions across countries. Track A2 uses the CPS 2014 earnings data to explore the wage–education relationship by subgroup. Track B allows students to bring their own dataset and research question.

CPS source: Current Population Survey MORG 2014. Békés & Kézdi (2021). Download: https://osf.io/t6zdp/

Session outline

  • Exercise debrief
  • Input: AI tools — what the model is doing, three modes of use, three failure modes, the invariant habit
  • Live demo: hallucination, stale API knowledge, and code reviewer mode — engineered failures diagnosed in real time
  • Break
  • Input: publication-ready figures — ugly/bad/wrong, choosing the right chart, the 7-item checklist, five key extensions
  • Live demo: building a two-panel figure with AI assistance from scratch
  • Exercise: build one figure that passes the 7-item checklist
  • Quarto skill + closing debrief

Materials

File Description
Slides Lecture slides — open in browser, press F for fullscreen
Live demo Coding document built during the session — AI workflow and publication-ready figures
Exercise In-session exercise: build a publication-ready figure (via GitHub Classroom)
Exercise solution Example solution (added after session)

Further reading:

Quarto skill introduced this session

Using AI as a Quarto debugging and navigation tool. Three patterns:

Error diagnosis — paste a render error together with the surrounding chunk and ask what is causing it. AI is reliable on YAML and chunk option problems.

Goal-finding — ask how to achieve a specific Quarto or Reveal.js output (e.g., “How do I make a figure span the full slide width?”). Use AI as a documentation shortcut, but always verify the answer at quarto.org before applying it.

Prose refinement — paste a claim alongside the figure it is meant to support and ask whether the claim is accurate and whether it can be more concise. The AI cannot see your figure directly, so you need to describe what it shows; this framing alone is often useful.