| addHazardPureRisk {WeightCalibSurvival} | R Documentation |
A pure risk is estimated from additive hazards model fit for a given vector of covariates. Its variance estimate (standard error) is also computed based on influence functions of model coefficients.
addHazardPureRisk(addHazObj, newdata, risk.time,
new.risk.col="pureRisk", new.risk.se.col="pureRisk.SE")
addHazObj |
A fitted model from addHazard. |
newdata |
Data frame for covariate-specific pure risk estimation. |
risk.time |
Projection time for pure risk. |
new.risk.col |
New column name added to |
new.risk.se.col |
New column name added to |
The covariates used in addHazObj must also be in newdata, and
they must be of the same type.
The data frame newdata with two additional columns containing
the estimated pure risk and corresponding standard error.
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")
anc.covars <- "U"
risk.time <- 8
inclProb.var <- "incl.prob"
nrisk.var <- "nrisk"
fit <- addHazard(sample_data, ncc.subset, outcome.var, time.vars, timeDep.covars, timeIndep.covars,
anc.covars, risk.time, inclProb.var=inclProb.var, nrisk.var=nrisk.var)
newdata <- sample_data[ncc.subset, ]
ret <- addHazardPureRisk(fit$with.calibration, newdata, risk.time)
ret[1:5, ]