genComplResid: genComplResid

Description Usage Arguments Details Value Author(s) References Examples

View source: R/genComplResid.R


Generates a completed vector of residuals


genComplResid(U, Delta, Phi, blkID, m = 50, X = NULL)



a nx1 vector containing the survival times. U = min(C, T) where C is the censoring time, and T the failure time


a nx1 vector containing the censoring indicator


a nxn kinship matrix


a nx1 vector with entries identifying correlated groups of observations. The number of censored individuals in each group cannot exceed 1000 (see Details)


default=50. Number of imputations used to generate the completed vector of residuals


a nxp matrix of p covariates. Each row represents a different individual, and each column represents a different numeric covariate. If no covariates are present, X can be left as NULL


This function involves three steps. The first two are similar in spirit to the two-stage procedure of Othus and Li (2010).

  1. The vector of covariate parameters and the monotone increasing function of the transformation model with censored data (Cheng et al., 1995) are estimated under the working independence assumption following the algorithm of Chen et al. (2002) and used to compute raw residuals;

  2. The polygenic heritability parameter is estimated which is a measure of the dependence between the survival traits of correlated groups that cannot be attributed to the SNP set under investigation. This estimate is used to deduce the approximate covariance matrix of the raw residuals.

  3. An imputation procedure is employed to replace the censored raw residuals by the mean of multiple imputed values generated from the posterior distribution of the uncensored version with the restriction to be larger than the original censored values, componentwise. The completed vector of residuals is then deduced and standardized. A scale parameter is used to reflect the fact that we are using multiple imputed values rather than real observations.

Warning: Correlated groups identified by the vector blkID most often corresponds to families or blocks of the block-diagonal kinship matrix Phi. Larger groups such as regions of residence can be considered, for example to take into account population stratification or cryptic relatedness. However, the number of censored individuals in each group cannot exceed 1000 as the test makes use of the distribution function of the multivariate normal distribution for which the maximum dimension is 1000 in the function pmvnorm of the package mvtnorm.

Simulation studies reported in Leclerc et al. (2015) suggest that the use of m = 50 imputations guarantees a reasonable power in practice.

Warning: No missing data is allowed for U, Delta, Phi, blkID, and X.


The function produces a list consisting of:


the completed vector of residuals


the estimate of the polygenic heritability parameter


the estimate of the vector of covariate parameters (if applicable)


Martin Leclerc <[email protected]> and Lajmi Lakhal Chaieb <[email protected]>


Chen K, Jin Z, Ying Z. 2002. Semiparametric analysis of transformation models with censored data. Biometrika 89:659-668.

Cheng SC, Wei LJ, Ying Z. 1995. Analysis of transformation models with censored data. Biometrika 82:835-845.

Leclerc M, The Consortium of Investigators of Modifiers of BRCA1/2, Simard J, Lakhal-Chaieb L. 2015. SNP set association testing for survival outcomes in the presence of intrafamilial correlation. Genetic Epidemiology 39:406-414.

Othus M, Li Y. 2010. A gaussian copula model for multivariate survival data. Stat Biosci 2:154-179.


for (i in seq_along(simGyriq)) assign(names(simGyriq)[i], simGyriq[[i]])

cr <- genComplResid(U, Delta, Phi, blkID, m=50, X)

gyriq documentation built on May 29, 2017, 3:52 p.m.