blk.countPastEvents: Count Past Events

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Counts how many events occurred before the specified times in a block-format data set.

Usage

1
blk.countPastEvents(time, id, event.t = time, id2 = id)

Arguments

time

A vector of times at which to determine the number of past events, in block-format with respect to id.

id,id2

A valid block-format ID.

event.t

A vector of times at which events occur, in block-format with respect to id2.

Details

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.

Value

An integer vector in block-format with respect to id. The value indicates how events occurred prior to the corresponding time.

Author(s)

Ben Rich <benjamin.rich@certara.com>

See Also

Examples

1
2
3
4
5
6
7
8
require(nlme)
data(Phenobarb)
dat <- Phenobarb[1:56,]  # First 4 subjects
attach(dat)

cbind(dat, LAST.DOSE=blk.locf(dose, asID(Subject)))

detach(dat)

benjaminrich/PCSmisc documentation built on May 24, 2019, 5:02 a.m.