c2compnames: Define row names of a contrast matrix, depending on its...

Description Usage Arguments Value See Also Examples

Description

Define row names of a contrast matrix, depending on its column names, as can be necessary for contrasts matrices. Currently, two options to do that are available.

Usage

1
c2compnames(cmat, ntype = "aggr")

Arguments

cmat

a contrast matrix

ntype

a single character string, defining how to build names from the column names of cmat, currently onls "aggr" (aggregates names of groups with negative and positive coefficients), and "sequ"

Value

The input matrix cmat, with its row names replaced.

See Also

contrMat in multcomp to define contrast matrices of different types

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
25
26
27
28
29
30
31
32
33
34
35
36
# names for interaction contrasts:

n1<-c(10,10,10,10)
names(n1)<-c("A","B","C","D")

n2<-c(3,3,3)
names(n2)<-c(1,2,3)

library(multcomp)

CMT1<-contrMat(n1, type="Tukey")

CMT2<-contrMat(n2, type="Tukey")

IAC<-IAcontrastsCMAT(CMAT1=CMT1, CMAT2=CMT2)

c2compnames(IAC, ntype="aggr")

c2compnames(IAC, ntype="sequ")


###############################

# names for Williams-type contrasts:

n1<-c(10,10,10,10)
names(n1)<-c("C0","D1","D5","D10")


CMW<-contrMat(n1, type="Williams")

CMW

c2compnames(CMW, ntype="aggr")

c2compnames(CMW, ntype="sequ")

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

Related to c2compnames in BSagri...