The foundations of statistics: A simulation-based approach

Authors: Shravan Vasishth and Michael Broe

(Downloading or viewing this work binds you to its licensing conditions)

The book draft .pdf

The source .Rnw file (see preamble for usage information) .Rnw

R source code extracted from the book .R

To compile the Sweave file from scratch, download the .Rnw file, the frontmatterheaders.tex file into a suitable directory, and perhaps also put the .Rprofile file into your home directory (it's here). Then use the script by ggorjan below to get up and running. I'll put in more comprehensive instructions here soon.

assistance with using these materials

Here is an optimal approach to running the latex and R code together using Sweave.
  • Install Emacs, LaTeX on your system
  • Install Emacs Speaks Statistics
  • Install the following tools: Noweb (literate programming tool), Rubber.
  • Write LaTeX and R code in an .Rnw file, then do Sweave.sh file.Rnw after installing this bash shell script written by ggorjan (if you don't want to use rubber, then look at his web page version for a texi2dvi version).
  • Use (x)emacs with AucTeX and preview-latex.
  • LaTeX and PDF-based presentations tools.
  • Stephen Eglen educated me on how to get code chunks in Sweave to get indented automatically on hitting RETurn. Here is his hack, which should go into your .emacs file. My .emacs file is here, as an example: click here.
  • When in doubt about almost any question in life, you can get help. But be careful! Some people can bite your head off if you don't RTFM first.

    additional material

    1. An R mailing list for language: here.
    2. I also maintain a listing of articles that use lme4 or predecessors: see here. Email me if you want your articles included (I need it in bibtex-format, and the subject of the email should be lme4bib).
    3. Everyone should read Stuff Worth Knowing by Paul Johnson.
    4. Here's a brief tutorial I wrote on the matrix formulation of linear models. It will eventually go into the book. If you are scared of the partial differentiation steps in the tutorial try the sage calculus tutorial; you will never fear that stuff again..

    how to cite this book

    The foundations of statistics: A simulation-based approach, Shravan Vasishth and Mike Broe. Manuscript, University of Potsdam, Germany. 2009.

    who uses/cites this book?

    I list some web sites which mention this book in syllabi etc. If you are using the book and are not listed here, please tell me about it, so that I can add your name to the list.
  • Muenich
  • Jena
  • Northwestern
  • Rochester [link broken]
  • Edinburgh
  • University of California, San Diego
  • University of Connecticut
  • Taiwan
  • Wikiversity
  • Maryland
  • Language Variation and Change, 20 (2008), 409–450. A sociotonetic analysis of Sui dialect contact, by James N. Stanford.
  • Delaware
  • Concordia
  • LOT School
  • Pallier's course
  • Cornell


  • Comments, criticism, and requests for specific topics are most welcome (email: vasishth squiggle rz dot uni-potsdam dot de).