CCRatio.default: Compute ratio contrasts of chains of joint empirical...

Description Usage Arguments Details Examples

Description

Compute ratio contrasts of chains of joint empirical distributions. For internal use.

Usage

1
CCRatio.default(x, cmat)

Arguments

x

an N times K matrix with numeric entries

cmat

a list with entries numC and denC, each containing a contrast matrix with K columns (must be the same K as in x!) and M rows (is your choice, the number of contrasts of interest)

Details

Denote the elements of x by x[n,k]. Denote the numetator of cmat by C with elements c[m,k] and the denominator of cmat as D with elements d[m,k]. Function CCRatio.default simply calculates

sum(k=1,..,K; m; n)(c[m,k]*x[n,k]) / sum(k=1,..,K; m; n)(d[m,k]*x[n,k])

for each m=1,...,M and n=1,...,N. The result is a N times M matrix.

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
X<-round(cbind(
 rnorm(10,1,1),
 rnorm(10,1,1),
 rnorm(10,1,1),
 rnorm(10,1,1)))

# and numerator and denominator
# x times 4 contrast matrix

NMAT<-rbind(
c(1,0,0,0),
c(1,0,0,0),
c(1,0,0,0)
)


DMAT<-rbind(
c(0,1,0,0),
c(0,0,1,0),
c(0,0,0,1)
)


CCRatio.default(x=X, cmat=list(numC=NMAT, denC=DMAT) )

BSagri documentation built on May 2, 2019, 8:29 a.m.