product.covar.weight {CaseCohortCoxSurvival}R Documentation

product.covar.weight

Description

Computes the product of joint design weights and joint sampling indicators covariances, needed for the phase-two component of the variance (with design or calibrated weights).

Usage

product.covar.weight(casecohort, stratified = NULL)

Arguments

casecohort

if stratified = TRUE, data frame with status (case status), W (the JJ strata), strata.m (vector of length JJ with the numbers of sampled individuals in the strata) and strata.n (vector of length JJ with the strata sizes), for each individual in the stratified case-cohort data. If stratified = FALSE, data frame with status (case status), m (number of sampled individuals) and n (cohort size), for each individual in the un-stratified case-cohort data.

stratified

was the sampling of the case-cohort stratified on W? Default is FALSE.

Details

product.covar.weight creates the matrix with the products of joint design weights and joint sampling indicator covariances, for the non-cases in the case cohort. In other words, it has as many rows and columns as non-cases in the case cohort, and contains the wi,k,jσi,k,jw_{i,k,j} \sigma_{i,k,j}, with

wi,k,j=n(j)(n(j)1)m(j)(m(j)1)w_{i,k,j} = \frac{n^{(j)}(n^{(j)} -1)}{m^{(j)}(m^{(j)} -1)} if individuals ii and kk in stratum jj are both non-cases, and wi,k,j=(n(j)m(j))2w_{i,k,j} = \left( \frac{n^{(j)}}{m^{(j)}} \right)^2 otherwise, ik{1,,n(j)}i \neq k \in \lbrace 1, \dots, n^{(j)} \rbrace, j{1,,J}j \in \lbrace 1, \dots, J \rbrace.

wi,i,j=n(j)m(j)w_{i,i,j} = \frac{n^{(j)}}{m^{(j)}} if individuals ii in stratum jj is a non-case, i{1,,n(j)}i \in \lbrace 1, \dots, n^{(j)} \rbrace, j{1,,J}j \in \lbrace 1, \dots, J \rbrace.

σi,k,j=m(j)(m(j)1)n(j)(n(j)1)(m(j)n(j))2\sigma_{i,k,j} = \frac{m^{(j)}(m^{(j)} -1)}{n^{(j)}(n^{(j)} -1)} - \left( \frac{m^{(j)}}{n^{(j)}} \right)^2 if individuals ii and kk in stratum jj are both non-cases, ik{1,,n(j)}i \neq k \in \lbrace 1, \dots, n^{(j)} \rbrace, j{1,,J}j \in \lbrace 1, \dots, J \rbrace.

σi,i,j=m(j)n(j)(1m(j)n(j))\sigma_{i,i,j} = \frac{m^{(j)}}{n^{(j)}} - \left(1 - \frac{m^{(j)}}{n^{(j)}} \right) if individuals ii in stratum jj is a non-case, i{1,,n(j)}i \in \lbrace 1, \dots, n^{(j)} \rbrace, j{1,,J}j \in \lbrace 1, \dots, J \rbrace.

See Section 3.3 in Etievant and Gail (2023).

Value

product.covar.weight: matrix with the products of joint design weights and joint sampling indicator covariances, for the non-cases in the case-cohort.

References

Etievant, L., Gail, M.H. (2023). Cox model inference for relative hazard and pure risk from stratified weight-calibrated case-cohort data. Submitted.

See Also

variance, that uses product.covar.weight to compute the variance estimate that follows the complete variance decomposition (superpopulation and phase-two variance components).

Examples

data(dataexample, package="CaseCohortCoxSurvival")

casecohort  <- dataexample$casecohort # a simulated stratified case-cohort

prod.covar.weight <- product.covar.weight(casecohort, stratified = TRUE)

nrow(prod.covar.weight)
ncol(prod.covar.weight)
sum(casecohort$status == 0) # number of non-cases in the case-cohort

[Package CaseCohortCoxSurvival version 0.0.34 Index]