coxphlb.phtest {CoxPhLb}R Documentation

Test the Proportional Hazards Assumption of Cox Model with Right-Censored Length-Biased Data

Description

Tests the proportional hazards assumption for a Cox model fit (coxphlb).

Usage

coxphlb.phtest(fit, data, spec.p = NULL, n.sim = 1000,
seed.n = round(runif(1,1,1e09)), digits = 3L)

Arguments

fit

The result of fitting a Cox model, using the coxphlb function.

data

A data frame containing the variables in the model.

spec.p

An integer specifying which covariate to be tested. Default is NULL. If NULL, global test is conducted. If specified, the per-variable test is conducted.

n.sim

The number of resampling. Default is 1000.

seed.n

An integer specifying seed number.

digits

An integer controlling the number of digits to print.

Details

The proportional hazards assumption is checked by constructing test statistics based on asymptotically mean-zero processes. The asymptotic distribution of the test statistics is approximated via resampling. This function computes the p-value by comparing the test statistics with n.sim number of resamples. If the p-value is small (e.g., <0.05), it is likely that the assumption is violated. The test can be done either per variable or globally. The global test checks if the proportional hazards assumption is valid for the overall covariates.

Value

A list containing the following components:

p.value

A p-value.

The list is returned as an object of the coxphlb.phtest class. Objects of this class have methods for the function print. The object also contains the following: spec.p; n.sim; stat.mat.t, the test statistic; sim.mat.t, samples from the null distribution; yy, the observed ordered failure times; varnames, the variable that is tested; result, the table output.

References

Lee, C.H., Ning, J., and Shen, Y. Model diagnostics for proportional hazards model with length-biased data. Lifetime Data Analysis 25(1), 79-96.

See Also

coxphlb, coxphlb.ftest, coxphlb.phtest.plot

Examples

## Not run: 
# Fit a Cox model
fit.ee <- coxphlb(Surv(a, y, delta) ~ x1 + x2, data = ExampleData1,
                 method = "EE")

# Check the Proportional Hazards Assumption
ptest1 <- coxphlb.phtest(fit.ee, data = ExampleData1, spec.p = 2,
                        seed.n = 1234)
print(ptest1)			# display the results

# Run a Global Test
ptest2 <- coxphlb.phtest(fit.ee, data = ExampleData1, spec.p = NULL,
                        seed.n=1234)
print(ptest2)			# display the results

## End(Not run)

[Package CoxPhLb version 1.2.0 Index]