km.pool: Perform Kaplan-Meier estmation over the multiply imputed...

Description Usage Arguments Value References Examples

View source: R/kmpool.R

Description

This function estimates Kaplan-Meier estimates based on Rubin's rules (multiple imputation algorithms) (Rubin, 2004).

Usage

1
km.pool(obj, time, status)

Arguments

obj

A 'nnmi' object, that contains imputed data for the missing covariate and the censored observations.

time

A vector contains the observed time.

status

A vector contains the event indicator.

Value

A data frame contains pooled Kaplan-Meier estimates.

References

Rubin DB. Multiple imputation for nonresponse in surveys. New York: John Wiley and Sons; 2004.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# load required packages
library(NNMIS)
library(survival)

# load data set - stanford2 in package 'survival'
data("stanford2")
head(stanford2)
attach(stanford2)

# performance multiple imputation on missing covariate t5 and
# censored observations based on the imputed missing covariates
imp.dat <- NNMIS(t5, xa=age, xb=age, time=time, event=status, imputeCT=TRUE, Seed = 2016)

# check imputation results
head(imp.dat$dat.T.NNMI)

# combine inference from imputed data sets using Rubin's rules
# Kaplan-Meier estimates
kmfit <- km.pool(imp.dat, time, status)
plotKM(kmfit)

NNMIS documentation built on May 1, 2019, 8:46 p.m.

Related to km.pool in NNMIS...