funsExpTk {nnspat} | R Documentation |
Expected Value for Cuzick and Edwards T_k
Test statistic
Description
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 Cuzick and Edwards (1990).
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 Tango (2007),
where a_{ij}(k) = 1
if z_j
is among the k
NNs of z_i
and 0 otherwise.
See also (Ceyhan (2014)).
Usage
EV.Tk(k, n1, n0)
EV.Tkaij(k, n1, a)
Arguments
k |
Integer specifying the number of NNs (of subject |
n1 , n0 |
The number of cases and controls, |
a |
The |
Value
The expected value of Cuzick and Edwards T_k
test statistic for disease clustering
Author(s)
Elvan Ceyhan
References
Ceyhan E (2014).
“Segregation indices for disease clustering.”
Statistics in Medicine, 33(10), 1662-1684.
Cuzick J, Edwards R (1990).
“Spatial clustering for inhomogeneous populations (with discussion).”
Journal of the Royal Statistical Society, Series B, 52, 73-104.
Tango T (2007).
“A class of multiplicity adjusted tests for spatial clustering based on case-control point data.”
Biometrics, 63, 119-127.
See Also
Examples
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)