blk.countPastEvents | R Documentation |
Counts how many events occurred before the specified times in a
block-format
data set.
blk.countPastEvents(time, id, event.t = time, id2 = id)
time |
A vector of times at which to determine the number of past events, in |
id,id2 |
A valid |
event.t |
A vector of times at which events occur, in |
This function operates on data sets in block-format
.
The times at which “events” occur is specified. For a given
vecotr of times, this function counts how many events occurred
prior to each of those times.
For instance, one may wish to compute how many episodes of a given disease
occurred prior to baseline time (t=0
) for each individual.
An integer vector in block-format
with respect to
id
. The value indicates how events occurred prior to the
corresponding time
.
Benjamin Rich <mail@benjaminrich.net>
block-format
blk.concomitant
require(nlme)
data(Phenobarb)
dat <- Phenobarb[1:56,] # First 4 subjects
attach(dat)
cbind(dat, LAST.DOSE=blk.locf(dose, asID(Subject)))
detach(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.