coxHazard {WeightCalibSurvival} | R Documentation |
This function fits the Cox proportional hazards model from a nested case-control study using weight calibration.
coxHazard(data, ncc.subset, outcome.var, time.vars, covars, anc.covars, risk.time, risk.time0=0, nCntlPerCase=1, inclProb.var=NULL, print=1, min.inclProb=1e-6, control=NULL)
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 |
covars |
Character vector of covariates. |
anc.covars |
NULL or a character vector of ancillary covariates used to impute missing
values of |
risk.time |
Projection time for pure risk. |
risk.time0 |
Initial projection time for pure risk. Only used |
nCntlPerCase |
Number of controls per case. The default is 1. |
inclProb.var |
NULL or a variable in |
print |
0 or 1 to print information. The default is 1. |
min.inclProb |
Positive value |
control |
See |
NOTE: If anc.covars = NULL
, then a seed must be set in order to reproduce
the results. See Step 1 below.
The algorithm is as follows:
Step 1: Obtain predictions for missing data
For any variable in covars
with missing data from phase 1,
fit a weighted generalized linear model among the nested case-control subjects (phase 2)
with that variable as the outcome adjusting for the
other covariates in covars
and anc.covars
.
The weights in the model are the reciprocals of the inclusion probabilities (inclProb.var
).
If anc.covars = NULL
, then runif(nrow(data))
will be used as an ancillary
covariate.
Step 2: Create auxiliary statistics (influence functions)
Step 3: Calibrate the design weights
Step 4: Fit the Cox model with and without the calibrated weights.
A list containing two fitted coxph
models:
with.calibration
and without.calibration
.
Yei Eun Shin syeeun@gmail.com
Shin YE, Pfeiffer RM, Graubard BI, Gail MH. Weight calibration to improve the efficiency of pure risk estimates from case-control samples nested in a cohort. Biometrics. 2019;1-11. https://doi.org/10.1111/biom.13209
data(sample_data, package="WeightCalibSurvival") # Set the input arguments ncc.subset <- sample_data[, "ind.ph2"] outcome.var <- "ind.fail" time.vars <- "eventime" covars <- c("X1", "X2", "Z1", "Z2") anc.covars <- "U" risk.time <- 8 inclProb.var <- "incl.prob" coxHazard(sample_data, ncc.subset, outcome.var, time.vars, covars, anc.covars, risk.time, inclProb.var=inclProb.var)