Takes in a square matrix of counts and outputs
them in a form that is accessible to the brat
and bratt
family functions.
Brat(mat, ties = 0 * mat, string = c(">", "=="), whitespace = FALSE)
Matrix of counts, which is considered
Matrix of counts.
This should be the same dimension as mat
. By
default, there are no ties. The matrix must be symmetric,
and the diagonal should contain NA
s.
Character.
The matrices are labelled with the first value of the
descriptor, e.g., "NZ > Oz"
`means' NZ beats
Australia in rugby. Suggested alternatives include
" beats "
or " wins against "
. The second value
is used to handle ties.
Logical. If TRUE
then a white space is added before
and after string
; it generally enhances readability.
See CommonVGAMffArguments
for some similar-type
information.
A matrix with 1 row and either
In the VGAM package it is necessary for each
matrix to be represented as a single row of data by
brat
and bratt
. Hence the
non-diagonal elements of the
Agresti, A. (2013) Categorical Data Analysis, 3rd ed. Hoboken, NJ, USA: Wiley.
# NOT RUN {
journal <- c("Biometrika", "Comm Statist", "JASA", "JRSS-B")
mat <- matrix(c( NA, 33, 320, 284, 730, NA, 813, 276,
498, 68, NA, 325, 221, 17, 142, NA), 4, 4)
dimnames(mat) <- list(winner = journal, loser = journal)
Brat(mat) # Less readable
Brat(mat, whitespace = TRUE) # More readable
vglm(Brat(mat, whitespace = TRUE) ~ 1, brat, trace = TRUE)
# }
Run the code above in your browser using DataLab