coxph.pool: Estimate Cox regression model pooling over the imputed...

Description Usage Arguments Value Examples

View source: R/pool.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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)

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

Related to coxph.pool in NNMIS...