Description Usage Arguments Value Author(s) References See Also Examples

This function computes Cuzick and Edwards *T_k^{inv}* test statistic based on the sum of number of cases closer to
each case than the `k`

-th nearest control to the case.

*T_k^{inv}* test statistic is an extension of the run length test allowing a fixed number of controls in the run
sequence.

*T_k^{inv}* test statistic is defined as *T_k^{inv}=∑_{i=1}^n δ_i ν_i^k* where *δ_i=1*
if *z_i* is a case, and 0 if *z_i* is a control and *ν_i^k* is the number of cases closer
to the index case than the `k`

nearest control, i.e., number of cases encountered beginning
at *z_i* until `k`

-th control is encountered.

The argument `cc.lab`

is case-control label, 1 for case, 0 for control, if the argument `case.lab`

is `NULL`

,
then `cc.lab`

should be provided in this fashion, if `case.lab`

is provided, the labels are converted to 0's and 1's
accordingly.

1 |

`dat` |
The data set in one or higher dimensions, each row corresponds to a data point. |

`k` |
Integer specifying the number of the closest controls to subject |

`cc.lab` |
Case-control labels, 1 for case, 0 for control |

`case.lab` |
The label used for cases in the |

`...` |
are for further arguments, such as |

A `list`

with two elements

`Tkinv` |
Cuzick and Edwards |

`run.vec` |
The |

Elvan Ceyhan

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
n<-20
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(0:1,n,replace = TRUE) #or try cls<-rep(0:1,c(10,10))
cls
k<-2 #also try 3,4
ceTkinv(Y,k,cls)
ceTkinv(Y,k,cls+1,case.lab = 2)
ceTkinv(Y,k,cls,method="max")
ceTrun(Y,cls)
ceTkinv(Y,k=1,cls)
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
ceTkinv(Y,k,fcls,case.lab="a") #try also ceTrun(Y,fcls)
#############
n<-40
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(1:4,n,replace = TRUE) #here ceTkinv(Y,k,cls) #gives error
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.