Learn R Programming

nnspat (version 0.1.2)

EV.Tcomb: Expected Value for Cuzick & Edwards \(T_{comb}\) Test Statistic

Description

This function computes the expected value of Cuzick & Edwards \(T_{comb}\) test statistic in disease clustering, where \(T_{comb}\) is a linear combination of some \(T_k\) tests.

The argument, \(n_1\), is the number of cases (denoted as n1 as an argument). The number of cases is denoted as \(n_1\) to match the case-control class labeling, which is just the reverse of the labeling in cuzick:1990;textualnnspat.

The argument klist is the vector of integers specifying the indices of the \(T_k\) values used in obtaining the \(T_{comb}\).

The argument sig is the covariance matrix of the vector of \(T_k\) values used in Tcomb, and can be computed via the the covTcomb function.

See page 87 of (cuzick:1990;textualnnspat) for more details.

Usage

EV.Tcomb(n1, n, klist, sig)

Value

Returns the expected value of the \(T_{comb}\) test statistic

Arguments

n1

Number of cases

n

A positive integer representing the number of points in the data set

klist

list of integers specifying the indices of the \(T_k\) values used in obtaining the \(T_{comb}\).

sig

The covariance matrix of the vector of \(T_k\) values used in Tcomb

Author

Elvan Ceyhan

References

See Also

Tcomb, and ZTcomb

Examples

Run this code
n<-20  #or try sample(1:20,1) #try also n<-50, 100
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(0:1,n,replace = TRUE)  #or try cls<-rep(0:1,c(10,10))
n1<-sum(cls==1)

kl<-sample(1:5,3) #try also sample(1:5,2)
kl
sig<-covTcomb(Y,n1,kl)
EV.Tcomb(n1,n,kl,sig)

Run the code above in your browser using DataLab