hce: Helper function for 'hce' objects

View source: R/hce.R

hceR Documentation

Helper function for hce objects

Description

Helper function for hce objects

Usage

hce(
  GROUP = character(),
  TRTP = character(),
  AVAL0 = 0,
  ORD = sort(unique(GROUP))
)

Arguments

GROUP

a character vector of the same length as AVAL containing events.

TRTP

a character vector of the same length as AVAL containing assigned treatment groups.

AVAL0

a numeric vector of analysis values within each category. The default is 0.

ORD

a character vector containing ordered unique values of the GROUP variable for determining the hierarchy of events.

Value

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.

See Also

as_hce() for coercing to hce objects.

Examples

# 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")

hce documentation built on Oct. 16, 2024, 9:06 a.m.