How can we use AI
(responsibly)
in Data Science?

HANDS-ON TUTORIAL WITH INSIGHTS

Department of Statistical Sciences Workshop Series

March 5, 2026

Preliminaries

What is a Large Language Model (LLM)?

  • A type of AI trained on massive text datasets
  • Uses deep learning (transformers) to understand and generate language
  • Can answer questions, summarize, and write code
  • Learns statistical patterns, not facts or reasoning
  • Outputs are probabilistic, not deterministic
  • Powers tools like ChatGPT, Gemini, Copilot, and more

It all starts with statistics!

Source: https://shiny.posit.co/blog/posts/shiny-side-of-llms-part-1/

Intended audience

  • Statisticians using R and/or Python
  • You’ve used LLMs via ChatGPT, Gemini, or similar
  • You haven’t used LLMs integrated into an IDE
  • You haven’t used LLMs from code
  • You haven’t performed EDA supported by an LLM

Initial disclaimers

  • When it comes to data science, today’s large language models are remarkably capable, yet they are not infallible

 

  • However, the promise of AI for data science is too great to ignore

Aknowlegments

Getting Started

  • Sign up for a developer account with Anthropic or OpenAI and grab an API key (requires credit card)

    • Just do it already 🙄
  • Sign up for GitHub Education (free for faculty!) to get GitHub Copilot Pro at no charge

  • Add API key to your environment variables (R, Python)

  • Install an LLM client package

    • For R: install.packages("ellmer")
    • For Python: pip install chatlas

A warning

  • On their own, LLMs are terrible at analyzing data
  • They cannot do simple arithmetic reliably
  • They cannot even count rows reliably
  • Having LLMs write code that analyzes data (and sometimes, even execute it) is the way

AI-Powered IDE

The department embraces Positron!