basic-statistics-and-projects-in-R

Basic Statistics and Projects in R

Information and course material for the Basic Statistics and Projects in R course of the Public Health Sciences Course Program at the University of Bern

Table of contents

  1. Preparation
  2. Timetable
  3. Slides
  4. Exercises
  5. Data sets
  6. Further online material
  7. Contact

Preparation

Mandatory steps

Course participants will bring their own laptops with installed versions of R, RStudio, and Git:

  1. Download and install R:
    • Windows: Click on “Download R for Windows”, then click on “base”, then click on the Download link.
    • macOS: Click on “Download R for macOS”, then under “Latest release:” click on R-X.X.X-arm64.pkg or R-X.X.X-x86_64.pkg for Apple silicon (M1/M2) or older Intel Macs, respectively.
    • Linux: Click on “Download R for Linux” and choose your distribution for more information on installing R for your setup.
  2. Download and install RStudio.
  3. Install Git using the following instructions.
  4. If you don’t already have one, don’t forget to create a GitHub account.

Optional steps

The following preparation steps are optional. You will also have time during the course to complete these steps.

  1. Make sure RStudio knows about Git by following the corresponding section here.
  2. Install the usethis package for R using the following command: install.packages("usethis")
  3. Set up Git using the following command: usethis::use_git_config(user.name = "Jane Doe", user.email = "jane@example.org")
  4. Generate a personal access token (PAT) and store your PAT as described in Section 9.3 and 9.4 here.

Required packages

To work on the exercises, course participants have to install the following packages:

Simply type install.packages("packagename"), but RStudio will ask you about it as well if you want to load a package that you haven’t installed yet.

Timetable

Day Time Topic Slides Lecturer(s)
Friday, 2 June 2023 09:00-12:30 Optional: Maths and probabilities refresher HTML Ben Spycher
Monday, 5 June 2023 09:00-12:00 Projects in R: Introduction to R, the tidyverse, and data wrangling HTML Christian Althaus, Alan Haynes
Monday, 5 June 2023 13:00-17:00 Projects in R: Data visualization with the tidyverse HTML Christian Althaus, Judith Bouman, Martin Wohlfender
Tuesday, 6 June 2023 09:00-12:30 Projects in R: Reproducibility and GitHub HTML Christian Althaus, Alan
Thursday, 8 June 2023 09:00-12:30 Basic Statistics: Inference about the mean HTML Ben Spycher
Thursday, 8 June 2023 13:30-17:00 Basic Statistics: Non-normal data, correlation and dependent/paired data PDF Beatriz Vidondo
Friday, 9 June 2023 09:00-12:30 Basic Statistics: Inference about proportions and rates PDF Ben Spycher
Friday, 9 June 2023 13:30-17:00 Basic Statistics: Continue R project with a guided data analysis   Ben Spycher, Beatriz Vidondo

Slides

You can download all slides here. If you want to see them in your web browser, click the corresponding link in Timetable.

Exercises

You can find material for the exercises here.

Data sets

We will use the following data sets during the course:

File Description  Source Exercise
COVID19Cases_geoRegion.csv Laboratory-confirmed SARS-CoV-2 cases by region FOPH -
COVID19Cases_geoRegion_AKL10_w.csv Laboratory-confirmed SARS-CoV-2 cases by region and age group FOPH -
covid_cantons_2020_06.csv Laboratory-confirmed SARS-CoV-2 cases for selected cantons and time period FOPH -
ebola.csv World-wide Ebola cases from 2014-2016 data.world 4
insurance_with_date.csv Data on costs of medical procedures kaggle 5

Further online material

We recommend the following online tutorials and books on R and RStudio with specific applications to epidemiology, public health, and data science:

Contact

If you have any questions regarding the course, please get in touch with us at phs-info.ispm@unibe.ch or christian.althaus@unibe.ch.