Jennifer’s fictional teaching course

One cohort. One continuous analysis.

Follow Jennifer’s entirely fictional cohort from the study question and first data checks through description, comparison, measures of association, regression, confounding and final reporting.

One course, not seven separate pages. Work down this page in order on a first visit. Returning students can use the chapter links without leaving Jennifer’s story.

Fictional study background · course start

Jennifer is the opening case in a realistic synthetic cohort.

This teaching study was created to practise a complete observational analysis without real patient data. In a fictional UK general-practice network, 720 adults aged 65–96 were recorded at baseline and followed for six months. Jennifer, aged 82, is the opening participant case.

Jennifer lives alone, takes eight regular medicines and has a baseline frailty index of 0.34. A structured medication review was recorded at baseline; later outcomes were measured at six months. She makes the data human, but she and every other participant are fictional.

Setting and cohortFictional general practices

Jennifer and 719 other synthetic participants form the six-month cohort.

Main questionMedication review and later disability

Estimate the adjusted association; do not claim that review caused the outcome.

Skills to practiseAudit, describe, compare, model and report

Use effect estimates, uncertainty, assumptions and reproducible code throughout.

Your route through the course

Seven decisions on one page.

Chapter 01 · Meet the cohort

Start with people, time and the question.

Jennifer’s fictional study

What happened, and when?

Participants
Jennifer and 719 other entirely fictional adults aged 65–96, represented by one row each.
Baseline
Age, medicines, frailty, disability and whether a structured medication review was recorded.
Follow-up
Disability, quality of life, falls and hospital admission were recorded six months later.
Main question
Was baseline medication review associated with disability at six months after accounting for pre-specified baseline differences?
Important limit
Review was observed, not randomly allocated. The course estimates an association; it cannot prove that review caused the outcome.
Check the file

Confirm 720 rows, one unique participant identifier per row, valid codes and plausible ranges.

Protect missing data

A blank outcome is unknown, not “no disability”. Keep missing values visible and record the analysis denominator.

Map the question

Name the population, exposure, comparator, outcome and six-month timeframe before calculating anything.

You learned

A trustworthy analysis begins with the study design and a safe data file, not with a test menu.

Go deeper · study design, populations and missing data →

Continue in this courseChapter 02 · Characterise data →Describe the whole cohort before comparing medication-review groups.

Chapter 02 · Characterise data

Choose summaries that fit each variable.

VariableTypeUseful first summaryWhy
Medication reviewBinary categoryCount and percentageShows how many participants are in each exposure group.
AgeContinuousMean and SD, plus range and plotCentre and spread are useful when the distribution is reasonably regular.
Medication countCount and often skewedMedian and IQR, plus distributionA few high values can pull the mean away from a typical participant.
Frailty categoryOrdered categoryCount and percentage in each levelThe order matters, but gaps between levels are not assumed equal.
Six-month disabilityBinary outcomeObserved n, missing n and percentageThe denominator must exclude outcomes that were not observed.

Write the cohort portrait before the comparison.

Describe who entered the study, the distribution of important variables and how much information is missing. Do not use baseline p-values to decide whether the groups are “the same”.

You learned

Variable type, distribution and missingness determine an honest summary.

Course output

One clear overall table, one useful distribution plot and a short clinical description of the cohort.

Go deeper · estimates, spread and statistical uncertainty →

Continue in this courseChapter 03 · Compare groups →Match each unadjusted question to the outcome that was recorded.

Chapter 03 · Compare groups

Let the question and outcome choose the comparison.

QuestionOutcomeUseful approachRead first
Did disability proportions differ?BinaryCross-tabulation; chi-square or Fisher’s exact testBoth proportions and their difference
Did mean quality of life differ?ContinuousGroup summaries, plot and Welch’s t-testMean difference and confidence interval
Did medication-count distributions differ?Skewed countGroup distributions and a rank-based comparison when justifiedMedians, IQRs and the shapes of both distributions

A p-value does not tell you how large, important or causal a difference is. Report the observed group values, an effect estimate and its confidence interval before the p-value.

You learned

There is no universal “two-group test”; the recorded outcome and the target comparison matter.

Course output

A small comparison table that names the groups, method, estimate, uncertainty and assumptions.

Go deeper · follow a comparison from data to p-value →

Continue in this courseChapter 04 · Measure association →Turn the disability table into absolute and relative measures.

Chapter 04 · Measures of association

Tell the same comparison on more than one scale.

Baseline reviewNo disabilityDisabilityObserved total
No review400112512
Review15545200
Outcome proportions

22.5% versus 21.9%

Disability was recorded for 45/200 reviewed participants and 112/512 unreviewed participants.

Absolute scale

+0.6 percentage points

The reviewed group had about 0.6 more recorded disability cases per 100 participants. The confidence interval is essential.

Relative scale

Proportion ratio ≈ 1.03

The six-month outcome proportion was about 1.03 times that in the no-review group.

Odds scale

Odds ratio ≈ 1.04

The odds were similar, but odds are not probabilities and the estimate is still unadjusted.

Because disability was also present at baseline for some people, these are six-month outcome proportions, not risks of new disability. Always carry the denominator, time point and reference group with the estimate.

You learned

Absolute and relative measures answer different practical questions; neither should travel without uncertainty.

Course output

A plain-language sentence on the absolute scale and another on the relative scale.

Go deeper · interpret differences, ratios and their intervals →

Continue in this courseChapter 05 · Choose regression →Move from unadjusted measures to a model suited to the outcome.

Chapter 05 · Choose regression

Start with the outcome, not the software menu.

Continuous

Linear regression

Quality-of-life score → adjusted mean difference.

Binary

Logistic regression

Disability yes/no → adjusted odds ratio and useful predicted probabilities.

Ordered

Ordered logistic

Robust, pre-frail, frail → proportional-odds model when its assumption is defensible.

Count

Poisson or negative binomial

Number of falls → rate or count model after checking exposure time, zeros and overdispersion.

Time to event

Cox regression

Days to admission → hazard ratio while retaining censoring information.

Jennifer’s primary model

Six-month disability is binary, so the course uses logistic regression. The model includes medication review and a pre-specified set of baseline variables. Its adjusted odds ratio is a conditional association, not automatic proof of cause.

Check assumptions

Inspect coding, sparse categories, functional form, influential observations and whether the available events can support the planned parameters.

You learned

Regression choice follows the outcome, design and estimand; covariates do not rescue a poorly framed question.

Go deeper · choose covariates for the model’s purpose →

Continue in this courseChapter 06 · Understand confounding →Explain why reviewed and unreviewed participants may differ before follow-up.

Chapter 06 · Confounding

Ask why people received the exposure.

Clinical need

Review was not random.

People taking more medicines or living with frailty may be more likely to receive a review.

Shared causes

The same features predict disability.

Baseline frailty and disability can influence both receipt of review and the later outcome.

Adjustment

Compare more similar participants.

Use age, sex, social circumstances, medication count and baseline health only when their causal role is justified in advance.

Remaining caution

Adjustment is not randomisation.

Measurement error, model form and unmeasured causes can leave residual confounding.

Do not select confounders because their bivariate p-values are below 0.05. Use timing, subject knowledge and an explicit causal story.

You learned

A change from the crude to adjusted estimate can reveal important baseline structure, but it cannot prove every confounder was controlled.

Course output

A short table comparing crude and adjusted estimates, with one sentence explaining the chosen adjustment set.

Go deeper · causal diagrams and adjustment sets →

Continue in this courseChapter 07 · Complete the analysis →Bring the design, estimates, assumptions and limitations back together.

Chapter 07 · Complete the analysis

Answer the question, not the software output.

  1. Reconcile the participants. Explain why the model may use fewer than the 720 people who entered the cohort.
  2. Lead with the estimate. Give the adjusted association and confidence interval before the p-value.
  3. State what was adjusted for. Link every covariate to the pre-specified causal rationale.
  4. Report diagnostics. Show that coding, functional forms, sparse data and influential observations were checked.
  5. Keep the conclusion observational. Describe compatibility, magnitude and uncertainty without saying the review caused disability.
  6. Preserve the record. Keep the data dictionary, syntax, output, decisions and final interpretation together.

A defensible final sentence

In this entirely fictional cohort, the adjusted estimate was compatible with lower odds of six-month disability among reviewed participants, but the confidence interval also included little or no difference. The observational design, missing outcomes and possible residual confounding limit causal interpretation.

You learned

A complete analysis is an argument connecting the question, design, data checks, estimates, uncertainty, assumptions and limitations.

Take it forward

Use the same structure in a dissertation: question in the Introduction, decisions in Methods, estimates in Results and limitations in Discussion.

Go deeper · turn the analysis into a written argument →

Course summary

What Jennifer’s story has taught you.

Study

Define who was observed, what happened first and what the design can support.

Describe

Match summaries to variable type, distribution and missingness.

Compare

Choose a comparison that answers the question and report magnitude before significance.

Measure

Use absolute and relative scales with denominators, reference groups and intervals.

Model

Choose regression from the outcome and target quantity.

Adjust

Use causal reasoning for confounding, not automatic p-value screening.

Report

Join the decisions into a reproducible, appropriately cautious conclusion.

Common files

Download once. Use in any route.

These data were designed for teaching. The medication review is observational, not randomised, so the crude comparison is deliberately confounded by baseline frailty. Do not use the simulated results for clinical decisions.

Model map

Start with the dependent variable.

The model is driven first by the type of outcome, then by the study design, dependence between observations, distribution and target measure. This is a starting map, not a substitute for checking assumptions.

Continuous

Linear regression

Example: six-month EQ-5D-style score. Report an adjusted mean difference.

Binary

Logistic regression

Example: disability yes/no. Report odds ratios and, where useful, adjusted probabilities.

Ordered

Ordered logistic

Example: robust, pre-frail, frail. Check the proportional-odds assumption.

Count

Poisson / negative binomial

Example: number of falls. Check exposure time, zeros and overdispersion.

Time to event

Cox regression

Example: days to admission. Preserve censoring and check proportional hazards.

Return to Chapter 05 · Choose regression

Go deeper · software and statistical references

Stata video tutorials

Short official videos covering the interface, data management, tests and models.

Open Stata videos

IBM SPSS resources

Official getting-started material, feature videos and documentation.

Open IBM resources

RStudio User Guide

Official guidance on the four panes, projects, source files and reproducible work.

Open the RStudio guide

Statistics at Square One

A concise BMJ reference for displays, tests and study design. The free online text is an older edition.

Open the BMJ reference

DAGitty

Draw causal diagrams and examine adjustment sets before choosing covariates.

Learn with DAGitty

Official manuals

Use software help alongside the worked pages; commands and defaults can change between releases.

Read An Introduction to R