funsExpTk | R Documentation |

Two functions: `EV.Tk`

and `EV.Tkaij`

.

Both functions compute the expected value of Cuzick and Edwards *T_k* test statistic based on the number of cases
within `k`

NNs of the cases in the data under RL or CSR independence.

The number of cases are denoted as *n_1* (denoted as `n1`

as an argument)
for both functions and number of controls as *n_0* (denoted as `n0`

as an argument) in `EV.Tk`

,
to match the case-control class labeling,
which is just the reverse of the labeling in \insertCitecuzick:1990;textualnnspat.

The function `EV.Tkaij`

uses Toshiro Tango's moments formulas based on the *A=(a_{ij})* matrix
(and is equivalent to the function `EV.Tk`

, see \insertCitetango:2007;textualnnspat,
where *a_{ij}(k) = 1* if *z_j* is among the `k`

NNs of *z_i* and 0 otherwise.

See also (\insertCiteceyhan:SiM-seg-ind2014;textualnnspat).

EV.Tk(k, n1, n0) EV.Tkaij(k, n1, a)

`k` |
Integer specifying the number of NNs (of subject |

`n1, n0` |
The number of cases and controls, |

`a` |
The |

The expected value of Cuzick and Edwards *T_k* test statistic for disease clustering

Elvan Ceyhan

`ceTk`

and `EV.Tcomb`

n1<-20 n0<-25 k<-1 #try also 3, 5, sample(1:5,1) EV.Tk(k,n1,n0) ### n<-20 #or try sample(1:20,1) Y<-matrix(runif(3*n),ncol=3) cls<-sample(0:1,n,replace = TRUE) n1<-sum(cls==1) n0<-sum(cls==0) a<-aij.mat(Y,k) EV.Tk(k,n1,n0) EV.Tkaij(k,n1,a)

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.