Skip to main content

Tutorials

A hands-on series on one simulated TB study, from importing data to machine learning, in R and Python

Practical R and Python tutorials using a simulated TB study dataset, from importing data in RStudio to working with the same data in pandas.

Illustration of CSV files flowing into an R cube and across to a Python cube

About the series

The dataset: 500 fictional participants from a simulated bronchoalveolar lavage (BAL) study, with participant metadata and cell counts for each study visit. The raw files are deliberately messy, like real study data. No row describes a real person.

bal_metadata.xlsx bal_cell_counts.xlsx bal_baseline.csv

You’ll need: R and RStudio for every tutorial, plus Python from Tutorial 2 onwards. Work through them in order: each one builds on the last.

Coming next

3 Cleaning the data: fixing inconsistent categories, duplicates and missing values

4 Statistics: comparing groups and testing associations

5 Machine learning: building and evaluating a predictive model in Python