diagnosticTests {WeightCalibSurvival} | R Documentation |
Perform diagnostic tests for an additive hazard model and the proportional hazards assumption.
diagnosticTests(data, ncc.subset, outcome.var, time.vars, timeDep.covars, timeIndep.covars, nCntlPerCase=1, inclProb.var=NULL, start.time=0, print=TRUE, plot=TRUE, min.inclProb=1e-6)
data |
Data frame containing all the data for analysis. |
ncc.subset |
Logical vector giving the subjects in the nested case-control sample.
The length must be equal to the number of rows in |
outcome.var |
Binary outcome variable in |
time.vars |
One or two time-to-event variables in |
timeDep.covars |
Character vector of covariates with time-varying effects. |
timeIndep.covars |
Character vector of covariates with time-invariant effects. |
nCntlPerCase |
Number of controls per case.
This is only used if |
inclProb.var |
NULL or a variable in |
start.time |
The starting time used to test for constant effects. The default is 0. |
print |
TRUE or FALSE to print information. The default is TRUE. |
plot |
TRUE or FALSE to create plots. The default is TRUE. |
min.inclProb |
Positive value |
To test for proportional hazards, the cox.zph
function is used. To determine if an additive hazards model is appropriate,
the aalen
function is used to perform a
Kolmogorov-Smirnov test for time-varying effects.
A list containing two tables: propHaz.test
and addHaz.test
.
Yei Eun Shin syeeun@gmail.com
Shin YE, Pfeiffer RM Graubard BI, Gail MH. Weight calibration to improve efficiency for estimating pure risks from the additive hazards model with the nested case-control design. Biometrics. 2020;1-13. https://doi.org/10.1111/biom.13413
data(sample_data, package="WeightCalibSurvival") # Set the input arguments ncc.subset <- sample_data[, "ind.ph2"] outcome.var <- "ind.fail" time.vars <- "eventime" timeDep.covars <- c("X1", "X2") timeIndep.covars <- c("Z1", "Z2") inclProb.var <- "incl.prob" ret <- diagnosticTests(sample_data, ncc.subset, outcome.var, time.vars, timeDep.covars, timeIndep.covars, inclProb.var=inclProb.var) print(ret)