diagnosticTests {WeightCalibSurvival}R Documentation

Diagnostic Tests for Additive Hazards and Cox Proportional Hazards

Description

Perform diagnostic tests for an additive hazard model and the proportional hazards assumption.

Usage

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) 

Arguments

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 data.

outcome.var

Binary outcome variable in data (1 = case, 0 = non-case).

time.vars

One or two time-to-event variables in data.

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. The default is 1.

inclProb.var

NULL or a variable in data giving the probability of being included in the nested case-control sample. This can be computed using the function multipleNCC::KMprob. If NULL, then it is internally computed based on outcome.var, time.vars, and nCntlPerCase. The default is NULL.

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 <= 1 giving the minimum inclusion probability for being in the nested case-control sample. Any inclusion probability less than min.inclProb will be set to min.inclProb. This cannot be 0, since weights will be formed by taking the reciprocals of the inclusion probabilities. The default is 1e-6.

Details

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.

Value

A list containing two tables: propHaz.test and addHaz.test.

Author(s)

Yei Eun Shin syeeun@gmail.com

References

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

See Also

addHazard, coxHazard

Examples


  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)

[Package WeightCalibSurvival version 1.0.0 Index]