Learn R Programming

NPCox (version 1.3)

npcox: Nonparametric and semiparametric Cox regression model.

Description

Estimation of proportional hazards (PH) model with time-varying coefficients. Users should anticipate a significant increase in estimation time when using the `SE = TRUE` option. Both the number of covariates and the sample size can lead to estimation time increasing quadratically.

Usage

npcox(cva, delta, obstime, SE = FALSE, bandwidth = FALSE, resamp = 100)

Value

a list that contain the estimation result of temporal coefficients, standard error estimation, selected or predesigned bandwidth, dataset, unconverged time points.

Arguments

cva

Covariate Z in h(t) = h0(t)exp(b(t)'Z)

delta

Right censoring indicator for the model

obstime

The observed time = min(censoring time, observed failure time)

SE

Whether or not the estimation of standard error through resampling method will be done. The default value is FALSE.

bandwidth

Bandwidth for kernel function, which can be specified. The default value is FALSE and can be selected through least prediction error over all subjects.

resamp

Number of resampling for estimation of pointwise standard error. The default value is 100.

Details

This is some description of this function.

'npcox' function is designed for PH model with time-varying coefficients, h(t) = h0(t)exp(b(t)'Z), providing estimation of b(t) and its pointwise standard errors on [bandwidth, max(obstime)-badwidth].

Examples

Run this code
data(pbc)
pbc = pbc[(pbc$time < 3000) & (pbc$time > 800), ]
Z   = pbc[,c("age","edema")]
colnames(Z) = c("age","edema")
del = sign(pbc$status)
tim = pbc$time
res = npcox(cva = Z,delta = del, obstime = tim, bandwidth = 500)

Run the code above in your browser using DataLab