← Course home
MODULE 2 · FIRST-YEAR LEVEL

Data, measurement and data quality

What does a number measure, and how reliably?

70–90 minutesConcepts first, R optionalSynthetic data

Learning outcomes

Conceptual lesson

Variables may be categorical or numerical, but a numeric-looking code is not necessarily a quantity. Student ID is an identifier, study hours are a quantitative measurement, and A/B/C labels are categorical. Stress ratings from 1 to 5 are ordinal; equal distances between levels are not automatically guaranteed.

Validity concerns whether a measure captures the intended construct, while reliability concerns its consistency under comparable circumstances. Self-reported study hours may involve recall or social-desirability bias. Replacing missing data with zero confuses an observed zero with “unknown”.

Prepare a data dictionary covering column name, construct, units, allowable values and the missing-value convention. State the observational unit and when each measurement was taken.

Worked research example

The `stress_rating` column has three missing entries. Those individuals are not known to have zero stress; the values are unknown. Reporting the number missing is preferable to inventing scores of zero.

Common reasoning trap

Coding missingness as zero or treating an ID as a continuous outcome can make the calculation run but leave the analysis scientifically wrong.

Practice tasks

  1. 1. Classify every dataset column as nominal, ordinal, quantitative or identifier.
  2. 2. Count missing `stress_rating` values and report the denominator.
  3. 3. Name two likely sources of measurement error in self-reported study time.

Explain your reasoning, not just the numerical result.

Optional R practice

Download the fictional CSV into your working folder, then run the script below or download the .R file. No additional packages are needed.

Download CSV · Download R lab · Module 0 refresher

# Statistics Lab / ferdo — synthetic data (no real student records)
# Save stats_synthetic.csv in your working directory.
d <- read.csv("stats_synthetic.csv", stringsAsFactors = TRUE)
stopifnot(nrow(d) == 36, all(c("score_pre","score_post","group") %in% names(d)))
# Groups are observational labels: differences cannot establish a treatment effect.

d <- read.csv("stats_synthetic.csv")
str(d)
sapply(d, function(x) sum(is.na(x)))
table(d$stress_rating, useNA = "ifany")
# Do not replace NA with 0 without justification.

Stretch: mathematical track

Compare MCAR, MAR and MNAR missingness conceptually; the mechanism cannot generally be established from observed data alone.

Exit ticket

Write one evidence-bounded claim and one limitation about this week's example.

This week's student workbook

Four original written problems (20 marks) and a formative four-question self-check.

Open week 2 workbook →