A presentation about presentations and stuff

Sean van der Merwe

Introduction

Welcome to my presentation about presentations and stuff!

This presentation is a short version of part of the SASA 2025 workshop that I’m co-hosting with Johané Nienkemper-Swanepoel and Raeesa Ganey (on behalf of MDAG).

Outline of SASA workshop

Hit refresh (F5 or Ctrl+r) if nothing is showing.

Part 1 - Examples

Think about your own situations. With each example, think about where you might apply these ideas in your own

  • Research presentations
  • Teaching presentations
  • Resources you make available to students / lecturers / each other

Interactive data exploration

Example: survey exploration

What about time series?

We could simulate a pair of \(VARIMA_2(1,1,1)-tGARCH(1,1)\) financial time series like so:

Or you can just explore data directly

The ACTG 315 dataset, available in the ushr R package, includes longitudinal measurements of HIV viral load (log\(_{10}\) RNA copies/mL) over time. It features data on 46 patients, with the longest measurement recorded on Day 196 after baseline (Day 0).

Data set

Interactive model fits for conveying research results

Exploring simulation study results

When you want to know whether two population means are different based on independent samples, is it better to

  1. do a F test for differing variances followed by a t-test assuming equal/unequal variances based on the previous result, or
  2. do a unequal variances t-test always?

Let’s simulate a few scenarios:

  1. Equal means, equal variances
  2. Equal means, different variances (1 vs 4)
  3. Equal variances, different means (0 vs 1)
  4. Unequal variances, different means

We calculate the power when testing at \(\alpha =\) 0.05 and compare the approaches under each scenario.

Simulation study results

Zoom in to see the ‘difference’.

Shower thought for the day

When is it better to use a table and when is it better to use a plot to present results?

  • Do you have variables with many levels, particularly continuous or ordinal variables?
    • Do you have 5 sample sizes or 50 threshold choices?
    • What about variable hyperparameters?
  • A plot better conveys information that changes gradually
    • allowing the reader to see patterns in the bigger picture
  • Do you have a bunch of factors with few levels, particularly binary or trinary factors?
  • A table better accommodates such cases because there are only so many factors you can effectively show on a plot
    • Once you’ve gone through colour, shape/linetype, size, facet grid or lattice, then the rest becomes noise
  • Does someone need to process your results further?
  • Are there so many factors and statistics that it is difficult to fit on a page?
  • Output big tables to a neat spreadsheet and upload it publicly (e.g. GitHub or Figshare)

Three continuous, 1 nominal

Plotting data on the model

One of the best ways to evaluate the fit of a model is to plot the model and show the data over it. Here we are analysing a reduction in pollution at a dam:

Curvy data

Teaching a class

Example: Let’s shuffle a deck of cards

deck <- paste( c(2:10, 'Jack', 'Queen', 'King', 'Ace') |> rep(times=4), 'of',
               c('Spades','Diamonds','Clubs','Hearts') |> rep(each=13) )
# To draw a hand of 7 cards:
hand <- deck |> sample(7)

# Shuffling is taking a sample the same size (52) without replacement:
shuffled_deck <- deck |> sample(length(deck))

# To do a bootstrap sample just add: , TRUE

Explaining MCMC

This plot is the basis for my MCMC class:

plotly::plot_ly(z=~volcano) |> plotly::add_surface()

Spatial data class - Google Map

Spatial data class - Leaflet

Exploring code live

Text information

Perhaps we shall summarise the complete works of Shakespeare in a word cloud?

Multivariate fun - Let’s try a biplot

X <- rnorm(200) |> matrix(50)
colnames(X) <- paste('Var', 1:ncol(X))
Group <- sample(c('🐬', '🐪'), nrow(X), TRUE)
biplot.plotly(X, grouping_points = Group, width = fig_w, height = fig_h) # Sean's function

Conclusion to Part 1

  • Interactive visualisations have many uses
  • Presentations do not have to be static
    • Interactivity is better than animation
  • Have you thought about how such tools can help you convey information to your audiences?

This presentation was created using the Reveal.js format in Quarto, using the RStudio IDE. Background image created using image editor GIMP by compositing images from CoPilot.

Part 2 - Details

How do you get this power for yourself?

Should you even try to get this power? Isn’t is dangerous?

What are the downsides to interactive materials?

The biggest downsides are obvious when you try to distribute it:

  • Interactive materials are great for slow exploration, not for scanning
  • It is not immediately obvious what the author wants to convey
  • It allows for the audience to draw their own meaning and interpretation
    • Requires that the recipient understands that they are meant to interact with it
  • More difficult to email or send, but not impossible
    • Interactive formats are designed to be hosted, not distributed

Static Formats

  • Microsoft Word (.docx) and PowerPoint (.pptx)
    • Used in industry in most of the world
    • A lot of precise control (often a bad thing)
    • Great for quickly creating short documents with precise formatting, like business letters, position statements, and assignments
    • For longer documents the use of styles is essential to avoid a mess
    • Alternatives include OnlyOffice, LibreOffice, Google Docs
  • Portable Document Format (.pdf)
    • Extremely precise control of everything
    • It has no concept of paragraphs, it’s just letters, lines, and pictures
    • Do not create documents in this format, only convert and manipulate

Interoperability

PDF and HTML are absorbing states, Word nearly so.

What powers all the flashiness?

The interactivity is brought to you (under the hood) by JavaScript. You do not see it - it is very well hidden, but it is working in the background to display the figures and react to your inputs.

The JavaScript accompanies (or is embedded in) HTML. No, you do not need to know any HTML at all, just like you don’t need to know that a .docx is actually a .zip containing .xml files.

All you need to learn is Markdown and a little of your favourite scripting language (e.g. R).

Markdown

  • Markdown is the new (2004) language of the technical internet
    • Places like GitHub, Reddit, StackExchange have supported it for a decade
  • It is deliberately simple and easy to use
    • You type what you mean and let the interpreter do the formatting
    • It is made to be readable without needing to be converted or formatted
  • GAI Chatbots write in Markdown!

Technicalities shouldn’t matter

  • The literate programming principle (made popular by Donald Knuth in the 90s via LaTeX) suggests that it is faster and easier to just type what you mean rather than fret over every detail
  • ChatGPT doesn’t understand the difference between a table and a code block, or a heading and a bold statement
    • it is just generating text
    • Yet you see neatly formatted output!
    • This is one area where you can really learn from AI: it doesn’t touch the mouse to create math and neither should you
  • Doing things manually wastes so much of your time

My workflow

I do almost all my work directly in markdown

  • For consultation clients who use Word I give explanations, references or links, math (e.g. model definitions), code (optional), results (tables and figures), interpretation, and sometimes statistical conclusions by just typing text in one text file
    • I then press a button and get a perfectly formatted Word report with structure, table of contents, etc.
  • For research I do the same, but choose the PDF option to get both a neat PDF and raw LaTeX + figure files
  • For teaching I create all my assessments via markdown, including assignments, tests, quizzes, etc.
    • In class I type in markdown to explain concepts live and demonstrate principles
  • As department head I write letters and implement processes via markdown

Let’s learn markdown quickly

  • Hashes make headings, 1 for a 1st level heading, 4 for 4th level, etc.
    • # This is a big heading, ## This is a smaller heading, ###### This is a tiny heading
    • # This is a section slide heading, ## This is a normal slide heading
  • <https://www.this_is_a_link.com>, *This is italics*, **This is bold**
    • [This is a fancier link](https://pointing.to.this/)
  • > starts a quote, - creates a bullet, and numbered lists are just 1.

Other easy things you can do without code

Text with borders, perhaps in columns

Note

A note

Warning

or a warning, perhaps with a highlight

Static diagrams

Interactive diagrams are fun, but require detailed specification. Simple diagrams can be done really fast with just basic labels:

flowchart LR
    A{Is Y continuous?} -->|No| B(Table)
    A -->|Yes| C{Is X1 continuous?}
    C -->|No| D[Box plot]
    C -->|Yes| E[Scatter plot]

flowchart LR
    A{Is Y continuous?} -->|No| B(Table)
    A -->|Yes| C{Is X1 continuous?}
    C -->|No| D[Box plot]
    C -->|Yes| E[Scatter plot]

What about code

  • Code blocks start and end with 3 backticks, such as ```{language options} some code ```
  • “language” and “options” depend on the interpreter

Quarto supports a lot of languages but I typically use R, Stan, CSS, and HTML only for my work.

  • The most powerful option (use carefully) is “results: asis”
    • which tells Quarto to process the output of the R code chunk as if it was part of the markdown document
    • This lets you create many pages of document from a single code block!

Technicalities that matter

  • There are not many technicalities - it typically just works
  • I could turn this presentation into a regular web page by only changing a few words here and there
    • A few more small changes and most of the presentation could be a Word document (or PowerPoint or Beamer)
      • I’d lose the interactivity though
  • The more detail oriented you are the more small technicalities you will come across, most are easy to address though
    • Here’s the most important issue in my view:

Let’s talk graphics formats - click here.

Conclusion to Part 2

  • Don’t be flashy for the sake of being flashy (e.g. slow slide transitions)
    • You’re going to just annoy yourself and distract the audience
  • Think of your audience, the message you’re trying to convey, and then ask, “How can presentation technology support me in transferring information to my audience?”

This presentation was created using the Reveal.js format in Quarto, using the RStudio IDE. Background image created using image editor GIMP by compositing images from CoPilot.