Description Usage Arguments Details Value References See Also Examples
Tests the proportional hazards assumption for a Cox model fit (coxphlb).
1 2 | coxphlb.phtest(fit, data, spec.p = NULL, n.sim = 1000,
seed.n = round(runif(1,1,1e09)), digits = 3L)
|
fit |
The result of fitting a Cox model, using the |
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. |
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.
A list containing the following components:
p.value |
A p-value. |
|
The list is returned as an object of the |
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.
coxphlb
, coxphlb.ftest
, coxphlb.phtest.plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.