kmweight: Compute Kaplan-Meier weights

Description Usage Arguments Details Value Author(s) References Examples

View source: R/kmweight.R

Description

Provide Kaplan-Meier weights for Stute's weighted least squares method.

Usage

1
kmweight(Y, delta)

Arguments

Y

survival time.

delta

status

Details

Kaplan-Meier weights are the mass attached to the uncensored observations. The weights are used to account for censoring into the calculation for many methods. For example, in the Stute's weighted least squares method (Stute and Wang, 1994)) that is applied for censored data.

Value

kmwts

Kaplan-Meier weights

Author(s)

Hasinur Rahaman Khan and Ewart Shaw

References

Stute, W. and Wang, J. (1994). The jackknife estimate of a Kaplan-Meier integral. Biometrika 81, 602-606.

Examples

1
2
3
4
#Using simdata function and considering censoring level at 50%.
data<-simdata(n = 100,lambda = 2.04) 
kmw<-kmweight(data$Y, data$delta)
kmw

Example output

Loading required package: imputeYn
Loading required package: quadprog
Loading required package: emplik
Loading required package: mvtnorm
Loading required package: survival
Loading required package: boot

Attaching package: 'boot'

The following object is masked from 'package:survival':

    aml


Attaching package: 'imputeYn'

The following object is masked from 'package:utils':

    data

  [1] 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000
  [7] 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000
 [13] 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000
 [19] 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000
 [25] 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000
 [31] 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000 0.01000000
 [37] 0.01000000 0.00000000 0.00000000 0.01032787 0.00000000 0.00000000
 [43] 0.01068400 0.01068400 0.00000000 0.01087826 0.00000000 0.00000000
 [49] 0.00000000 0.00000000 0.01174852 0.00000000 0.00000000 0.00000000
 [55] 0.00000000 0.01279283 0.00000000 0.01309034 0.01309034 0.00000000
 [61] 0.00000000 0.00000000 0.00000000 0.01450551 0.00000000 0.00000000
 [67] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
 [73] 0.01864994 0.00000000 0.00000000 0.00000000 0.00000000 0.02189341
 [79] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
 [85] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
 [91] 0.00000000 0.00000000 0.06020687 0.00000000 0.00000000 0.00000000
 [97] 0.00000000 0.00000000 0.00000000 0.42144811

jackknifeKME documentation built on May 2, 2019, 5:27 a.m.