| ex1 {Epi} | R Documentation |
Splits follow-up time at prespecified points of follow-up.
ex1( enter, exit, fail, origin = 0, scale = 1, breaks,
data = data.frame(enter, exit, fail),
Expand = 1:nrow(data) )
enter |
Date of entry einto the study (start of follow-up). Numeric. |
exit |
Date of termination of follow-up. Numeric. |
fail |
Status at exit from the study. |
origin |
Origin of the timescale to split on. Specified on the
input timescale, i.e. that of enter and exit. |
scale |
Scaling between input and analysis timescale. |
breaks |
Breakpoints on the analysis timescale. Follow-up before
min(breaks) and and ater max(breks) is discarded. |
data |
Dataframe of variables to carry over to the output. |
Expand |
Variable identifying original records. |
If entry and exit are given in days (for example as
Date variables, and we want follow-up cut at 5-year age
intervals, the we should choose origin equal to bithdate, scale
equal to 365.25 and breaks as seq(0,100,5). Thus the input
timescale is calendar tiem measured in days, and output timescale is
age measured in years.
A dataframe with one row per follow-up interval, and variables as in
data, preceded by the variables:
Expand |
Identification of the rows from the input dataframe. |
Enter |
Entry date for the interval. |
Exit |
Exit date for the interval. |
Fail |
Failure indicator for end of the current interval. |
Bendix Carstensen, Steno Diabetes Center, bxc@steno.dk, www.biostat.ku.dk/~bxc
one <- round( runif( 15, 0, 10 ), 1 ) two <- round( runif( 15, 0, 10 ), 1 ) doe <- pmin( one, two ) dox <- pmax( one, two ) # Goofy data rows to test possibly odd behaviour doe[1:3] <- dox[1:3] <- 8 dox[2] <- 6 dox[3] <- 7.5 # Some failure indicators fail <- sample( 0:1, 15, replace=TRUE, prob=c(0.7,0.3) ) # Split follow-up: ex1( doe, dox, fail, breaks=0:10 )