ex1                   package:Epi                   R Documentation

_S_p_l_i_t _f_o_l_l_o_w-_u_p _t_i_m_e _a_l_o_n_g _a _t_i_m_e_s_c_a_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     Splits follow-up time at prespecified points of follow-up.

_U_s_a_g_e:

     ex1( enter, exit, fail, origin = 0, scale = 1, breaks,
          data = data.frame(enter, exit, fail),
          Expand = 1:nrow(data) )

_A_r_g_u_m_e_n_t_s:

   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.

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     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.

_A_u_t_h_o_r(_s):

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

_S_e_e _A_l_s_o:

     'Lexis', 'isec', 'icut', 'fcut1', 'ex1'

_E_x_a_m_p_l_e_s:

     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 )

