pgx.exposure: Derive variables about treatment exposure from longitudinal...

Description Usage Arguments Details Value Author(s) Examples

View source: R/pgx.R

Description

Function to derive varianles about treatment exposure, from longitudinal data typical of a clinical trial.

Usage

1
2
3
pgx.exposure(d, exposure,
             estart = "exstdtR", eend = "exendtR",
             subjid = "USUBJID")

Arguments

d

A data frame containing subject identifiers

exposure

A data frame containing therapy exposure records

estart

Name of the variable in exposure that describes exposure start time

eend

Name of the variable in exposure that describes exposure end time

subjid

Name of the variable in d and exposure, that identifies individual subjects

Details

This function derives total time on treatment, using mincover.

TO DO: Calculate first and last days, elapsed time, cumulative dose

Value

A data frame of derived variables.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(clinex) # like plain text export of SAS files
clinex$EXPOSURE <- within(clinex$EXPOSURE, {
  exstdtR <- as.Date(EXSTDT, "%d%b%Y")                
  exendtR <- as.Date(EXENDT, "%d%b%Y")                
})

pgx <- clinex$DEMO
pgx <- merge(pgx,
             pgx.exposure(clinex$DEMO,
                          subset(clinex$EXPOSURE, ACTTRT == "Active")))
head(pgx)

tobyjohnson/gtx documentation built on Aug. 30, 2019, 8:07 p.m.