icut {Epi}R Documentation

Function to cut the follow-up of a person at a point in time.

Description

The follow up time from enter to exit is classified as to wheter it is before cut (Time=0) or after Time=1). If cut is between enter and exit, the follow-up is split in two intervals, the first gets the value cens for the status.

Usage

icut( enter, exit, cut, fail = 0, cens.value = 0,
      data = data.frame(enter, exit, fail, cut),
      Expand = 1:nrow( data ) )

Arguments

enter Date of entry. Numerical vector.
exit Date of exit. Numerical vector.
fail Indicator if exit status.
cens.value Value to use for censoring status.
cut Date where to cut follow-up. Numerical vector.
data Dataframe of variables to carry over to the output dataframe.
Expand Variable identifying original records.

Value

A data frame with one row per interval of follow up and columns given in the data argument, preceded by the columns:

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 the interval.
Time Indicator variable for intervals after cut.

Author(s)

Bendix Carstensen, Steno Diabetes Center, bxc@steno.dk, www.biostat.ku.dk/~bxc

See Also

Lexis, isec, fcut1, fcut, ex1

Examples

one <- round( runif( 15, 0, 15 ), 1 )
two <- round( runif( 15, 0, 15 ), 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) )
# So what have we got
data.frame( doe, dox, fail )
# Cut follow-up at 5
icut( doe, dox, fail, cut=5 )

[Package Epi version 0.5.4 Index]