File: multcompTs.Rd

package info (click to toggle)
r-cran-multcompview 0.1-10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 268 kB
  • sloc: makefile: 2
file content (137 lines) | stat: -rw-r--r-- 4,928 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multcompTs.R
\name{multcompTs}
\alias{multcompTs}
\title{"T" depiction of undifferentiated classes}
\usage{
multcompTs(x, compare = "<", threshold = 0.05, sep = ".")
}
\arguments{
\item{x}{One of the following: (1) A square, symmetric matrix with row
names.  (2) A vector with hyphenated names, which identify individual items
or factor levels after "strsplit(..., '-')".  (3) An object of class "dist".

If x (or x[1]) is not already of class "logical", it is replaced with
do.call(compare, list(x, threshold)), which by default converts numbers
(typically p-values) less than 0.05 to TRUE and everything else to FALSE.
If x is a matrix, its diagonal must be or must convert to FALSE.}

\item{compare}{function or binary operator; not used if class(x) is
"logical".}

\item{threshold}{Second (reference) argument to "compare".}

\item{sep}{Concatenation character for names of objects with identical
similarity / dissimilarity patterns.  The output of multcompTs is matrix for
which the number of rows = (number of columns + number of uses of the "sep"
character).}
}
\value{
An object of class "multcompTs", which is a matrix of values -1, 0,
1, with one row for each level compared and one column for each "T", read as
follows: 1 = base of the "T" represented by that column, 0 = level(s) not
significantly different, and (-1) = levels(s) significantly different.  If
two or more levels have the same pattern of significant and insignificant
differences, they are combined into a single column that can be represented
by a "T" with multiple bases.  The column name will be a character string
concatenating all row names with "1" in that column separated by the "sep"
character.  Thus, the matrix should have as many 1's as it has rows.  Also,
the lower triangular portion should have as many "-1's" as there are "TRUE"
(e.g., significant) differences among the comparisons.
}
\description{
Convert a logical vector or a vector of p-values or a correlation or
distance matrix into a matrix with an associated visual display to show
whether the differences between items exceed a threshold.  Designed for use
with the output of functions like TukeyHSD, diststats, simint, simtest,
csimint, csimtestmultcomp, friedmanmc, kruskalmcpgirmess.
}
\details{
Produces a matrix of class "multcompTs", describing the "undifferentiated
classes" that identify the other factor levels or items that are not
distinct or not significantly different from the "base" of the "T"; if two
or more levels have the same pattern of significant differences, the two are
combined into one "T" with two "bases".  The resulting T's are similar to
the "undifferentiated classes" discussed by Donaghue (2004).
}
\examples{

##
## 0.  Conference presentation comparing Ts and Letters
##
dir(system.file('doc', package='multcompView'),
    pattern='\\\\.pdf$', full.name=TRUE)

##
## 1.  logical vector indicating different pairs
##
dif3 <- c(FALSE, FALSE, TRUE)
names(dif3) <- c("a-b", "a-c", "b-c")
multcompTs(dif3)

##
## 2.  numeric vector indicating statistical significance
##
dif4 <- c(.01, .02, .03, 1)
names(dif4) <- c("a-b", "a-c", "b-d", "a-d")
(diff4.T <- multcompTs(dif4))
plot(diff4.T)

##
## 3.  Distance matrix
##
dJudge <- dist(USJudgeRatings)
dJt <- multcompTs(dJudge, compare='>', threshold = median(dJudge))
# comparison of 43 judges;  compact but undecipherable:
plot(dJt, cex.axis=.5)

x <- array(1:9, dim=c(3,3),
   dimnames=list(LETTERS[1:3], NULL) )
d3 <- dist(x)
dxTs <- multcompTs(d3, compare=">", threshold=2)
plot(dxTs)

d3d <- dist(x, diag=TRUE)
dxdTs <- multcompTs(d3d, compare=">", threshold=2)

\dontshow{stopifnot(}
all.equal(dxTs, dxdTs)
\dontshow{)}

d3u <- dist(x, upper=TRUE)
dxuTs <- multcompTs(d3d, compare=">", threshold=2)

\dontshow{stopifnot(}
all.equal(dxTs, dxuTs)
\dontshow{)}

##
## 4.  cor matrix
##
set.seed(4)
x100 <- matrix(rnorm(100), ncol=5,
               dimnames=list(NULL, LETTERS[1:5]) )
cx <- cor(x100)
cxTs <- multcompTs(abs(cx), threshold=.3)
plot(cxTs)


}
\references{
John R. Donaghue (2004) "Implementing Shaffer's multiple
comparison procedure for a large number of groups", pp. 1-23 in Benjamini,
Bretz and Sarkar (eds) Recent Developments in Multiple Comparison Procedures
(Institute of Mathematical Statistics Lecture Notes-Monograph Series vol.
47)

Spencer Graves and Hans-Peter Piepho (2006) "Simple Visualizations of Paired
Comparisons", \href{../doc/VisualizingPairedComparisons.pdf}{\code{vignette("VisualizingPairedComparisons", package = "multcompView")}}
}
\seealso{
\code{\link{multcompBoxplot}} \code{\link{multcompLetters}}
\code{\link{plot.multcompTs}} \code{\link{vec2mat}} \code{\link{dist}}
}
\author{
Spencer Graves and Hans-Peter Piepho
}
\keyword{dplot}