Type: | Package |
Title: | Bias-Corrected Sandwich Variance Estimators for Marginal Cox Analysis of Cluster Randomized Trials |
Version: | 0.0.1.0 |
Maintainer: | Xueqi Wang <xueqi.wang@duke.edu> |
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). |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
RoxygenNote: | 7.1.2 |
Encoding: | UTF-8 |
Imports: | pracma, survival |
NeedsCompilation: | no |
Packaged: | 2022-03-05 21:37:54 UTC; xueqiwang |
Author: | Xueqi Wang [aut, cre], Elizabeth Turner [aut], Fan Li [aut] |
Repository: | CRAN |
Date/Publication: | 2022-03-09 08:10:02 UTC |
Fay and Graubard (FG) bias-corrected sandwich variance estimator
Description
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).
Usage
CoxBcv.fg(Y, Delta, X, ID)
Arguments
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. |
Value
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
FG-var - FG bias-corrected sandwich variance estimate of coef.
References
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.
Examples
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)
Hybrid FGMR bias-corrected sandwich variance estimator
Description
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.
Usage
CoxBcv.fgmr(Y, Delta, X, ID)
Arguments
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. |
Value
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
FGMR-var - FGMR bias-corrected sandwich variance estimate of coef.
References
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.
Examples
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)
Kauermann and Carroll (KC) bias-corrected sandwich variance estimator
Description
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).
Usage
CoxBcv.kc(Y, Delta, X, ID)
Arguments
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. |
Value
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
KC-var - KC bias-corrected sandwich variance estimate of coef.
References
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.
Examples
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)
Hybrid KCMR bias-corrected sandwich variance estimator
Description
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.
Usage
CoxBcv.kcmr(Y, Delta, X, ID)
Arguments
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. |
Value
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
KCMR-var - KCMR bias-corrected sandwich variance estimate of coef.
References
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.
Examples
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)
Morel, Bokossa, and Neerchal (MBN) bias-corrected sandwich variance estimator
Description
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).
Usage
CoxBcv.mbn(Y, Delta, X, ID)
Arguments
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. |
Value
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
MBN-var - MBN bias-corrected sandwich variance estimate of coef.
References
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.
Examples
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)
Hybrid MBNMR bias-corrected sandwich variance estimator
Description
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.
Usage
CoxBcv.mbnmr(Y, Delta, X, ID)
Arguments
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. |
Value
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
MBNMR-var - MBNMR bias-corrected sandwich variance estimate of coef.
References
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.
Examples
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)
Mancl and DeRouen (MD) bias-corrected sandwich variance estimator
Description
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).
Usage
CoxBcv.md(Y, Delta, X, ID)
Arguments
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. |
Value
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
MD-var - MD bias-corrected sandwich variance estimate of coef.
References
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.
Examples
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)
Hybrid MDMR bias-corrected sandwich variance estimator
Description
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.
Usage
CoxBcv.mdmr(Y, Delta, X, ID)
Arguments
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. |
Value
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
MDMR-var - MDMR bias-corrected sandwich variance estimate of coef.
References
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.
Examples
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)
Martingale residual (MR) bias-corrected sandwich variance estimator
Description
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).
Usage
CoxBcv.mr(Y, Delta, X, ID)
Arguments
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. |
Value
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
MR-var - MR bias-corrected sandwich variance estimate of coef.
References
Wang, X., Turner, E. L., & Li, F. Improving sandwich variance estimation for marginal Cox analysis of cluster randomized trials. Under Review.
Examples
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)
Uncorrected robust sandwich variance estimator
Description
Calculate the uncorrected robust sandwich variance estimator for marginal Cox analysis of cluster randomized trials (Spiekerman and Lin, 1998).
Usage
CoxBcv.rob(Y, Delta, X, ID)
Arguments
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. |
Value
coef - estimate of coefficients.
exp(coef) - estimate of hazard ratio.
ROB-var - uncorrected robust sandwich variance estimate of coef.
References
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.
Examples
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)