getFineGrayWeights: Creates a 'Surv' object that forces in competing risks and...

View source: R/GetFrineGrayWeights.R

getFineGrayWeightsR Documentation

Creates a Surv object that forces in competing risks and the IPCW needed for Fine-Gray estimation.

Description

getFineGrayWeights creates a list Surv object and vector of weights required for estimation.

Usage

getFineGrayWeights(ftime, fstatus, cvweights = NULL, cencode = 0, failcode = 1)

Arguments

ftime

Numeric: Observed event (failure) times

fstatus

Numeric: Observed event (failure) types

cvweights

Numeric: Vector of 0/1 (cross-validation) weights for each data row

cencode

Numeric: Code to denote censored observations (Default is 0)

failcode

Numeric: Code to denote event of interest (Default is 1)

Value

A list that returns both an object of class Surv that forces in the competing risks indicators and a vector of weights needed for parameter estimation.

Examples

ftime <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
fstatus <- c(1, 2, 0, 1, 2, 0, 1, 2, 0, 1)
getFineGrayWeights(ftime, fstatus, cencode = 0, failcode = 1)

Cyclops documentation built on June 22, 2024, 10:24 a.m.