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 )
# Split follow-up at Insulin
dmi <- cutLexis( dml, cut=dml$doins, new.state="Ins", pre="DM" )
summary( dmi )
# Introduce a new timescale
dmi <- cutLexis( dml, cut=dml$doins, new.state="Ins", pre="DM", new.scale=TRUE )
head( dmi )
# Split the states following insulin and explictily name the new timescale
dmi <- cutLexis( dml, cut=dml$doins, new.state="Ins",
pre="DM", new.scale="Instime", split.states=TRUE )
summary( dmi )
Run the code above in your browser using DataLab