
i
i
“K23166” — 2015/1/28 — 9:35 — page 155 — #181
i
i
i
i
i
i
Chapter 10
Simulation
Simulations provide a powerful way to answer questions and explore properties of statistical
estimators and procedures. In this chapter, we will explore how to simulate data in a variety
of common settings, and apply some of the techniques introduced earlier.
10.1 Generating data
10.1.1 Generate categorical data
Simulation of data from continuous probability distributions is straightforward using the
functions detailed in 3.1.1. Simulating from categorical distributions can be done manually
or using some available functions.
> options(digits=3)
> options(width=72) # narrow output ...