sklars.omega.bayes | R Documentation |
Do Bayesian inference for Sklar's Omega.
sklars.omega.bayes(
data,
level = c("amount", "balance", "percentage"),
verbose = FALSE,
control = list()
)
data |
a matrix of scores. Each row corresponds to a unit, each column a coder. The columns must be named appropriately so that the correct copula correlation matrix can be constructed. See |
level |
the level of measurement, either |
verbose |
logical; if TRUE, various messages are printed to the console. |
control |
a list of control parameters.
|
This function does MCMC for Bayesian inference for continuous scores.
Control parameter dist
must be used to select a marginal distribution from among "gaussian"
, "laplace"
, "t"
, and "gamma"
(for balances or amounts), or from among "beta"
or "kumaraswamy"
(for percentages).
Details regarding prior distributions and sampling are provided in the package vignette.
Function sklars.omega.bayes
returns an object of class "sklarsomega"
, which is a list comprising the following elements.
accept |
a vector of acceptance rates. |
DIC |
the value of DIC for the fit. |
call |
the matched call. |
coefficients |
a named vector of parameter estimates. |
control |
the list of control parameters. |
data |
the matrix of scores, perhaps altered to remove rows (units) containing fewer than two scores. |
iter |
the number of posterior samples that were drawn. |
level |
the level of measurement. |
mcse |
a vector of Monte Carlo standard errors. |
method |
always equal to |
mpar |
the number of marginal parameters. |
npar |
the total number of parameters. |
R |
the initial value of the copula correlation matrix. |
R.hat |
the estimated value of the copula correlation matrix. |
residuals |
the residuals. |
root.R.hat |
a square root of the estimated copula correlation matrix. This is used for simulation and to compute the residuals. |
samples |
the posterior samples. |
verbose |
the value of argument |
y |
the scores as a vector, perhaps altered to remove rows (units) containing fewer than two scores. |
Hughes, J. (2018). Sklar's Omega: A Gaussian copula-based framework for assessing agreement. ArXiv e-prints, March.
Nissi, M. J., Mortazavi, S., Hughes, J., Morgan, P., and Ellermann, J. (2015). T2* relaxation time of acetabular and femoral cartilage with and without intra-articular Gd-DTPA2 in patients with femoroacetabular impingement. American Journal of Roentgenology, 204(6), W695.
# Fit a subset of the cartilage data, assuming a Laplace marginal distribution. Compute
# 95% HPD intervals. Show the acceptance rates for the three parameters.
data(cartilage)
data = as.matrix(cartilage)[1:100, ]
colnames(data) = c("c.1.1", "c.2.1")
set.seed(111111)
fit1 = sklars.omega.bayes(data, level = "balance", verbose = FALSE,
control = list(dist = "laplace", minit = 1000, maxit = 5000, tol = 0.01,
sigma.1 = 1, sigma.2 = 0.1, sigma.omega = 0.2))
summary(fit1)
fit1$accept
# Now assume a noncentral t marginal distribution.
set.seed(4565)
fit2 = sklars.omega.bayes(data, level = "balance", verbose = FALSE,
control = list(dist = "t", minit = 1000, maxit = 5000, tol = 0.01,
sigma.1 = 0.2, sigma.2 = 2, sigma.omega = 0.2))
summary(fit2)
fit2$accept
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.