survSpearman: Computes Spearman's Correlation for Bivariate Survival Data.

View source: R/survSpearman.R

survSpearmanR Documentation

Computes Spearman's Correlation for Bivariate Survival Data.

Description

Computes non-parametric estimates of Spearman's rank correlation for bivariate survival data. Two correlations are returned: a highest rank correlation that can be interpreted as Spearman's correlation after assigning a highest rank to observations beyond a specified region, and a restricted correlation that estimates Spearman's correlation within the specified region.

Usage

survSpearman(X = NULL, Y = NULL, deltaX = NULL, deltaY = NULL, data = NULL,
tauX = Inf, tauY = Inf, bivarSurf = NULL)

Arguments

X

Time to event or censoring for variable X. It indicates time to event if argument deltaX=1 and time to censoring if argument deltaX=0.

Y

Time to event or censoring for variable Y. It indicates time to event if argument deltaY=1 and time to censoring if argument deltaY=0.

deltaX

Event indicator for variable X. deltaX=1 if the event is observed and 0 if it is censored.

deltaY

Event indicator for variable Y. deltaY=1 if the event is observed and 0 if it is censored.

data

Data frame containing variables (arguments) X, Y, deltaX, and deltaY.

tauX

The X value that defines the restricted region for X variable.

tauY

The Y value that defines the restricted region for Y variable.

bivarSurf

A matrix containing the marginal and joint survival probabilities. The first column is the marginal survival probability corresponding to variable X. The first row is the marginal survival probability corresponding to variable Y. The rest of the matrix contains the joint survival probabilities. The row names of bivarSurf are ordered X-values. The column names of bivarSurf are ordered Y-values. Element bivarSurf[1,1] equals 1. Its row and column name is '0' (see the documentation for the return value DabrowskaEst in function survDabrowska).

Details

The function computes the highest rank and restricted Spearman's correlations with bivariate survival data. The data can be supplied in three ways: 1) as vectors X, Y, deltaX, and deltaY; 2) as data frame data that contains the variables mentioned in 1); and 3) as matrix bivarSurf containing marginal and joint survival probabilities. If bivarSurf is not NULL then 1) and 2) are ignored. If bivarSurf is NULL and data is not then 2) is used. If bivarSurf and data are NULL then 1) is used. The highest rank correlation is the Spearman's correlation that can be interpreted as Spearman's rank correlation computed after assigning the highest rank to the events outside of tauX and tauY. The restricted Spearman's correlation is Spearman's correlation computed within the restricted region defined by tauX and tauY. Note that given tauX and tauY the survival probability is estimated using the values that are just above the latest observed event times within that region, what we call an effective restricted region. This means that if, for example, tauX is greater than the latest observed event time for X variable and tauY is greater than the latest observed event time for Y variable, then tauX and tauY do not affect the correlation values since the effective restricted region remains the same (as defined by the maximum observed event or censoring event times). The method of Dabrowska can result in negative probability mass for some points. This may result in zero or negative probability of failure in the restricted region, in which case the restricted Spearman's correlation cannot be computed and NA value is returned. This only happens when the sample size is small and censoring is heavy.

Value

The function returns the following list of values. 'Restricted region set by user' is a character vector of two user-specified restricted region values, tauX and tauY. 'Effective restricted region' is character vector of two values that define the effective restricted region, the values that are just above the latest observed event times within the user-specified restricted region. 'Correlation' is a numeric vector of two correlation values: the highest rank Spearman's correlation ('HighestRank') and the restricted region Spearman's correlation ('Restricted'), where the restricted region is defined by the values in 'Effective restricted region'.

Author(s)

Svetlana K Eden, svetlanaeden@gmail.com

References

Dabrowska, D. M. (1988) Kaplan–Meier estimate on the plane. The Annals of Statistics 16, 1475–1489.

Eden, S.K., Li, C., Shepherd B.E. (2021). Non-parametric Estimation of Spearman's Rank Correlation with Bivariate Survival Data. Biometrics (under revision).

Examples

### Compute correlation from data
X <- c(0.5, 0.6, 0.7, 0.8)
Y <- c(0.44, 0.77, 0.88, 0.99)
deltaX <- c(1, 0, 1, 1)
deltaY <- c(1, 1, 1, 1)
survSpearman(X, Y, deltaX, deltaY)
survSpearman(X, Y, deltaX, deltaY, tauX = 100, tauY = 100)
survSpearman(X, Y, deltaX, deltaY, tauX = 100, tauY = 0.99)
survSpearman(X, Y, deltaX, deltaY, tauX = 0.8, tauY = 0.99)

### Compute correlation from survival surface
someSurf <- survDabrowska(X, Y, deltaX, deltaY)$DabrowskaEst
survSpearman(tauY = 0.9, bivarSurf = someSurf)


SvetlanaEden/survSpearman documentation built on Sept. 30, 2022, 3:47 p.m.