Learn R Programming

tranSurv (version 1.1-4)

pmcc: Conditional product-moment correlation coefficient

Description

This function computes the conditional product-moment correlation coefficient proposed by Chen et al. (1996). The conditional product-moment correlation coefficient uses only the uncensored events.

Usage

pmcc(trun, obs, a = 0, trans = "linear", ...)

Arguments

trun
left truncation time, satisfying trun
obs
observed failure time, must be the same length as trun, might be right-censored.
a
a numeric transformation parameter. The default value is 0, which applies no transformation. This parameter must be greater than -1. See ?tranSurvfit for the transformation model structure.
trans
a character string specifying the transformation structure. The following are permitted: linear: linear transformation structure, log: log-linear transformation structure, exp: exponential transformation structure.
...
for future methods.

Value

The output contains the following components:

References

Chen, Chen-Hsin and Tsai, Wei-Yann and Chao, Wei-Hsiung (1996), The product-moment correlation coefficient and linear regression for truncated data, Journal of the American Statistical Association, 91436: 1181-1186.

Examples

Run this code
## Generate simulated data from transformation model
datgen <- function(n) {
    a <- -0.3
    X <- rweibull(n, 2, 4) ## failure times
    U <- rweibull(n, 2, 1) ## latent truncation time
    T <- (1 + a) * U - a * X ## apply transformation
    C <- Inf ## assuming no censoring
    dat <- data.frame(trun = T, obs = pmin(X, C), delta = 1 * (X <= C))
    return(subset(dat, trun <= obs))
}

set.seed(123)
dat <- datgen(300)

with(dat, pmcc(trun, obs))

Run the code above in your browser using DataLab