Free self-study materials
Six modules.
Real practice.
Read the lesson, download the script, work with a safe synthetic dataset and compare your approach with the answer guide. No account is required.
Build confidence through a repeatable workflow.
These materials teach safe foundations. They are not a substitute for a study protocol, statistical supervision, ethical approval or analysis of confidential participant data.
01Start a reproducible R project
Create a project, script and a clear folder structure before touching data.
+
Start a reproducible R project
Create a project, script and a clear folder structure before touching data.
Lesson notes
- Use one RStudio Project for one study. Keep `data_raw`, `data_clean`, `scripts`, `outputs` and `notes` separate.
- A script is a record of instructions. Comment why you make a decision, not only what code does.
- Never edit the only copy of raw data. Re-run your script to create a clean version.
Practice task
Create a folder called r_foundations. Add the starter script, then write a comment stating what one row of your dataset represents.
02Import and inspect data
Read a CSV, inspect variable types and find missing values before analysis.
+
Import and inspect data
Read a CSV, inspect variable types and find missing values before analysis.
Lesson notes
- Use `read.csv()` for a simple comma-separated file. Always inspect the result with `str()` and `summary()`.
- A numeric-looking field may arrive as text; do not assume it is ready for a calculation.
- Missing values are information. Count them and check whether they use one agreed code.
Practice task
Download the practice dataset. Import it, use `str()` and count missing values for every variable.
03Clean without losing the raw file
Check IDs, categories, ranges and duplicates; record each decision.
+
Clean without losing the raw file
Check IDs, categories, ranges and duplicates; record each decision.
Lesson notes
- Check that identifiers are unique when the study expects one row per participant.
- Review category spelling and unexpected values using `table()`.
- Investigate impossible values before changing them. Do not delete outliers only because they look inconvenient.
Practice task
Use the practice data to check duplicate participant IDs, list the categories for sex and calculate the minimum/maximum age.
04Describe and visualise
Use summaries and plots to understand the people and records behind the numbers.
+
Describe and visualise
Use summaries and plots to understand the people and records behind the numbers.
Lesson notes
- For categorical variables, start with counts and percentages. For numeric variables, inspect centre and spread.
- A plot should have a clear title, labelled axis and a question it helps answer.
- Do not use a chart merely because it looks attractive—choose it for the variable type.
Practice task
Calculate the mean and median waiting time. Make a simple histogram of wait_minutes.
05Compare and interpret carefully
Frame a comparison, check group sizes and report the estimate before making a claim.
+
Compare and interpret carefully
Frame a comparison, check group sizes and report the estimate before making a claim.
Lesson notes
- State the outcome and the groups first. Example: is missed appointment different by sex?
- Small practice datasets are for learning code, not for making real-world conclusions.
- A p-value does not tell you whether a finding is important, causal or ready for a policy decision.
Practice task
Create a two-way table of sex by missed_appointment. Calculate the mean wait_minutes by missed_appointment status.
06Write a short analysis note
Turn code output into a transparent, cautious research update.
+
Write a short analysis note
Turn code output into a transparent, cautious research update.
Lesson notes
- Start with data source, period, unit of analysis and the number of records used.
- Report the key descriptive result, then state limitations such as sample size, missingness or design.
- Save the script, output table/figure and short interpretation together so another person can review the work.
Practice task
Write 120–180 words summarising the practice dataset: size, waiting-time summary, one comparison and two limitations.