Lexis2msm | R Documentation |
msm:msm
function.The number of records in the resulting dataset will have a
number of records that is normally nrec(Lx) + nid(Lx)
, that is
one extra record for each person. If there are 'holes' in persons'
follow-up, each hole will also generate an extra record in the result.
Lexis2msm(Lx,
state = "state",
verbose = FALSE)
Lx |
A |
state |
Character; the name of the state variable in the result. |
verbose |
If true, you will be reminded what the function did. |
A data frame of class msmLexis
with the timescales preserved and lex.id
preserved but with other lex.
variables removed.
Has more records than the original Lexis
object
Bendix Carstensen, http://bendixcarstensen.com
Lexis
example(mcutLexis)
# we now have the Lexis object L3:
summary(L3)
# data frame for use with msm
msm3 <- Lexis2msm(L3)
# see the difference
subset( L3, lex.id %in% 1:3)
subset(msm3, lex.id %in% 1:3)
timeScales(msm3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.