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

Data files

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.

R scripts

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

The contents of these scripts are also listed in the following sections for direct viewing

Main script

The file diabetes_and_stroke.R provides the code to run the entire example


Events

The file events.R includes the event definitions


Initial population

The file data.R contains the following function for generating the initial population (of size n)


Utility functions

The file functions.R provides a set of useful functions used in defining events and the initial data




santikka/Sima documentation built on Dec. 22, 2021, 10:15 p.m.