Description Usage Arguments Details Value References See Also Examples
Tests the functional form of covariates assumed for a Cox model fit (coxphlb).
1 2 | coxphlb.ftest(fit, data, spec.p = 1, n.sim = 1000, z0 = NULL,
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 1. If set to 1, the first column of the covariate matrix is tested. |
n.sim |
The number of resampling. Default is 1000. |
z0 |
A vector of grid points to use for the specified covariate. The default is a vector of 100 equally distributed numeric values within the range of the specified covariate. |
seed.n |
An integer specifying seed number. |
digits |
An integer controlling the number of digits to print. |
The functional form of a continuous covariate 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 should be done per variable for continuous 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.phtest
, coxphlb.ftest.plot
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# Fit a Cox model
fit.ee <- coxphlb(Surv(a, y, delta) ~ x1 + x2, data = ExampleData1,
method = "EE")
# Check the Functional Form of the Cox Model
ftest <- coxphlb.ftest(fit.ee, data = ExampleData1, spec.p = 2,
seed.n = 1234)
print(ftest) # display the results
## End(Not run)
|
sh: 1: cannot create /dev/null: Permission denied
Loading required package: survival
Call:
coxphlb(formula = Surv(a, y, delta) ~ x1 + x2, method = EE)
coef variance std.err z.score p.value lower.95 upper.95
x1 1.029 0.031 0.177 5.83 <0.001 0.683 1.375
x2 0.45 0.132 0.364 1.24 0.216 -0.263 1.163
p.value
x2 0.433
p.value
x2 0.433
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.