Statistics: From First Principles to Regression

Datasets

The data behind every In R box in the book: 17 files, 2,336 rows in all.

Download all (zip) ↓

These are synthetic teaching data. No row describes a real person, child, woman, household, village or district; names such as “District A” and “PHC Urban”, and every ID, are invented. Several are built so that the model in the book gives the numbers printed there.

How to use them

Unzip so that the folder data sits in your R working directory. The book's code then runs as printed:

cl <- read.csv("data/clinic_children.csv")

Or read a file straight from this site, without downloading it:

cl <- read.csv("https://drharshmaheshwari.com/doctors/books/statistics-first-principles-to-regression/data/clinic_children.csv")

Empty cells are missing values (NA in R). The files have no comment lines.

The files

How they were built

make_data.R is the script that wrote them, with a fixed random seed for each dataset, so the files can be rebuilt exactly (about three minutes in R; it needs the survival package). Its header explains how the engineered datasets were made. One file, paired_hb_ifa.csv, is a ten-row table typed by hand.

Licence

The same as the book: CC BY-NC-SA 4.0. Free to copy, share and adapt for non-commercial use, with credit, under the same licence. If they help you, you can support this project.

Read the book online