koq |
## Kent & O'Quigley's measure of dependence for Cox's proportional hazards model. |

DESCRIPTION

Calculates Kent & O'Quigley's measure of dependence for censored data, when dependence between time and covariates is modelled by Cox's model.

`koq(beta1, x=NULL, p=NULL, verbose=T)`

beta1 |
coefficients from Cox proportional hazards model.
Can be a vector of coefficients or an object of class "coxph"
or "coxreg" from which coefficients will be taken. |

x |
the model matrix, i.e. the matrix with explanatory variables. Note:
x is required, if beta1 is not of class "coxph".
If beta1 is of class "coxph", x will
be taken from beta1. |

p |
explanatory variables to be used. Can be a vector
of indices, showing which columns from x are to be used. It can
be a logical vector (0/1 or F/T), where TRUE
(1/T) indicates variables to be used. In this case, the length
of p must be equal to the number of columns in x. Default:
use all variables from x. Example: c(1:3,5), c(1,1,1,0,1)
and c(T,T,T,F,T) are equivalent. |

verbose |
logical value. If TRUE, some intermediate results will be
printed. If FALSE, the function runs silently. |

Value of Kent & O'Quigley's measure is returned. It can be interpreted in a similar way as the usual R2 in linear models.

Measure does not depend on censoring, which is the most important property of any such measure for censored data. The measure can only be used with basic form of Cox's model. With time-dependent covariates the measure makes no sense, although running of the program will not depend on this. The measure could be used when stratified analysis is performed, but this version of the program will not accomodate such approach.

Kent JT, O'Quigley J. Measures of dependence for censored survival data.
*Biometrika* 1988; 75: 525-34.

Schemper M, Stare J. Explained variation in survival analysis. *Statistics
in Medicine* 1996; 15: 1999-2012.

`coxph, coxreg `

# Create a simple test data set

`test <- list(time = c(4, 3,1,1,2,2,3),
status = c(1,1,1,0,1,1,0),
x = c(0, 2,1,1,1,0,0),
gender = c(0, 0,0,0,1,1,1))`

# Fit Cox's model with x and gender

`cox_coxph( Surv(time, status) ~ x + gender, test)`

# Calculate dependence on both, x and gender

`koq(cox) `

# Calculate dependence on gender (second parameter in fitting formula)

`koq(cox,p=2)`