FormatData: Format Data

View source: R/Format.R

FormatDataR Documentation

Format Data

Description

Format Data

Usage

FormatData(
  data,
  arm_name = "arm",
  cens_after_last = TRUE,
  covars = NULL,
  idx_name = "idx",
  status_name = "status",
  strata = NULL,
  time_name = "time",
  weights = NULL
)

Arguments

data

Data.frame.

arm_name

Name of column containing treatment arm. Must be coded as 1 for treatment, 0 for reference.

cens_after_last

Should subjects who lack an explicit censoring time be censored after their last observed event?

covars

Optional covariate matrix. Rows should correspond with the subject index 'idx'. Factor and interaction terms should be expanded.

idx_name

Name of column containing a unique subject index.

status_name

Name of column containing the status. Must be coded as 0 for censoring, 1 for event, 2 for death. Each subject should have an observation-terminating event, either censoring or death.

strata

Optional stratification factor. Should not be provided if a covariate matrix is provided.

time_name

Name of column containing the observation time.

weights

Optional column of weights.

Value

Formatted data.frame.


zrmacc/MCC documentation built on July 16, 2025, 4:04 p.m.