Learn R Programming

idem (version 5.2)

imData: Create data for IDEM analysis

Description

Create a class IDEMDATA object for IDEM analysis

Usage

imData(
  data,
  trt = NULL,
  surv = NULL,
  outcome = NULL,
  endfml = NULL,
  y0 = NULL,
  cov = NULL,
  duration = 9999,
  bounds = NULL,
  trt.label = NULL,
  unitTime = "days",
  err.terminate = TRUE,
  ...
)

Value

When the specifications are correct, a class IDEMDATA list will be returned. The list contains

data

Original dataset

lst.var

List of the specifications

Arguments

data

Original dataset

trt

Variable name for the Control (0) and Intervention (1) treatment assignments in the dataset

surv

Variable name for the survival (time to event) variable in the dataset

outcome

Chronologically ordered vector of variable names for clinical outcomes in the dataset excluding baseline

endfml

R expression indicating the user-specified final outcome of interest. This is the function for \(Z\) of one or more of \(Y_k\)'s

y0

Variable name of the baseline clinical outcome

cov

Vector of variable names for the covariates used in the imputation procedure for missing clinical outcomes

duration

Length of the study. This is the time at which subjects' are assumed to be censored

bounds

Numeric vector of lower and upper bounds for subjects' imputed clinical outcomes

trt.label

label of the treatment arms

unitTime

Unit of time measurement for survival and function outcome time points

err.terminate

When there is error in the specification, the program should be stopped with an error message if err.terminate is true. Otherwise, the error message will be returned and the program will continue.

...

Additional specifications

Details

When there are errors in the specification, i.e. trt is not a column of data, a class IDEMERROR object will be returned. The detailed errors can be checked by calling print of the IDEMERROR object.

Examples

Run this code
rst.data <- imData(abc, trt="TRT", surv="SURV", outcome=c("Y1","Y2"),
                   y0=NULL, endfml="Y2",
                   trt.label = c("UC+SBT", "SAT+SBT"),
                   cov=c("AGE"), duration=365, bounds=c(0,100));

Run the code above in your browser using DataLab