hce {hce}R 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:

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

[Package hce version 0.6.0 Index]