Description Usage Arguments Value References Examples
This function estimates Kaplan-Meier estimates based on Rubin's rules (multiple imputation algorithms) (Rubin, 2004).
1 |
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. |
A data frame contains pooled Kaplan-Meier estimates.
Rubin DB. Multiple imputation for nonresponse in surveys. New York: John Wiley and Sons; 2004.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.