Developing and communicating data science results

Lecture 19

Dr. Mine Çetinkaya-Rundel

Duke University
STA 199 - Fall 2025

November 4, 2025

Warm-up

Announcements

  • Friday, 11/7 is the last day to withdraw with W from Fall 2025 classes – highly recommend checking in with me (as well as your academic advisor/Dean) if you’re considering this option

  • Additional office hours by me on Sunday on Zoom: Tentatively 10-11 am, might need to move to afternoon. Will send Zoom link on Friday’s email and confirm Saturday evening.

Project deadlines

  • By the end of the day on Friday, 11/7: (Optional) Stop by my or a TAs office hours as a team. Either come prepared with

    • two concrete questions
    • your presentation to do a practice run
  • Monday (11/10), in your lab session, in person: Project presentation

  • Thursday (11/13), 11:59pm: Project write-up, website, repo (all issues must be closed, final commit must successfully build the website)

  • Friday (11/14), 11:59pm: Peer eval 4 (final one!) on TEAMMATES

Story development

Structure: presentation + write-up

  • Start with your goal / high-level question

  • Don’t chronicle your steps, but instead tell us a compelling story of what you set out to find and what you found

  • “No significant results” or “no concrete relationships” are still results – what did you learn? how deep did you dig and with what tools and techniques?

“But… Therefore…”

Advice from those much more successful than me at telling stories:

Technical writing with Quarto

Your project write-up with Quarto

  • Figure sizing: fig-width, fig-height, etc. in code cells.

  • Figure layout: layout-ncol for placing multiple figures in a chunk.

  • Further control over figure layout with the patchwork package.

  • Cell options for what makes it in your final report: message, echo, etc.

  • Noting outside resources and formal citations.

  • Finalizing your report with echo: false.

Building your project website with Quarto

  • The docs folder.

  • Making sure your website reflects your latest changes.

  • Customizing the look of your website.

Slides

  • Option 1: Make your slides not in Quarto but make sure they’re available in your Quarto project website.

  • Option 2: Make your slides with Quarto.

Code smell and style

Code smell

One way to look at smells is with respect to principles and quality: “Smells are certain structures in the code that indicate violation of fundamental design principles and negatively impact design quality”. Code smells are usually not bugs; they are not technically incorrect and do not prevent the program from functioning. Instead, they indicate weaknesses in design that may slow down development or increase the risk of bugs or failures in the future.

Code style

Follow the Tidyverse style guide:

  • Spaces before and line breaks after each + when building a ggplot

  • Spaces before and line breaks after each |> in a data transformation pipeline,

  • Proper indentation

  • Spaces around = signs and spaces after commas

  • Lines should not span more than 80 characters, long lines should be broken up with each argument on its own line

Project reviews

R-chitects

Police Misconduct Allegations Analysis

The purpose of our project is to examine how police officer misconduct in the state of New York varies with officer experience and victim race using Civilian Complaint Review Board data. Through analyzing FADO (Force, Abuse, Discourtesy, Offensive Language) violations by officers’ days on force and victim race, we identify trends in when certain types of misconduct typically occur, understand how those trends vary by victim race, and reveal how racial disproportionalities are present within all offense types.

The Outliers

Paying for Purpose: How College Costs and Career Returns Shape Alumni Beliefs About Changing the World[*]

We are interested in the relationship between tuition, perception of making world a better place, and return on investment among United States colleges. To explore these intersections we will utilize multiple datasets. Here are our research questions: Are tuition costs and salary potential related to the feeling that they are making the world a better place post graduation, and does this differ whether a school is a state school or not? What factors most strongly correlate to a higher percentage of alumni who believe they are making the world a better place? We hypothesize that attending a public college and making above-average money afterwards will have a relationship to a higher percentage of alumni who believe they are making the world a better place.