Cite as: S. Zinn; 2014; The MicSim package of R: An entry-level toolkit for continuous-time microsimulation; International Journal of Microsimulation; 7(3); 3–32. doi: 10.34196/ijm.00105
Abstract
High entry barriers might discourage many social scientists from using existing microsimulation software. This article presents the functionality and capabilities of the free and open source R package MicSim which allows performing continuous-time microsimulation at a very fine-grained level from a low level entry point. Hence, the package might also be of interest to people who are new to R. The package implements a generic microsimulation model for a wide range of demographic applications. Its central device is the individual life-course, which is defined by the sequence of states the individual visits over time and the intervals between the transitions from one state to another. The MicSim model is by design a discrete-event simulation model in which a demographic event implies a change in the state of an individual. The considered population is open and life-courses are specified to evolve along three continuous time scales: individual age, calendar time, and the time that an individual has already spent in the current state. The stochastic model of the microsimulation is parameterized with a base population, transition rates, and (if applicable) a population of migrants. Besides stochastic events, the package allows specifying deterministic events such as enrolment of children in elementary school. Example applications illustrate the capabilities of the package.
This article contains 1 figure and 1 table.
Figures
Figure 1. Sketch of a life-course of a male who is part of the initial population on January 1, 2000. At this time he is a = 10.9 years old, never married, and childless. On May 5, 2013, 13.3 years after he had entered the virtual population, he marries; and after 19.6 years he becomes father for the first time.
Tables
Table 1. Example state space: State variables and their corresponding values. (Value labels, subsequently used, are given in parentheses)
State Variable
Possible Values
Sex
Female (f), male (m)
Marital status
never married (NM), married (M), divorced (D), widowed (W)
Fertility status
childless (0), one child (1), two children (2), three and more children (3+)
educational attainment
no education (no), primary education only (low), lower secondary school (med), upper secondary or tertiary education (high)