Type: | Package |
Title: | Fit Robustly Proportional Hazards Regression Model |
Version: | 1.0.1 |
Date: | 2022-04-02 |
Description: | An implementation of robust estimation in Cox model. Functionality includes fitting efficiently and robustly Cox proportional hazards regression model in its basic form, where explanatory variables are time independent with one event per subject. Method is based on a smooth modification of the partial likelihood. |
URL: | https://github.com/ShanaScogin/coxrobust |
BugReports: | https://github.com/ShanaScogin/coxrobust/issues |
License: | GPL-3 |
NeedsCompilation: | yes |
Imports: | survival |
Depends: | R (≥ 2.0.0) |
Suggests: | testthat (≥ 3.0.0), knitr |
Encoding: | UTF-8 |
LazyLoad: | TRUE |
RoxygenNote: | 7.1.2 |
LinkingTo: | Rcpp, RcppArmadillo |
Config/testthat/edition: | 3 |
Packaged: | 2022-04-06 12:47:32 UTC; shanascogin |
Author: | Tadeusz Bednarski [aut],
Filip Borowicz [aut],
Shana Scogin |
Maintainer: | Shana Scogin <shanarscogin@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2022-04-06 14:02:33 UTC |
Fit Robustly Proportional Hazards Regression Model
Description
Fits efficiently and robustly Cox proportional hazards regression model in its basic form, where explanatory variables are time independent with one event per subject. Method is based on a smooth modification of the partial likelihood.
Usage
coxr(
formula,
data,
subset,
na.action,
trunc = 0.95,
f.weight = c("linear", "quadratic", "exponential"),
singular.ok = TRUE,
model = FALSE
)
Arguments
formula |
a formula object, with the response on the left of a |
data |
a data frame in which to interpret the variables
named in the |
subset |
expression saying that only a subset of the rows of the data should be used in the fit. |
na.action |
a missing-data filter function, applied to the model.frame, after any subset argument has been used. |
trunc |
roughly, quantile of the sample |
f.weight |
type of weighting function, default is |
singular.ok |
logical value indicating how to handle collinearity in the
model matrix. If |
model |
a logical value indicating whether model frame should be included as a component of the returned value. |
Value
a data frame containing MCMC summary statistics.An object of class
coxr
. See coxr.object
for details.
References
Bednarski, T. (1993). Robust estimation in Cox's regression model. Scandinavian Journal of Statistics. Vol. 20, 213–225.
Bednarski, T. (1989). On sensitivity of Cox's estimator. Statistics and Decisions. 7, 215–228.
Grzegorek, K.(1993). On robust estimation of baseline hazard under the Cox model and via Frechet differentiability. Preprint of the Institute of Mathematics of the Polish Academy of Sciences.518.
Minder, C.E. & Bednarski, T. (1996). A robust method for proportional hazards regression. Statistics in Medicine Vol. 15, 1033–1047.
Examples
if (interactive()) {
# Create a simple test data set using the attached function gen_data
a <- gen_data(200, c(1, 0.1, 2), cont = 0.05, p.censor = 0.30)
result <- coxr(Surv(time, status) ~ X1 + X2 + X3, data = a , trunc = 0.9)
result
plot(result)
}
Fit Robustly Proportional Hazards Regression Object
Description
This class of objects is returned by coxr
function to represent
efficiently and robustly fitted proportional hazards regression model.
Objects of this class have methods for the functions print
,
plot
and predict
.
Value
The following components must be included in a legitimate coxr
object.
coefficients |
robust estimate of the regression parameter. |
ple.coefficients |
non-robust (efficient) estimate of the regression parameter. |
var |
an approximate variance matrix of the coefficients (estimated robustly). Rows and columns corresponding to any missing coefficients are set to zero. |
ple.var |
an approximate variance matrix of the coefficients (estimated non-robustly). Rows and columns corresponding to any missing coefficients are set to zero. |
lambda |
cumulated hazard (estimated robustly). |
lambda.ple |
cumulated hazard (estimated non-robustly). |
wald.test |
the value of Wald test. |
ewald.test |
the value of extended Wald test. |
skip |
skipped columns. |
na.action |
the |
The object also contain the following, for documentation see the
lm
object: terms
, call
, x
, y
and optionally model
.
See Also
coxrobust Overview
Description
This package currently has one main function that fits a robustly proportional hazards regression model
Main Functions
-
coxr()
-
gen_data()
-
plot.coxr()
-
predict.coxr()
Generate Data from the Proportional Hazards Regression Model
Description
Generates data set from the proportional hazards regression model without or with contamination.
Usage
gen_data(n, beta, cont = 0, p.censor = 0)
Arguments
n |
number of observations. |
beta |
vector of regression coefficients. |
cont |
fraction of contaminated observations. |
p.censor |
probability of censoring. |
Value
Data frame containing the following variables:
timevector of survival times.
statusvector of censoring status.
X1, X2, ...explanatory variables (their number is determined by the dimension of vector of regression coefficients).
Examples
if (interactive()) {
gen_data(50, c(2,-2), cont = 0.05)
}
Plot Diagnostics for a coxr Object
Description
Graphical tool which in a series of 5 graphs let us compare how well data are explained by the estimated proportional hazards model with non-robust (black color) and robust method (green color). The first graph gives standardized difference of two estimated survival functions; one via the Cox model and the other via Kaplan Meier estimator. The following four graphs show the same differences for four strata, defined by the quartiles of the estimated linear predictor. Comparison of estimation results along with analysis of the graphs leads frequently to a very detailed information about the model fit (see examples).
Usage
## S3 method for class 'coxr'
plot(
x,
caption = c("Full data set", "First quartile", "Second quartile", "Third quartile",
"Fourth quartile"),
main = NULL,
xlab = "log time",
ylab = "standardized survival differences",
...,
color = TRUE
)
Arguments
x |
|
caption |
captions to appear above the plots. |
main |
overall title for the plot. |
xlab |
title for the x axis. |
ylab |
title for the y axis. |
... |
other parameters to be passed through to plotting functions. |
color |
if |
Value
Data frame containing the following variables:
timevector of survival times.
statusvector of censoring status.
X1, X2, ...explanatory variables (their number is determined by the dimension of vector of regression coefficients).