pgx.trtreat: Derive time in relation to treatment.

Description Usage Arguments Details Value Author(s) Examples

View source: R/pgx.R

Description

Function to derive a variable that classifies time points in relation to treatment, as pre-, on-, or post-therapy.

Usage

1
2
3
4
pgx.trtreat(measure, exposure,
            mtime, winlen, 
            estart = "exstdtR", eend = "exendtR",
            subjid = "USUBJID")

Arguments

measure

A data frame containing a time series

exposure

A data frame containing therapy exposure records

mtime

Name of the variable in measure that describes time of measurement

winlen

Length of time beyond last exposure that is in on-therapy window

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, measure, and exposure, that identifies individual subjects

Details

This function derives the time in relation to treatment, from clinical trial data consisting of: (i) time series; and (ii) therapy exposure records.

HOW SHOULD WE HANDLE SUBJECTS WITH NO EXPOSURE RECORDS

Value

A data frame of derived values for time in relation to treatment, which can be NA, “Pre-therapy”, “On-therapy”, or “Post-therapy”.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(clinex) # like plain text export of SAS files from CDER/CDISC
             # compliant data
## format dates for R
clinex$LAB <- within(clinex$LAB, {
  lbdtR <- as.Date(LBDT, "%d%b%Y")                
})
clinex$EXPOSURE <- within(clinex$EXPOSURE, {
  exstdtR <- as.Date(EXSTDT, "%d%b%Y")                
  exendtR <- as.Date(EXENDT, "%d%b%Y")                
})

table(pgx.trtreat(clinex$LAB, clinex$EXPOSURE,
            mtime = "lbdtR", winlen = 0), useNA="always")

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