influences.missingdata {CaseCohortCoxSurvival}R Documentation

influences.missingdata

Description

Computes the influences on the log-relative hazard, baseline hazards at each unique event time, cumulative baseline hazard in a given time interval [Tau1, Tau2] and on the pure risk in [Tau1, Tau2] and for a given covariate profile x, when covariate data is missing for certain individuals in the phase-two data.

Usage

influences.missingdata(mod, riskmat.phase2, dNt.phase2 = NULL,
status.phase2 = NULL, Tau1 = NULL, Tau2 = NULL, x = NULL,
estimated.weights = FALSE, B.phase2 = NULL)

Arguments

mod

a cox model object, result of function coxph.

riskmat.phase2

at risk matrix for the phase-two data at all of the cases event times, even those with missing covariate data.

dNt.phase2

counting process matrix for failures in the phase-two data. Needs to be provided if status.phase2 = NULL.

status.phase2

vector indicating the case status in the phase-two data. Needs to be provided if dNt.phase2 = NULL.

Tau1

left bound of the time interval considered for the cumulative baseline hazard and pure risk. Default is the first event time.

Tau2

right bound of the time interval considered for the cumulative baseline hazard and pure risk. Default is the last event time.

x

vector of length p, specifying the covariate profile considered for the pure risk. Default is (0,...,0).

estimated.weights

are the weights for the third phase of sampling (due to missingness) estimated? If estimated.weights = TRUE, the argument below needs to beprovided. Default is FALSE.

B.phase2

matrix for the phase-two data, with phase-three sampling strata indicators. It should have as many columns as phase-three strata (J^{(3)}), with one 1 per row, to indicate the phase-three stratum position. Needs to be provided if estimated.weights = TRUE.

Details

influences.missingdata works for estimation from a case-cohort with design weights and when covariate data was missing for certain individuals in the phase-two data (i.e., case-cohort obtained from three phases of sampling).

If there are no missing covariates in the phase- two sample, use influences with either design weights or calibrated weights.

When covariate information was missing for certain individuals in the phase-two data (i.e., case-cohort obtained from three phases of sampling), use influences.missingdata.

influences.missingdata uses the influence formulas provided in Etievant and Gail (2024).

Value

infl.beta: matrix with the overall influences on the log-relative hazard estimates.

infl.lambda0.t: matrix with the overall influences on the baseline hazards estimates at each unique event time.

infl.Lambda0.Tau1Tau2.hat: vector with the overall influences on the cumulative baseline hazard estimate in [Tau1, Tau2].

infl.Pi.x.Tau1Tau2.hat: vector with the overall influences on the pure risk estimate in [Tau1, Tau2] and for covariate profile x.

infl2.beta: matrix with the phase-two influences on the log-relative hazard estimates.

infl2.lambda0.t: matrix with the phase-two influences on the baseline hazards estimates at each unique event time.

infl2.Lambda0.Tau1Tau2.hat: vector with the phase-two influences on the cumulative baseline hazard estimate in [Tau1, Tau2].

infl2.Pi.x.Tau1Tau2.hat: vector with the phase-two influences on the pure risk estimate in [Tau1, Tau2] and for covariate profile x.

infl3.beta: matrix with the phase-three influences on the log-relative hazard estimates.

infl3.lambda0.t: matrix with the phase-three influences on the baseline hazards estimates at each unique event time.

infl3.Lambda0.Tau1Tau2.hat: vector with the phase-three influences on the cumulative baseline hazard estimate in [Tau1, Tau2].

infl3.Pi.x.Tau1Tau2.hat: vector with the phase-three influences on the pure risk estimate in [Tau1, Tau2] and for covariate profile x.

beta.hat: vector of length p with log-relative hazard estimates.

lambda0.t.hat: vector with baseline hazards estimates at each unique event time.

Lambda0.Tau1Tau2.hat: cumulative baseline hazard estimate in [Tau1, Tau2].

Pi.x.Tau1Tau2.hat: pure risk estimate in [Tau1, Tau2] and for covariate profile x.

References

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.

See Also

estimation, estimation.CumBH, estimation.PR, influences.RH.missingdata, influences.CumBH.missingdata, influences.PR.missingdata, influences, influences.RH, influences.CumBH, influences.PR, robustvariance and variance.

Examples


  data(dataexample.missingdata.stratified, package="CaseCohortCoxSurvival")

  cohort <- dataexample.missingdata.stratified$cohort
  phase2 <- cohort[which(cohort$phase2 == 1),] # the phase-two sample
  casecohort <- cohort[which(cohort$phase3 == 1),] # the stratified case-cohort

  B.phase2 <- cbind(1 * (phase2$W3 == 0), 1 * (phase2$W3 == 1))
  rownames(B.phase2)  <- cohort[cohort$phase2 == 1, "id"]
  B.phase3 <- cbind(1 * (casecohort$W3 == 0), 1 * (casecohort$W3 == 1))
  rownames(B.phase3)  <- cohort[cohort$phase3 == 1, "id"]
  total.B.phase2 <- colSums(B.phase2)
  J3 <- ncol(B.phase3)
  n <- nrow(cohort)

  # Quantities needed for estimation of the cumulative baseline hazard when
  # covariate data is missing
  mod.cohort <- coxph(Surv(event.time, status) ~ X2, data = cohort,
                      robust = TRUE) # X2 is available on all cohort members
  mod.cohort.detail <- coxph.detail(mod.cohort, riskmat = TRUE)

  riskmat.phase2 <- with(cohort, mod.cohort.detail$riskmat[phase2 == 1,])
  rownames(riskmat.phase2) <- cohort[cohort$phase2 == 1, "id"]
  observed.times.phase2 <- apply(riskmat.phase2, 1,
                                 function(v) {which.max(cumsum(v))})
  dNt.phase2 <- matrix(0, nrow(riskmat.phase2), ncol(riskmat.phase2))
  dNt.phase2[cbind(1:nrow(riskmat.phase2), observed.times.phase2)] <- 1
  dNt.phase2 <- sweep(dNt.phase2, 1, phase2$status, "*")
  colnames(dNt.phase2) <- colnames(riskmat.phase2)
  rownames(dNt.phase2) <- rownames(riskmat.phase2)

  Tau1 <- 0 # given time interval for the pure risk
  Tau2 <- 8
  x <- c(-1, 1, -0.6) # given covariate profile for the pure risk

  # Estimation using the stratified case cohort with true known design weights
  mod.true <- coxph(Surv(event.time, status) ~ X1 + X2 + X3, data = casecohort,
                    weight = weight.true, id = id, robust = TRUE)

  est.true <- influences.missingdata(mod = mod.true,
                                     riskmat.phase2 = riskmat.phase2,
                                     dNt.phase2 = dNt.phase2, Tau1 = Tau1,
                                     Tau2 = Tau2, x = x)

  # print the influences on the log-relative hazard estimates
  # est.true$infl.beta
  # print the phase-two influences on the log-relative hazard estimates
  # est.true$infl2.beta
  # print the phase-three influences on the log-relative hazard estimates
  # est.true$infl3.beta

  # print the influences on the cumulative baseline hazard estimate
  # est.true$infl.Lambda0.Tau1Tau2
  # print the phase-two influences on the cumulative baseline hazard estimate
  # est.true$infl2.Lambda0.Tau1Tau2
  # print the phase-three influences on the cumulative baseline hazard estimate
  # est.true$infl3.Lambda0.Tau1Tau2

  # print the influences on the pure risk estimate
  # est.true$infl.Pi.x.Tau1Tau2
  # print the phase-two influences on the pure risk estimate
  # est.true$infl2.Pi.x.Tau1Tau2
  # print the phase-three influences on the pure risk estimate
  # est.true$infl3.Pi.x.Tau1Tau2

  # Estimation using the stratified case cohort with estimated weights, and
  # accounting for the estimation through the influences
  mod.estimated <- coxph(Surv(event.time, status) ~ X1 + X2 + X3,
                         data = casecohort, weight = weight.est, id = id,
                         robust = TRUE)

  est.estimated  <- influences.missingdata(mod.estimated,
                                           riskmat.phase2 = riskmat.phase2,
                                           dNt.phase2 = dNt.phase2,
                                           estimated.weights = TRUE,
                                           B.phase2 = B.phase2, Tau1 = Tau1,
                                           Tau2 = Tau2, x = x)

  # print the influences on the log-relative hazard estimates
  # est.estimated$infl.beta
  # print the phase-two influences on the log-relative hazard estimates
  # est.estimated$infl2.beta
  # print the phase-three influences on the log-relative hazard estimates
  # est.estimated$infl3.beta

  # print the influences on the cumulative baseline hazard estimate
  # est.estimated$infl.Lambda0.Tau1Tau2
  # print the phase-two influences on the cumulative baseline hazard estimate
  # est.estimated$infl2.Lambda0.Tau1Tau2
  # print the phase-three influences on the cumulative baseline hazard estimate
  # est.estimated$infl3.Lambda0.Tau1Tau2

  # print the influences on the pure risk estimate
  # est.estimated$infl.Pi.x.Tau1Tau2
  # print the phase-two influences on the pure risk estimate
  # est.estimated$infl2.Pi.x.Tau1Tau2
  # print the phase-three influences on the pure risk estimate
  # est.estimated$infl3.Pi.x.Tau1Tau2


[Package CaseCohortCoxSurvival version 0.0.36 Index]