knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
In this example we consider a simulator for the incidence of type-2 diabetes and stroke with various risk factors as well as mortality from stroke and other causes. Interventions that aim to reduce systolic blood pressure in the population are also considered
To run the example, the following data files are needed
The data files (with MONICA data unzipped) should be placed to directory called data
in relation to the working directory for the purposes of this example.
The R script files required to run the example can be downloaded at http://users.jyu.fi/~santikka/Sima/diabetes_and_stroke.zip
The zip file contains the following
diabetes_and_stroke.R
is the primary script that contains the all the simulator definition and simulation runs.events.R
contains all the event definitions.data.R
contains the function to generate the initial population.functions.R
contains utility function definitions that are used throughout.The contents of these scripts are also listed in the following sections for direct viewing
The file diabetes_and_stroke.R
provides the code to run the entire example
The file events.R
includes the event definitions
The file data.R
contains the following function for generating the initial population (of size n
)
The file functions.R
provides a set of useful functions used in defining events and the initial data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.