EV.rct: Expected Values of the Cell Counts in RCT

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

View source: R/NNCTFunctions.r

Description

Returns a matrix of same dimension as the RCT, rfct, whose entries are the expected cell counts of the RCT under RL or CSR.

See also (\insertCiteceyhan:NNreflexivity2017;textualnnspat).

Usage

1
EV.rct(rfct, nvec)

Arguments

rfct

An RCT

nvec

The vector of class sizes

Value

A matrix of the expected values of cell counts in the RCT.

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

rct, EV.nnct and EV.tct

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
n<-20  #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(1:2,n,replace = TRUE)  #or try cls<-rep(1:2,c(10,10))
ipd<-ipd.mat(Y)

nvec<-as.numeric(table(cls))
rfct<-rct(ipd,cls)
EV.rct(rfct,nvec)

#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
nvec<-as.numeric(table(fcls))
rfct<-rct(ipd,fcls)
EV.rct(rfct,nvec)

#############
n<-40
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(1:4,n,replace = TRUE)  #or try cls<-rep(1:2,c(10,10))
ipd<-ipd.mat(Y)

rfct<-rct(ipd,cls)
EV.rct(rfct,nvec)

nnspat documentation built on May 10, 2021, 9:06 a.m.