km.pool {NNMIS} | R Documentation |
Perform Kaplan-Meier estmation over the multiply imputed survival data sets
Description
This function estimates Kaplan-Meier estimates based on Rubin's rules (multiple imputation algorithms) (Rubin, 2004).
Usage
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
# 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)
[Package NNMIS version 1.0.1 Index]