prepareData: Preparation of a Data Set to Compute Log-likelihood

View source: R/estimateParams.R

prepareDataR Documentation

Preparation of a Data Set to Compute Log-likelihood

Description

Preparation of a Data Set to Compute Log-likelihood

Usage

prepareData(data)

Arguments

data

(data.frame)
containing entry and exit times of an illness-death model. See getOneClinicalTrial() for details.

Details

The output data set contains the following columns:

  • id (integer): patient id.

  • from (integer): start event state.

  • to (integer): end event state.

  • trans (integer): transition (1, 2 or 3) identifier

    • 1: Transition from state 0 (stable) to 1 (progression).

    • 2: Transition from state 0 (stable) to 2 (death).

    • 3: Transition from state 1 (progression) to 2 (death).

  • entry (numeric): time at which the patient begins to be at risk for the transition.

  • exit (numeric): time at which the patient ends to be at risk for the transition.

  • status (logical): event indicator for the transition.

Value

This function returns a data set with one row per patient and transition, when the patient is at risk.

Examples

transition <- exponential_transition(h01 = 1.2, h02 = 1.5, h12 = 1.6)
simData <- getOneClinicalTrial(
  nPat = c(30), transitionByArm = list(transition),
  dropout = list(rate = 0.8, time = 12),
  accrual = list(param = "time", value = 1)
)
prepareData(simData)

simIDM documentation built on May 29, 2024, 6:38 a.m.