Tutorial illustration

Tutorial description

Scientists seek to answer questions using rigorous methods and careful observations. These observations - collected from the likes of field notes, surveys, and experiments - form the backbone of a statistical investigation and are called data. Statistics is the study of how best to collect, analyze, and draw conclusions from data. It is helpful to put statistics in the context of a general process of investigation:

  1. Identify a question or problem.
  2. Collect relevant data on the topic.
  3. Analyze the data.
  4. Form a conclusion.

In this tutorial, we focus on steps 1 and 2 of this process.

Learning objectives

Lessons

1 - Language of data

  • Load data from the textbook companion package
  • Introduce data frames and tidy data
  • Discuss variable types connecting terminology from textbook to R
  • Mutate data frames to convert data types
    • Numerical to categorical conversion
    • Filtering and then drop levels
    • Combine levels of categorical
    • Create new variable based on two existing variables (e.g. BMI)

2 - Types of studies

  • Define observational studies and experiments
  • Discuss scope of inference 2x2 grid with random assignment and sampling
  • Define Simpson’s paradox in a 2 cat var case
    • Use R to make a contingency table
    • group_by() third variable and make table again to demonstrate Simpson’s paradox

3 - Sampling strategies and experimental design

  • Define simple random sample, stratified sample, cluster sample, multistage sample

  • Use R to obtain SRS and stratified sample

    • slice_sample()
    • group_by() |> slice_sample()
  • Discuss benefits and drawbacks of choosing one sampling scheme over another

  • Identify the principles of experimental design

  • Discuss the purpose of each principle

  • Use R to do random assignment and random assignment after blocking

    • slice_sample()
    • group_by() |> slice_sample()

4 - Case study

  • Apply terminology, principles, and R code learned in this tutorial to a case study

Instructor

Mine Çetinkaya-Rundel

Mine Çetinkaya-Rundel

University of Edinburgh, Duke University, RStudio

Mine Çetinkaya-Rundel is Associate Professor of the Practice position at the Department of Statistical Science at Duke University and Data Scientist and Professional Educator at RStudio. Mine’s work focuses on innovation in statistics and data science pedagogy, with an emphasis on computing, reproducible research, student-centered learning, and open-source education as well as pedagogical approaches for enhancing retention of women and under-represented minorities in STEM. Mine works on integrating computation into the undergraduate statistics curriculum, using reproducible research methodologies and analysis of real and complex datasets. She also organizes ASA DataFest, an annual two-day competition in which teams of undergraduate students work to reveal insights into a rich and complex dataset. Mine has been working on the OpenIntro project since its founding and as part of this project she co-authored four open-source introductory statistics textbooks (including this one!). She is also the creator and maintainer of datasciencebox.org and she teaches the popular Statistics with R MOOC on Coursera.