View source: R/risk_robustVariance.R
estimatePureRisk | R Documentation |
Computes pure risk estimates and variances for new covariate values.
estimatePureRisk(obj, x)
obj |
Return object from |
x |
Data frame or a list containing values of the covariates that were used
when |
A list containing:
var
Matrix of pure risk estimates in [Tau1, Tau2] and variance estimates
var.estimated
Matrix of pure risk estimates in [Tau1, Tau2] and variance estimates
when the phase-three weights are estimated
var.design
Matrix of pure risk estimates in [Tau1, Tau2] and variance estimates
when the phase-three weights are known
Depending on the analysis run, some of the above objects will be NULL.
Etievant, L., Gail, M. H. (2024). Cox model inference for relative hazard and pure risk from stratified weight-calibrated case-cohort data. Lifetime Data Analysis, 30, 572-599.
caseCohortCoxSurvival
data(dataexample.stratified, package="CaseCohortCoxSurvival")
data <- dataexample.stratified$cohort
cov1 <- "X2"
cov2 <- c("X1", "X3")
obj <- caseCohortCoxSurvival(data = data, status = "status",
time = "event.time", cox.phase1 = cov1,
cox.phase2 = cov2, strata = "W",
subcohort = "subcohort", Tau1 = 0, Tau2 = 8)
# get pure risk estimate for every individual's profile in the cohort
ret <- estimatePureRisk(obj, data)
# get pure risk estimate for one given covariate profile
ret <- estimatePureRisk(obj, list(X1 = 1, X2 = -1, X3 = 0.6))
# get pure risk estimates for two given covariate profiles
pr1 <- as.data.frame(cbind(X1 = -1, X2 = 1, X3 = -0.6))
pr2 <- as.data.frame(cbind(X1 = 1, X2 = -1, X3 = 0.6))
ret <- estimatePureRisk(obj, rbind(pr1, pr2))
ret$var
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.