Week 9

Iteration
Published

March 5, 2026

Modified

March 17, 2026

Topics

Part 9:

  • Introduce statistical modeling and learn how to fit a simple linear regression model and run a t-test in R
  • Learn how to use broom functions to tidy up statistical model output
  • Learn about for loops
  • Understand how to apply a function to a list
  • Learn how to iterate over a list using map() functions from the purrr package

Announcements

  • Functions of the Week
    • Please upload to Sakai your FOTW presentation by 7 am of the day you are presenting.
  • Cascadia R Conf in June 26-27 this year. It will be held at OHSU in RLSB. This is a great conference to meet other R enthusiasts in the area and learn more about what they are working on.

Class materials

  • Class materials in OneDrive folder BSTA_526_W26_class_materials_public.
  • For today’s class, make sure to download to your computer the folder called part9.
  • Open RStudio by double-clicking on the project file called BSTA_526_W26_class_materials_public.Rproj in the main OneDrive folder.

Note: The link to the slides version of the class notes is not working. Please see the OneDrive folder for the html of the slides.

Part OneDrive folder Slides Webpage
9

Readings

Required

Optional

  • purrr tutorial by Jenny Bryan
    • I recommend the Core purrr lessons
  • Advanced R book (we’ve graduated from the R4DS book!) by Hadley Wickham
    • Functionals: Chapter 9
      • This chapter covers purrr in detail. It’s the most technical of the suggested readings.

Post-class survey

  • Please fill out the post-class survey to provide feedback. Thank you!
  • Previous muddiest points and clearest points with responses are collected here.

Homework

  • See OneDrive folder for homework assignment.
  • HW 9 due on 03/05.

Recording

  • In-class recording links are on Sakai. Navigate to Course Materials -> Schedule with links to in-class recordings.