| Title: | Transformation-Based Regression under Dependent Truncation |
|---|---|
| Description: | A latent, quasi-independent truncation time is assumed to be linked with the observed dependent truncation time, the event time, and an unknown transformation parameter via a structural transformation model. The transformation parameter is chosen to minimize the conditional Kendall's tau (Martin and Betensky, 2005) <doi:10.1198/016214504000001538> or the regression coefficient estimates (Jones and Crowley, 1992) <doi:10.2307/2336782>. The marginal distribution for the truncation time and the event time are completely left unspecified. The methodology is applied to survival curve estimation and regression analysis. |
| Authors: | Sy Han (Steven) Chiou [aut, cre], Jing Qian [aut] |
| Maintainer: | Sy Han (Steven) Chiou <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.2.4 |
| Built: | 2026-05-20 07:51:36 UTC |
| Source: | https://github.com/stc04003/transurv |
A package that estimates survival curve under a dependent truncation and independent right censoring via a structural transformation method. The package also includes hypothesis test of quasi-independence based on the conditional Kendall's tau of Martin and Betensky (2005) and two versions of the inverse probability weighted Kendall's tau of Austin and Betensky (2014).
Maintainer: Sy Han (Steven) Chiou [email protected]
Authors:
Jing Qian [email protected]
Martin E. and Betensky R. A. (2005), Testing quasi-independence of failure and truncation times via conditional Kendall's tau, Journal of the American Statistical Association, 100 (470): 484-492.
Austin, M. D. and Betensky R. A. (2014), Eliminating bias due to censoring in Kendall's tau estimators for quasi-independence of truncation and failure, Computational Statistics & Data Analysis, 73: 16-26.
Chiou, S., Austin, M., Qian, J. and Betensky R. A. (2016), Transformation model estimation of survival under dependent truncation and independent censoring, Statistical Methods in Medical Research, 28 (12): 3785-3798.
Useful links:
Computes the conditional Kendall's tau and inference
cKendall( trun, obs, delta = NULL, method = "MB", weights = NULL, a = 0, trans = "linear", ... )cKendall( trun, obs, delta = NULL, method = "MB", weights = NULL, a = 0, trans = "linear", ... )
trun |
left truncation time satisfying |
obs |
observed failure time, must be the same length as |
delta |
an optional 0-1 vector of censoring indicator (0 = censored, 1 = event) for |
method |
a character string specifying the different version of conditional Kendall's tau to be computed. The following are permitted:
|
weights |
an optional vector of sampling weights used when |
a |
a numeric transformation parameter. The default value is 0, which applies no transformation.
This parameter must be greater than |
trans |
a character string specifying the transformation structure. The following are permitted:
|
... |
for future methods. |
This function performs statistical test for quasi-independence between truncation time and failure time. The hypothesis test is based on the conditional Kendall's tau of Martin and Betensky (2005) and the two versions of the inverse probability weighted Kendall's tau of Austin and Betensky (2014).
The output contains the following components:
consistent point estimate of the conditional Kendall's tau.
asymptotic standard error of the conditional Kendall's tau estimator.
the value of the normal test statistic.
the (Wald) p-value of the test.
the transformation model (if applied).
the estimated transformation parameter.
A numeric value representing the unconditional Kendall's tau.
Martin E. and Betensky R. A. (2005), Testing quasi-independence of failure and truncation times via conditional Kendall's tau, Journal of the American Statistical Association, 100 (470): 484-492.
Austin, M. D. and Betensky R. A. (2014), Eliminating bias due to censoring in Kendall's tau estimators for quasi-independence of truncation and failure, Computational Statistics & Data Analysis, 73: 16-26.
data(channing, package = "boot") chan <- subset(channing, sex == "Male" & entry < exit) attach(chan) cKendall(entry, exit, cens) cKendall(entry, exit, cens, method = "IPW1") cKendall(entry, exit, cens, method = "IPW2") detach(chan)data(channing, package = "boot") chan <- subset(channing, sex == "Male" & entry < exit) attach(chan) cKendall(entry, exit, cens) cKendall(entry, exit, cens, method = "IPW1") cKendall(entry, exit, cens, method = "IPW2") detach(chan)
Provide goodness-of-fit diagnostics for the transformation model.
gof(x, B = 200, P = 1)gof(x, B = 200, P = 1)
x |
an object of class |
B |
an integer value specifies the bootstrap size for the left-truncated regression model. A value greater than 2 is required. |
P |
an integer value specifies number of breakpoints to test the linearity of the transformation model.
When |
The goodness of fit assessment of the transformation model focus on the structure of the transformation model, which has the form:
where is the truncation time, is the observed failure time,
is the transformed truncation time that is quasi-independent from and
is a monotonic transformation function.
With the condition, , assumed to be satisfied,
the structure of the transformation model implies
The regression estimates can be obtained by the left-truncated regression model (Karlsson and Lindmark, 2014).
To evaluate the goodness of fit of the transformation model,
the gof() function directly test the linearity in by considering larger model that are nonlinear in .
In particular, we expand the covariates to P piecewise linearity terms and test for equality of the associated coefficients.
A list containing the following elements
the regression coefficients of the left-truncated regression model.
the p-value for the equality of the piecewise linearity terms in the expanded model. See Details.
the class of the inputted object, x.
a data frame used in fitting the inputted model x.
Karlsson, M., Lindmark, A. (2014) truncSP: An R Package for Estimation of Semi-Parametric Truncated Linear Regression Models, Journal of Statistical Software, 57 (14), pp 1–19.
data(channing, package = "boot") chan <- subset(channing, entry < exit) fit <- trReg(Surv(entry, exit, cens) ~ sex, data = chan) gof(fit, B = 10)data(channing, package = "boot") chan <- subset(channing, entry < exit) fit <- trReg(Surv(entry, exit, cens) ~ sex, data = chan) gof(fit, B = 10)
Computes the unconditional Kendall's tau
kendall(x, y = NULL)kendall(x, y = NULL)
x |
a numeric vector. |
y |
a numeric vector with compatible length to |
This function computes the unconditional Kendall's tau (the Kendall rank correlation coefficient) for two variables.
The returned value is equivalent to that from cor with method = "kendall", but kendall is
implemented in C.
The output is a numeric value for the unconditional Kendall's tau.
A numeric value representing the unconditional Kendall's tau.
Kendall, M. G. (1938), A new measure of rank correlation, Biometrika, 81–93.
library(MASS) set.seed(1) dat <- mvrnorm(5000, c(0, 0), matrix(c(1, .5, .5, 1), 2)) ## True kendall's tau is 2 * asin(.5) / pi system.time(print(kendall(dat))) system.time(print(cor(dat, method = "kendall")))library(MASS) set.seed(1) dat <- mvrnorm(5000, c(0, 0), matrix(c(1, .5, .5, 1), 2)) ## True kendall's tau is 2 * asin(.5) / pi system.time(print(kendall(dat))) system.time(print(cor(dat, method = "kendall")))
Plot the survival estimation for an trSurvfit/trReg object.
## S3 method for class 'trSurvfit' plot(x, ...)## S3 method for class 'trSurvfit' plot(x, ...)
x |
an object of class |
... |
graphical parameters to be passed to methods. |
A ggplot object.
data(channing, package = "boot") chan <- subset(channing, entry < exit) plot(trReg(Surv(entry, exit, cens) ~ 1, data = chan))data(channing, package = "boot") chan <- subset(channing, entry < exit) plot(trReg(Surv(entry, exit, cens) ~ 1, data = chan))
pmcc computes the conditional product-moment correlation coefficient proposed by Chen et al. (1996).
The conditional product-moment correlation coefficient uses only the uncensored events.
pmcc(trun, obs, a = 0, trans = "linear")pmcc(trun, obs, a = 0, trans = "linear")
trun |
left truncation time satisfying |
obs |
observed failure time, must be the same length as |
a |
a numeric transformation parameter. The default value is 0, which applies no transformation.
This parameter must be greater than |
trans |
a character string specifying the transformation structure. The following are permitted:
|
A numeric value representing the product-moment correlation coefficient.
#' @seealso trSurvfit
data(channing, package = "boot") chan <- subset(channing, sex == "Male" & entry < exit & cens == 1) with(chan, pmcc(entry, exit)) ## cannot handle right censored datadata(channing, package = "boot") chan <- subset(channing, sex == "Male" & entry < exit & cens == 1) with(chan, pmcc(entry, exit)) ## cannot handle right censored data
Surv function imported from survival
This function is imported from the survival package,
used to create survival objects to be fitted with trReg()
and trSurvfit. See Surv for the
documentation on Surv.
a Surv object representing left-truncated and right-censored data, as defined in the 'survival' package.
trReg fits transformation model under dependent truncation and independent censoring via a structural transformation model.
trReg( formula, data, subset, tFun = "linear", method = c("kendall", "adjust"), B = 0, control = list() )trReg( formula, data, subset, tFun = "linear", method = c("kendall", "adjust"), B = 0, control = list() )
formula |
a formula expression, of the form |
data |
an optional data frame in which to interpret the variables occurring
in the |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
tFun |
a character string specifying the transformation function or a user specified function indicating the relationship between
|
method |
a character string specifying how the transformation parameter is estimated. The available options are |
B |
a numerical value specifies the bootstrap size for estimating the standard error.
When |
control |
a list of control parameters. The following arguments are allowed:
|
The main assumption on the structural transformation model is that it assumes there is a latent, quasi-independent truncation time that is associated with the observed dependent truncation time, the event time, and an unknown dependence parameter through a specified function. The structure of the transformation model is of the form:
where is the truncation time, is the observed failure time,
is the transformed truncation time that is quasi-independent from and is a monotonic transformation function.
The condition, , is assumed to be satisfied.
The quasi-independent truncation time, , is obtained by inverting the test for quasi-independence by one of the following methods:
method = "kendall" by minimizing the absolute value of the restricted inverse probability weighted Kendall's tau or maximize the corresponding -value.
This is the same procedure used in the trSUrvfit() function.
method = "adjust" includes a function of latent truncation time, , as a covariate.
A piece-wise function is constructed based on () indicator functions on whether falls in the th and the ()th percentile,
where is the number of cutpoints used. See control for details.
The transformation parameter, , is then chosen to minimize the significance of the coefficient parameter.
A trReg object containing the following components:
PEA named numeric matrix of point estimates and related statistics (e.g., coefficient, exponentiated coefficient, standard error, z-score, and p-value).
varNamesCharacter string giving the name(s) of the covariates.
SEA numeric vector contains the bootstrap standard error.
aEstimated transformation parameter.
CallThe matched call to the fitting function.
B, Q, P
Model parameters; B is the bootstrap sapmle, Q is the number of cutpoints, and P is the number of break points. See Details.
tFunA function defining the transformation model.
vNamesCharacter vector of covariate names.
methodCharacter string specifying the estimation method (e.g., "kendall" or "adjust").
.dataA data frame used in fitting.
data(channing, package = "boot") chan <- subset(channing, entry < exit) trReg(Surv(entry, exit, cens) ~ sex, data = chan)data(channing, package = "boot") chan <- subset(channing, entry < exit) trReg(Surv(entry, exit, cens) ~ sex, data = chan)
Auxiliary function as user interface for trSurvfit fitting.
trSurv.control( interval = c(-1, 20), lower = min(interval), upper = max(interval) )trSurv.control( interval = c(-1, 20), lower = min(interval), upper = max(interval) )
interval |
a vector containing the end-points of the interval to be searched the transformation parameter. |
lower |
the lower end-point of the interval to be searched. |
upper |
the upper end-point of the interval to be searched. |
A list containing the upper and lower bounds in fitting.
trSurvfit estimates survival curves under dependent truncation and independent censoring via a structural transformation model.
trSurvfit( trun, obs, delta = NULL, tFun = "linear", plots = FALSE, control = trSurv.control(), ... )trSurvfit( trun, obs, delta = NULL, tFun = "linear", plots = FALSE, control = trSurv.control(), ... )
trun |
left truncation time satisfying |
obs |
observed failure time, must be the same length as |
delta |
an optional 0-1 vector of censoring indicator (0 = censored, 1 = event) for |
tFun |
a character string specifying the transformation function or a user specified function indicating the relationship
between
|
plots |
an optional logical value; if TRUE, a series of diagnostic plots as well as the survival curve for the observed failure time will be plotted. |
control |
controls the lower and upper bounds when |
... |
for future methods. |
A structural transformation model assumes there is a latent, quasi-independent truncation time
that is associated with the observed dependent truncation time, the event time, and an unknown dependence parameter
through a specified funciton.
The dependence parameter is chosen to either minimize the absolute value of the restricted inverse probability weighted Kendall's tau or maximize the corresponding -value.
The marginal distribution for the truncation time and the event time are completely left unspecified.
The structure of the transformation model is of the form:
where is the truncation time, is the observed failure time,
is the transformed truncation time that is quasi-independent from and is a monotonic transformation function.
The condition, , is assumed to be satisfied.
The quasi-independent truncation time, , is obtained by inverting the test for quasi-independence by either minimizing
the absolute value of the restricted inverse probability weighted Kendall's tau or maximize the corresponding -value.
At the current version, three transformation structures can be specified. trans = "linear" corresponds to
trans = "log" corresponds to
trans = "exp" corresponds to
The output contains the following components:
survis a data.frame contains the survival probabilities estimates.
byTaua list contains the estimator of transformation parameter:
paris the best set of transformation parameter found;
objis the value of the inverse probability weighted Kendall's tau corresponding to 'par'.
byPa list contains the estimator of transformation parameter:
paris the best set of transformation parameter found;
objis the value of the inverse probability weighted Kendall's tau corresponding to 'par'.
qinda data frame consists of two quasi-independent variables:
trunis the transformed truncation time;
obsis the corresponding uncensored failure time.
Martin E. and Betensky R. A. (2005), Testing quasi-independence of failure and truncation times via conditional Kendall's tau, Journal of the American Statistical Association, 100 (470): 484-492.
Austin, M. D. and Betensky R. A. (2014), Eliminating bias due to censoring in Kendall's tau estimators for quasi-independence of truncation and failure, Computational Statistics & Data Analysis, 73: 16-26.
Chiou, S., Austin, M., Qian, J. and Betensky R. A. (2018), Transformation model estimation of survival under dependent truncation and independent censoring, Statistical Methods in Medical Research, 28 (12): 3785-3798.
data(channing, package = "boot") chan <- subset(channing, sex == "Male" & entry < exit) ## No display (fit <- with(chan, trSurvfit(entry, exit, cens))) ## With diagnostic plots and the survival estimate with(chan, trSurvfit(entry, exit, cens, plots = TRUE)) ## Plots survival estimate plot(fit)data(channing, package = "boot") chan <- subset(channing, sex == "Male" & entry < exit) ## No display (fit <- with(chan, trSurvfit(entry, exit, cens))) ## With diagnostic plots and the survival estimate with(chan, trSurvfit(entry, exit, cens, plots = TRUE)) ## Plots survival estimate plot(fit)
This is function computes the perturbed version of the conditional Kendall's tau.
wKendall(trun, obs, delta = NULL, weights = NULL)wKendall(trun, obs, delta = NULL, weights = NULL)
trun |
left truncation time satisfying |
obs |
observed failure time, must be the same length as |
delta |
an optional 0-1 vector of censoring indicator (0 = censored, 1 = event) for |
weights |
an optional perturbation weights. |
A numeric value representing the weighted conditional Kendall's tau.
data(channing, package = "boot") chan <- subset(channing, sex == "Male" & entry < exit) ## When weights is not specified, this function reduces to condKendall() with(chan, wKendall(entry, exit, cens)) mean(replicate(1000, with(chan, wKendall(entry, exit, cens, rexp(nrow(chan))))))data(channing, package = "boot") chan <- subset(channing, sex == "Male" & entry < exit) ## When weights is not specified, this function reduces to condKendall() with(chan, wKendall(entry, exit, cens)) mean(replicate(1000, with(chan, wKendall(entry, exit, cens, rexp(nrow(chan))))))