cox.zph.mids | R Documentation |
Constructs a model and conducts a cox.zph test for each imputation of the data set.
cox.zph.mids(
model,
imputations,
p_level = 0.05,
global_only = TRUE,
return_raw = FALSE,
p_only = TRUE,
verbose = TRUE
)
model |
cox proportional model to be evaluated |
imputations |
mids object containing imputations |
p_level |
value below which violation of proportional odds assumption is assumed. Defaults to .05 |
global_only |
return global p-value only. Implies p_only to be TRUE |
return_raw |
return cox.zph objects in a list. If TRUE, function will not return anything else |
p_only |
returns p-values of test only. If FALSE returns Chi² and degrees of freedom as well |
verbose |
Set to FALSE to deactivate messages |
depending on specified options, this function can return
default: A vector of global p-values
global_only = FALSE: a data.frame with p-values for all variables plus the global
return_raw = TRUE: list of cox.zph objects
J. Peter Marquardt
data <- data.frame(time = 101:200, status = rep(c(0,1), 50), pred = rep(c(1:9, NA), 10))
imputed_data <- mice::mice(data)
cox_mod <- Hmisc::fit.mult.impute(survival::Surv(time, status) ~ pred,
fitter = rms::cph, xtrans = imputed_data)
cox.zph.mids(cox_mod, imputed_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.