cvmf | R Documentation |
Applies cross-validated log-likelihood to test between partial likelihood maximization (PLM) and the iteratively reweighted robust (IRR) method of estimation for a given application of the Cox model. For more, see: Desmarais, B. A., & Harden, J. J. (2012). Comparing partial likelihood and robust estimation methods for the Cox regression model. Political Analysis, 20(1), 113-135. doi: 10.1093/pan/mpr042
cvmf( formula, data, method = c("exact", "approximate", "efron", "breslow"), trunc = 0.95, subset, na.action, f.weight = c("linear", "quadratic", "exponential"), weights, singular.ok = TRUE )
formula |
A formula object, with the response on the left of a ~
operator, and the terms on the right. The response must be a survival
object as returned by the |
data |
A data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model or in the subset and the weights argument. |
method |
A character string specifying the method for tie handling in coxph().
If there are no tied death times all the methods are equivalent.
Following the |
trunc |
A value that determines the trimming level for the robust
estimator. The default is 0.95. Roughly, quantile of the sample
T_i exp(β'Z_i). It is an argument in the |
subset |
Expression indicating which subset of the rows of data should be used in the fit. All observations are included by default. |
na.action |
A missing-data filter function, applied to the model.frame, after any subset argument has been used. |
f.weight |
A type of weighting function for |
weights |
A vector of case weights for |
singular.ok |
Logical value indicating how to handle collinearity in the
model matrix. If |
This function implements the cross-validated median fit (CVMF) test. The function cvmf() tests between the partial likelihood maximization (PLM) and the iteratively reweighted robust (IRR) method of estimation for a given application of the Cox model. The Cox model is a partial parametric model that does not make assumptions about the baseline hazard. It can be estimated via PLM, the standard estimator, or IRR, a robust estimator that identifies and downweights outliers. The choice between the two methods involves a trade-off between bias and efficiency. PLM is more efficient, but biased under specification problems. IRR reduces bias, but results in high variance due to the loss of efficiency. The cvmf() function returns an object to identify the prefered estimation method.
See also coxph
, coxr
,
Surv
An object of class cvmf
computed by the cross-validated median fit test
(CVMF) to test between the PLM and IRR methods of estimating the Cox model.
See cvmf_object
for more details.
Desmarais, B. A., & Harden, J. J. (2012). Comparing partial likelihood and robust estimation methods for the Cox regression model. Political Analysis, 20(1), 113-135. doi: 10.1093/pan/mpr042
set.seed(12345) x1 <- rnorm(100) x2 <- rnorm(100) x2e <- x2 + rnorm(100, 0, 0.5) y <- rexp(100, exp(x1 + x2)) y <- survival::Surv(y) dat <- data.frame(y, x1, x2e) form <- y ~ x1 + x2e results <- cvmf(formula = form, data = dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.