simPop: Population simulation

View source: R/simPop.R

simPopR Documentation

Population simulation

Description

Simulate population with birthdate and gender

Usage

simPop(n, min.age = 20, max.age = 90, sex = 0.5, mortality = 0.05)

Arguments

n

Number of subjects

min.age

minimal age

max.age

maximal age

sex

gender distribution: value between 0 and 1

mortality

risk of death: value between 0 and 1

Details

Sample data for illustration, i.e., vignettes and example sections of the package.

Value

data.table with columns: pnr, sex, birthdate, status, doddate where doddate is the date of death for subjects with status = 1 and the current date for subjects with status = 0.

Author(s)

Thomas A. Gerds <tag@biostat.ku.dk>

See Also

simPrescriptionData, simAdmissionData

Examples

set.seed(7)
simPop(7)

tagteam/heaven documentation built on March 24, 2024, 7:58 a.m.