These two datasets each contain a random sample of 10,000 persons from
the Danish National Diabetes Register. DMrand is a random sample
from the register, whereas DMlate is a random sample among those
with date of diagnosis after 1.1.1995. All dates are radomly jittered by
adding a U(-7,7) (days).
Usage
data(DMrand)
data(DMlate)
Format
A data frame with 10000 observations on the following 7 variables.
sex
Sex, a factor with levels MF
dobth
Date of birth
dodm
Date of inclusion in the register
dodth
Date of death
dooad
Date of 2nd prescription of OAD
doins
Date of 2nd insulin prescription
dox
Date of exit from follow-up.
Details
All dates are given in fractions of years, so 1997.00
corresponds to 1 January 1997 and 1997.997 to 31 December 1997.
Source
Danish National Board of Health.
References
B Carstensen, JK Kristensen, P Ottosen and K Borch-Johnsen:
The Danish National Diabetes Register: Trends in incidence, prevalence and
mortality, Diabetologia, 51, pp 2187–2196, 2008.
In partucular see the appendix at the end of the paper.
Examples
data(DMlate)
str(DMlate)
dml <- Lexis( entry=list(Per=dodm, Age=dodm-dobth, DMdur=0 ),
exit=list(Per=dox),
exit.status=factor(!is.na(dodth),labels=c("DM","Dead")),
data=DMlate )
# Cut the follow-up at insulin start, and introduce a new timescale,
# and split non-precursor states
system.time(
dmi <- cutLexis( dml, cut = dml$doins,
pre = "DM",
new.state = "Ins",
new.scale = "t.Ins",
split.states = TRUE ) )
summary( dmi )
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Epi)
Attaching package: 'Epi'
The following object is masked from 'package:base':
merge.data.frame
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Epi/DMlate.Rd_%03d_medium.png", width=480, height=480)
> ### Name: DMlate
> ### Title: The Danish National Diabetes Register.
> ### Aliases: DMlate DMrand
> ### Keywords: datasets
>
> ### ** Examples
>
> data(DMlate)
> str(DMlate)
'data.frame': 10000 obs. of 7 variables:
$ sex : Factor w/ 2 levels "M","F": 2 1 2 2 1 2 1 1 2 1 ...
$ dobth: num 1940 1939 1918 1965 1933 ...
$ dodm : num 1999 2003 2005 2009 2009 ...
$ dodth: num NA NA NA NA NA ...
$ dooad: num NA 2007 NA NA NA ...
$ doins: num NA NA NA NA NA NA NA NA NA NA ...
$ dox : num 2010 2010 2010 2010 2010 ...
> dml <- Lexis( entry=list(Per=dodm, Age=dodm-dobth, DMdur=0 ),
+ exit=list(Per=dox),
+ exit.status=factor(!is.na(dodth),labels=c("DM","Dead")),
+ data=DMlate )
NOTE: entry.status has been set to "DM" for all.
Warning message:
In Lexis(entry = list(Per = dodm, Age = dodm - dobth, DMdur = 0), :
Dropping 4 rows with duration of follow up < tol
>
> # Cut the follow-up at insulin start, and introduce a new timescale,
> # and split non-precursor states
> system.time(
+ dmi <- cutLexis( dml, cut = dml$doins,
+ pre = "DM",
+ new.state = "Ins",
+ new.scale = "t.Ins",
+ split.states = TRUE ) )
user system elapsed
1.112 0.008 1.120
> summary( dmi )
Transitions:
To
From DM Ins Dead Dead(Ins) Records: Events: Risk time: Persons:
DM 6157 1694 2048 0 9899 3742 45885.49 9899
Ins 0 1340 0 451 1791 451 8387.77 1791
Sum 6157 3034 2048 451 11690 4193 54273.27 9996
>
>
>
>
>
> dev.off()
null device
1
>