| hce | R Documentation |
hce objectsHelper function for hce objects
hce( GROUP = character(), TRTP = character(), AVAL0 = 0, ORD = sort(unique(GROUP)) )
GROUP |
a character vector of the same length as |
TRTP |
a character vector of the same length as |
AVAL0 |
a numeric vector of analysis values within each category. The default is 0. |
ORD |
a character vector containing ordered unique values of the |
an object of class hce. Its is a subject-level data frame (each row corresponds to one subject), containing the following columns:
SUBJID subject ID.
GROUP a character vector specifying the type of the outcome the patient experienced - either a TTE (time-to-event) or C (continuous).
GROUPN a numeric vector version of the GROUP column.
AVAL0 original analysis values - time of the time-to-event outcomes or the continuous outcome.
AVAL derived analysis value AVAL = AVAL0 + GROUPN.
TRTP assigned treatment groups.
as_hce() for coercing to hce objects.
# Example 1
set.seed(2022)
d <- hce(GROUP = sample(x = c("A", "B", "C"), size = 10, replace = TRUE),
TRTP = rep(c("Active", "Control"), each = 5),
AVAL0 = c(rnorm(5, mean = 1), rnorm(5)), ORD = c("A", "B", "C"))
calcWO(d, ref = "Control")