gower.agree {goweragreement} | R Documentation |
Apply the Bayesian Gower agreement methodology to nominal or ordinal data.
Description
Apply the Bayesian Gower agreement methodology to nominal or ordinal data.
Usage
gower.agree(
data,
data.type = c("nominal", "ordinal"),
dist.type = c("mean", "max"),
design = c("one-way", "two-way"),
iter = 10000,
...
)
Arguments
data |
a matrix of scores. Each row corresponds to a unit, each column to a coder. |
data.type |
the type of scores to be analyzed, either |
dist.type |
for ordinal data, whether the row statistics are computed using the mean of the pairwise distances or the maximum pairwise distance. |
design |
the sampling design, either |
iter |
the desired size of the posterior sample. The default value is 10,000. |
... |
additional arguments for the distance function. These are ignored for nominal data. For ordinal data the range of the scores must be provided via argument |
Details
This is the package's flagship function. It applies the Bayesian Gower methodology to nominal or ordinal data, and provides an estimate of the posterior mean along with a credible interval.
Value
Function gower.agree
returns an object of class "gower"
, which is a list comprising the following elements.
mu.hat |
the estimate of the posterior mean. |
mu.sample |
the posterior sample. |
call |
the matched call. |
units |
the number of units. |
coders |
the number of coders. |
data |
the data matrix, sans rows that were removed due to missigness. |
data.type |
the type of scores, nominal or ordinal. |
dist.type |
for ordinal data, the manner in which the row statistics were computed. |
design |
the sampling design, one-way or two-way. |
row.stats |
the vector of row statistics. |
del |
the number of rows that were deleted due to missingness. |
Examples
# Fit the liver data, using the mean distance for each row of the data matrix.
# The range (which is equal to 4) must be passed to \code{\link{gower.agree}}
# since these data are ordinal and the L1 distance function is used. We assume
# a one-way sampling design for these data, i.e., units are random and coders
# are fixed.
data(liver)
liver = as.matrix(liver)
fit = gower.agree(liver, data.type = "ordinal", range = 4)
summary(fit)