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
dmi <- cutLexis(dml,
cut = dml$doins,
new.state = "Ins",
split.state = TRUE)
summary( dmi )
ms <- AaJ.Lexis(dmi, timeScale = "DMdur")
class(ms)
ms$states
head(ms$pstate)
Run the code above in your browser using DataLab