Description Usage Arguments Details Value Author(s) Examples
Function to derive safety endpoints for continuous, ordinal, binary, and time-to-event analyses, from longitudinal data typical of a clinical trial.
1 2 3 4 5 |
d |
A data frame containing subject identifiers, and an optional stratifying variable |
measure |
A data frame containing time series trait measurements |
exposure |
A data frame containing therapy exposure records |
mtime |
Name of the variable in |
mvalue |
Name of the variable in |
threshval |
Critical value, for defining events for “sufficient exposure” to treatment and for survival analysis |
msign |
Indicator how |
mstrict |
Indicator how |
estart |
Name of the variable in |
eend |
Name of the variable in |
dby |
Name of the variable in |
subjid |
Name of the variable in |
This function derives safety endpoint variables that can be used for continuous, ordinal, binary, and time-to-event analyses, from clinical trial data consisting of: (i) time series trait measurements, typically indicating the presence or severity of symptoms for the safety event; and (ii) therapy exposure records.
TO DO: Allow elapsed time, cumulative dose
A data frame of derived variables.
Toby Johnson Toby.x.Johnson@gsk.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | library(survival)
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")
grade <- grade(LBSTRESN, c(1, 5, 10), strict = TRUE)
})
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.endpoints(clinex$DEMO, clinex$LAB, clinex$EXPOSURE,
mtime = "lbdtR", mvalue = "LBSTRESN", threshval = 5,
msign = "greater", mstrict = TRUE))
pgx <- merge(pgx,
pgx.endpoints(clinex$DEMO, clinex$LAB, clinex$EXPOSURE,
mtime = "lbdtR", mvalue = "grade", threshval = 2,
msign = "greater", mstrict = FALSE))
pgx <- within(pgx, {
LBSTRESN.binary <- ifelse(!LBSTRESN.exposed, NA,
ifelse(LBSTRESN.event == 1, 1,
ifelse(LBSTRESN.max <= 1, 0, NA)))
ATRTGRP <- as.factor(ATRTGRP)
})
summary(lm(LBSTRESN.max ~ ATRTGRP, data = pgx, subset = LBSTRESN.exposed))
summary(glm(LBSTRESN.binary ~ ATRTGRP, family = binomial, data = pgx))
summary(coxph(Surv(LBSTRESN.time, LBSTRESN.event) ~ ATRTGRP, data = pgx))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.