Create censoring variables [ssa6: STB-22] -------------------------- ^censor^ ident_var time_var [ order_var ] ^=^ exp [ ^if^ exp ] [ ^in^ range ] ^,^ ^gen^erate^(^new_var^)^ [ ^bef^ore^(^exp^)^ ] creates two new variables useful in survival analysis with time-varying regressors. The first new variable, ^new_var^, is a zero/one variable that is set to one in the period at the end of which the individual changes state (as defined by the ^= exp^, which is interpreted as a logical expression). The second new variable, ^Tnew_var^, is the time at censoring. Both variables are set to missing in periods after the individual changes states. The data are assumed to consist of multiple observations on several individuals. Within each individual, observations are assumed to be sorted by ^time_var^ and (optionally) ^order_var^. Options ------- ^gen^erate^(^new_var^)^ is not optional. It specifies the names of the censoring variable (^new_var^) and the time-to-censoring variable (^Tnew_var^). ^bef^ore^(^exp^)^ defines an additional condition that may censor the observations on an individual prior to the last observation on that individual. Examples -------- . censor id time = married==1, gen(firstmar) before(out_migr==1) . censor id t_diagn = illness==1, gen(cancer) before(illness==2 | illness==3) Author ------ Dr. Philippe Bocquier, CERPOD bocquier@@orstom.orstom.fr Also see -------- Manual: [5d] survival STB: ssa6 (STB-22) On-line: ^help^ for ^firstocc^, ^slice^, and ^tmerge^