Book cover

Epidemiology with R

by Bendix Carstensen
Senior Statistician at Steno Diabetes Center Copenhagen

The purpose of the book is to show how to use R in standard Epidemiology, mainly chronic disease epidemiology.
  The book demonstrates analysis through R code, but your benefit will not be overwhelming if you do not try the code by yourself, preferably by modifying it to see what happens. To that end, the entire code shown in the book is available for you online, see below.
  However, (quoted from the preface of the book): "If you know nothing about epidemiology, find a book on epidemiology before embarking on this book. If you know absolutely nothing about statistics, you may have a hard time with this book, even if the formal prerequisites are small."
  The book has grown out of the course Statistical Practice in Epidemiology with R that I have been teaching since 2004 together with my colleagues Michael Hills, Martyn Plummer, Esa Läärä, Lyle Gurrin, Krista Fischer, Mark Myatt, Janne Pitkäniemi, Damien Georges and Peter Dalgaard; usually 5 of us at a time. But there is not a one-to-one correspondence between book and course, and neither are anyone but me responsible for the content of the book.
 

The Epi package

The course Statistical Practice in Epidemiology with R resulted in the launch of the Epi package in 2005, and many extensions and improvements since then. Functions from the Epi package are extensively used in the book, so you will need to install it.
  On the package website are links to the vignettes from the Epi package; they provide more examples and code of relevance.
  The code in the book works with Epi version 2.41. The current version is 2.44, and I have found no errors using this version. I will try to make the necessary changes in the code, should newer versions of the Epi package necessitate this.

R code from the book

The code from each chapter is here, but with pretty arcane file names, so perhaps more accessible via the chapter headings: In the chapter 'Using R' a dataset fem is used; it is available in different formats here

Contact and feed back

If you have comments or suggestions for the book you can mail me at b@bxc.dk.

Nobody is perfect

...neither is the book nor its author, so here is a lits of errata
  If you find bugs or blunders in the book I will be happy to be notified.
Last updated 25 May 2021, BxC