| cutLexis {Epi} | R Documentation |
The follow-up of a person is divided into the period before and after an intermediate event, typically disease recurrenece or something like that. This event is assigned a new state.
cutLexis( data,
cut,
timescale = timeScales(data)[1],
new.state = max( as.integer( c(data$lex.Cst,data$lex.Xst) )+1 ),
na.cut = Inf,
cens = ifelse( is.character(new.state), "0", 0 ) )
data |
A Lexis object. |
cut |
Numerical vector with the times of intermediate event. NAs are allowed, in which cases the original record is retained. |
timescale |
The timescale that cut refers to. |
new.state |
What value should the new state have? |
na.cut |
What value should be substituted for the NAs in
cut. The default is Inf which results in the orginal
records being kept. |
cens |
Censoring values for the states. Persons in any of these states
will have their entry and exit status (lex.Cst,
lex.Xst, updated if the follow up is after cut. |
The cens parameter is used to decide wheter an exitsing status
(lex.Cst or lex.Xst) should be updated to
new.state or not, if the corresponding entry or exit time is after
cut.
A Lexis object, where the follow-up of each person is cut in
two at the time as given in cut.
Bendix Carstensen, Steno Diabetes Center, bxc@steno.dk
data( nickel )
nic <- Lexis( data=nickel,
entry=list(age=agein),
exit=list(age=ageout,cal=ageout+dob,tfh=ageout-age1st),
# Lung cancer deaths and other deaths are coded 1 and 2
exit.status=( (icd > 0) + (icd %in% c(162,163)) ) )
str( nic )
tab.Lexis( nic )
nicc <- cutLexis( nic, 50, "age" )
tab.Lexis( nicc )