cox.zph.mids {basecamb} | R Documentation |
Test cox proportional odds assumption on models using multiple imputation.
Description
Constructs a model and conducts a cox.zph test for each imputation of the data set.
Usage
cox.zph.mids(
model,
imputations,
p_level = 0.05,
global_only = TRUE,
return_raw = FALSE,
p_only = TRUE,
verbose = TRUE
)
Arguments
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 |
Value
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
Author(s)
J. Peter Marquardt
Examples
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)
[Package basecamb version 1.1.5 Index]