coxph.pool {NNMIS} | R Documentation |
Estimate Cox regression model pooling over the imputed datasets
Description
This function estimates Cox regression model, taking into account the additional uncertainty that arises due to a finite number of imputations of the missing data.
Usage
coxph.pool(obj, time, status, Z, forceNumeric = FALSE, setRef = NULL)
Arguments
obj |
A 'nnmi' object, that contains a finite number of imputations of the missing data. |
time |
A vector contains the observed time. |
status |
A vector contains the event indicator. |
Z |
A vector or matrix that contains other covariates. |
forceNumeric |
Logical, if it is True, the class of imputed variable will force to be numeric. The default is FALSE. |
setRef |
Optional, a reference group can be set for binary or categorical variable. |
Value
A data frame contains pooled estimation of Cox regression model.
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
imp.dat <- NNMIS(t5, xa=age, xb=age, time=time, event=status, Seed = 2016)
# this program can impute censoring time based on the imputed missing covariate
# imp.dat <- NNMIS(t5, xa=age, xb=age, time=time, event=status, imputeCT=T, Seed = 2016)
# check imputation results
# head(imp.dat$dat.NNMI) #> missing covariates
# head(imp.dat$dat.T.NNMI) #> censoring time
# head(imp.dat$dat.Id.NNMI) #> censoring indicator
# check imputation results
head(imp.dat$dat.NNMI)
# combine inference from imputed data sets by using Rubin's rules
# estimates in Cox regression
coxph.pool(imp.dat, time, status, age)
[Package NNMIS version 1.0.1 Index]