A cardiology department at a regional hospital has been collaborating with a pharmaceutical company developing a new diagnostic support tool for chest pain patients. Before deciding whether to include your hospital in a larger clinical trial, the company asks for a quick baseline summary of your recent patients: “Nothing complicated—just basic descriptive numbers so our statisticians can take a look.”
You are given a dataset of 303 patients admitted with chest pain (age, cholesterol, blood pressure, heart rate, etc.), along with whether they were later confirmed to have coronary artery disease. Your supervisor tells you: “This is not a statistics task—we just need simple summaries like average values and variability for key variables. The statisticians will handle the rest.” Later that day, you receive a follow-up email: “Please report mean and standard deviation for age, cholesterol, resting blood pressure, and max heart rate, stratified by heart disease status. We need it today to decide whether your site qualifies.”
The data is stored in .csv format and the company has provided you access to a GDPR-friendly and secure server where all the company data are stored. The only software installed on the server is R and RStudio.
Medical science and clinical practice relies on statistics
Medical statistics relies on clinical knowledge and patient data
Medical science and clinical practice relies on statistics
Max heart rate and coronary heart disease…
Max heart rate and age…
Age and coronary heart disease?
Go to https://danmazjen.github.io/medicinsk-statistik, exercises, and find the Cleveland Heart Disease dataset
Copy the following code:
variable pane.ggplot2 package
hd_data, and then,
ggplot2 package
hd_data, and then,
ggplot skeleton
aes (aestetics)
+ more…
ggplot to do with the skeleton
In this course, we will
ggplot2 as you’ve already experiencedR outputNever <——-> I took a course in computer science
Not at all <——-> I had nightmares about this course already
Ronald Fisher level <——-> Who is Ronald Fisher?
I want to learn everything <——-> I don’t mind failing 1st time
We’ll start again by learning the basics of R for medical purposes
RStudio is a window that helps us navigate in R.
General RStudio Options
General Save Workspace to .RData on exit (never)
Editing: Use native pipe operator
Saving: Automatically save when editor loses focus