The break points of a
Lexis object (created by a call to
splitLexis) divide the follow-up intervals into time bands
along a given time scale. The
breaks function returns
the break points, for a given time scale, and the
classifies each row (=follow-up interval) into one of the time bands.
an object of class
a character or integer vector of length 1 identifying the time scale of interest
a string that determines how the time bands are labelled. See Details below
Time bands may be labelled in various ways according to the
type argument. The permitted values of the
argument, and the corresponding return values are:
a numeric vector with integer codes starting from 0.
a factor (unordered) with labels "(left,right]"
the left-hand limit of the time band
the midpoint of the time band
the right-hand limit of the time band
breaks function returns a vector of break points
Lexis object, or NULL if no break points have been
defined by a call to
function returns a numeric vector or factor, depending on the value
A newly created
Lexis object has no break points defined.
In this case,
breaks will return NULL, and
timeBand will a vector of zeros.
1 2 3 4 5 6 7 8 9 10 11 12 13
data(diet) diet <- cal.yr(diet) diet.lex <- Lexis(entry=list(period=doe), exit=list(period=dox, age=dox-dob), exit.status=chd, data=diet) diet.split <- splitLexis(diet.lex, breaks=seq(40,70,5), "age" ) age.left <- timeBand(diet.split, "age", "left") table(age.left) age.fact <- timeBand(diet.split, "age", "factor") table(age.fact) age.mid <- timeBand(diet.split, "age", "mid") table(age.mid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.