Title: | Bias-Corrected Sandwich Variance Estimators for Marginal Cox Analysis of Cluster Randomized Trials |
---|---|
Description: | The implementation of bias-corrected sandwich variance estimators for the analysis of cluster randomized trials with time-to-event outcomes using the marginal Cox model, proposed by Wang et al. (under review). |
Authors: | Xueqi Wang [aut, cre], Elizabeth Turner [aut], Fan Li [aut] |
Maintainer: | Xueqi Wang <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.0.1.0 |
Built: | 2025-03-10 05:04:25 UTC |
Source: | https://github.com/cran/CoxBcv |
Calculate the Fay and Graubard (FG; 2001) bias-corrected sandwich variance estimator, for marginal Cox analysis of cluster randomized trials, proposed by Wang et al. (under review).
CoxBcv.fg(Y, Delta, X, ID)
CoxBcv.fg(Y, Delta, X, ID)
Y |
vector of observed time-to-event data. |
Delta |
vector of censoring indicators. |
X |
matrix of marginal mean covariates with one column for one covariate (design matrix excluding intercept). |
ID |
vector of cluster identifiers. |
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
FG-var - FG bias-corrected sandwich variance estimate of coef.
Fay, M. P., & Graubard, B. I. (2001). Small‐sample adjustments for Wald‐type tests using sandwich estimators. Biometrics, 57(4), 1198-1206.
Wang, X., Turner, E. L., & Li, F. Improving sandwich variance estimation for marginal Cox analysis of cluster randomized trials. Under Review.
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.fg(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.fg(Y,Delta,X,ID)
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.fg(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.fg(Y,Delta,X,ID)
Calculate the hybrid FGMR bias-corrected sandwich variance estimator, for marginal Cox analysis of cluster randomized trials, proposed by Wang et al. (under review). FG: Fay and Graubard (2001); MR: martingale residual.
CoxBcv.fgmr(Y, Delta, X, ID)
CoxBcv.fgmr(Y, Delta, X, ID)
Y |
vector of observed time-to-event data. |
Delta |
vector of censoring indicators. |
X |
matrix of marginal mean covariates with one column for one covariate (design matrix excluding intercept). |
ID |
vector of cluster identifiers. |
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
FGMR-var - FGMR bias-corrected sandwich variance estimate of coef.
Fay, M. P., & Graubard, B. I. (2001). Small‐sample adjustments for Wald‐type tests using sandwich estimators. Biometrics, 57(4), 1198-1206.
Wang, X., Turner, E. L., & Li, F. Improving sandwich variance estimation for marginal Cox analysis of cluster randomized trials. Under Review.
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.fgmr(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.fgmr(Y,Delta,X,ID)
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.fgmr(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.fgmr(Y,Delta,X,ID)
Calculate the Kauermann and Carroll (KC; 2001) bias-corrected sandwich variance estimator, for marginal Cox analysis of cluster randomized trials, proposed by Wang et al. (under review).
CoxBcv.kc(Y, Delta, X, ID)
CoxBcv.kc(Y, Delta, X, ID)
Y |
vector of observed time-to-event data. |
Delta |
vector of censoring indicators. |
X |
matrix of marginal mean covariates with one column for one covariate (design matrix excluding intercept). |
ID |
vector of cluster identifiers. |
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
KC-var - KC bias-corrected sandwich variance estimate of coef.
Kauermann, G., & Carroll, R. J. (2001). A note on the efficiency of sandwich covariance matrix estimation. Journal of the American Statistical Association, 96(456), 1387-1396.
Wang, X., Turner, E. L., & Li, F. Improving sandwich variance estimation for marginal Cox analysis of cluster randomized trials. Under Review.
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.kc(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.kc(Y,Delta,X,ID)
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.kc(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.kc(Y,Delta,X,ID)
Calculate the hybrid KCMR bias-corrected sandwich variance estimator, for marginal Cox analysis of cluster randomized trials, proposed by Wang et al. (under review). KC: Kauermann and Carroll (2001); MR: martingale residual.
CoxBcv.kcmr(Y, Delta, X, ID)
CoxBcv.kcmr(Y, Delta, X, ID)
Y |
vector of observed time-to-event data. |
Delta |
vector of censoring indicators. |
X |
matrix of marginal mean covariates with one column for one covariate (design matrix excluding intercept). |
ID |
vector of cluster identifiers. |
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
KCMR-var - KCMR bias-corrected sandwich variance estimate of coef.
Kauermann, G., & Carroll, R. J. (2001). A note on the efficiency of sandwich covariance matrix estimation. Journal of the American Statistical Association, 96(456), 1387-1396.
Wang, X., Turner, E. L., & Li, F. Improving sandwich variance estimation for marginal Cox analysis of cluster randomized trials. Under Review.
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.kcmr(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.kcmr(Y,Delta,X,ID)
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.kcmr(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.kcmr(Y,Delta,X,ID)
Calculate the Morel, Bokossa, and Neerchal (MBN; 2003) bias-corrected sandwich variance estimator, for marginal Cox analysis of cluster randomized trials, proposed by Wang et al. (under review).
CoxBcv.mbn(Y, Delta, X, ID)
CoxBcv.mbn(Y, Delta, X, ID)
Y |
vector of observed time-to-event data. |
Delta |
vector of censoring indicators. |
X |
matrix of marginal mean covariates with one column for one covariate (design matrix excluding intercept). |
ID |
vector of cluster identifiers. |
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
MBN-var - MBN bias-corrected sandwich variance estimate of coef.
Morel, J. G., Bokossa, M. C., & Neerchal, N. K. (2003). Small sample correction for the variance of GEE estimators. Biometrical Journal: journal of mathematical methods in biosciences, 45(4), 395-409.
Wang, X., Turner, E. L., & Li, F. Improving sandwich variance estimation for marginal Cox analysis of cluster randomized trials. Under Review.
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.mbn(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.mbn(Y,Delta,X,ID)
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.mbn(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.mbn(Y,Delta,X,ID)
Calculate the hybrid MBNMR bias-corrected sandwich variance estimator for marginal Cox analysis of cluster randomized trials, proposed by Wang et al. (under review). MBN: Morel, Bokossa, and Neerchal (2003); MR: martingale residual.
CoxBcv.mbnmr(Y, Delta, X, ID)
CoxBcv.mbnmr(Y, Delta, X, ID)
Y |
vector of observed time-to-event data. |
Delta |
vector of censoring indicators. |
X |
matrix of marginal mean covariates with one column for one covariate (design matrix excluding intercept). |
ID |
vector of cluster identifiers. |
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
MBNMR-var - MBNMR bias-corrected sandwich variance estimate of coef.
Morel, J. G., Bokossa, M. C., & Neerchal, N. K. (2003). Small sample correction for the variance of GEE estimators. Biometrical Journal: journal of mathematical methods in biosciences, 45(4), 395-409.
Wang, X., Turner, E. L., & Li, F. Improving sandwich variance estimation for marginal Cox analysis of cluster randomized trials. Under Review.
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.mbnmr(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.mbnmr(Y,Delta,X,ID)
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.mbnmr(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.mbnmr(Y,Delta,X,ID)
Calculate the Mancl and DeRouen (MD; 2001) bias-corrected sandwich variance estimator, for marginal Cox analysis of cluster randomized trials, proposed by Wang et al. (under review).
CoxBcv.md(Y, Delta, X, ID)
CoxBcv.md(Y, Delta, X, ID)
Y |
vector of observed time-to-event data. |
Delta |
vector of censoring indicators. |
X |
matrix of marginal mean covariates with one column for one covariate (design matrix excluding intercept). |
ID |
vector of cluster identifiers. |
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
MD-var - MD bias-corrected sandwich variance estimate of coef.
Mancl, L. A., & DeRouen, T. A. (2001). A covariance estimator for GEE with improved small‐sample properties. Biometrics, 57(1), 126-134.
Wang, X., Turner, E. L., & Li, F. Improving sandwich variance estimation for marginal Cox analysis of cluster randomized trials. Under Review.
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.md(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.md(Y,Delta,X,ID)
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.md(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.md(Y,Delta,X,ID)
Calculate the hybrid MDMR bias-corrected sandwich variance estimator, for marginal Cox analysis of cluster randomized trials, proposed by Wang et al. (under review). MD: Mancl and DeRouen (2001); MR: martingale residual.
CoxBcv.mdmr(Y, Delta, X, ID)
CoxBcv.mdmr(Y, Delta, X, ID)
Y |
vector of observed time-to-event data. |
Delta |
vector of censoring indicators. |
X |
matrix of marginal mean covariates with one column for one covariate (design matrix excluding intercept). |
ID |
vector of cluster identifiers. |
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
MDMR-var - MDMR bias-corrected sandwich variance estimate of coef.
Mancl, L. A., & DeRouen, T. A. (2001). A covariance estimator for GEE with improved small‐sample properties. Biometrics, 57(1), 126-134.
Wang, X., Turner, E. L., & Li, F. Improving sandwich variance estimation for marginal Cox analysis of cluster randomized trials. Under Review.
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.mdmr(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.mdmr(Y,Delta,X,ID)
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.mdmr(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.mdmr(Y,Delta,X,ID)
Calculate the martingale residual (MR) bias-corrected sandwich variance estimator, for marginal Cox analysis of cluster randomized trials, proposed by Wang et al. (under review).
CoxBcv.mr(Y, Delta, X, ID)
CoxBcv.mr(Y, Delta, X, ID)
Y |
vector of observed time-to-event data. |
Delta |
vector of censoring indicators. |
X |
matrix of marginal mean covariates with one column for one covariate (design matrix excluding intercept). |
ID |
vector of cluster identifiers. |
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
MR-var - MR bias-corrected sandwich variance estimate of coef.
Wang, X., Turner, E. L., & Li, F. Improving sandwich variance estimation for marginal Cox analysis of cluster randomized trials. Under Review.
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.mr(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.mr(Y,Delta,X,ID)
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.mr(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.mr(Y,Delta,X,ID)
Calculate the uncorrected robust sandwich variance estimator for marginal Cox analysis of cluster randomized trials (Spiekerman and Lin, 1998).
CoxBcv.rob(Y, Delta, X, ID)
CoxBcv.rob(Y, Delta, X, ID)
Y |
vector of observed time-to-event data. |
Delta |
vector of censoring indicators. |
X |
matrix of marginal mean covariates with one column for one covariate (design matrix excluding intercept). |
ID |
vector of cluster identifiers. |
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
ROB-var - uncorrected robust sandwich variance estimate of coef.
Spiekerman, C. F., & Lin, D. Y. (1998). Marginal regression models for multivariate failure time data. Journal of the American Statistical Association, 93(443), 1164-1175.
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.rob(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.rob(Y,Delta,X,ID)
Y <- c(11,19,43,100,7,100,100,62,52,1,7,6) Delta <- c(1,1,1,0,1,0,0,1,1,1,1,1) X1 <- c(0,0,0,0,0,0,1,1,1,1,1,1) X2 <- c(-19,6,-25,48,10,-25,15,22,17,-9,45,12) ID <- c(1,1,2,2,3,3,4,4,5,5,6,6) X <- X1 CoxBcv.rob(Y,Delta,X,ID) X <- cbind(X1,X2) CoxBcv.rob(Y,Delta,X,ID)