sklars.omega: Apply Sklar's Omega.

View source: R/sklarsomega.R

sklars.omegaR Documentation

Apply Sklar's Omega.

Description

Apply Sklar's Omega.

Usage

sklars.omega(
  data,
  level = c("nominal", "ordinal", "count", "percentage", "amount", "balance"),
  confint = c("none", "bootstrap", "asymptotic"),
  verbose = FALSE,
  control = list()
)

Arguments

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 build.R for details regarding column naming.

level

the level of measurement, one of "nominal", "ordinal", "count", "amount", "balance", or "percentage".

confint

the method for computing confidence intervals, one of "none", "bootstrap", or "asymptotic".

verbose

logical; if TRUE, various messages may be printed to the console.

control

a list of control parameters.

bootit

the size of the (parametric) bootstrap sample. This applies when confint = "bootstrap" or when confint = "asymptotic" and level = "count". Defaults to 1,000.

dist

when level = "balance", one of "gaussian", "laplace", "t", or "empirical"; when level = "amount", one of "gamma" or "empirical"; when level = "percentage", one of "beta" or "kumaraswamy"; when level = "count", one of "poisson" or "negbinomial".

nodes

the desired number of nodes in the cluster.

parallel

logical; if TRUE (the default is FALSE), bootstrapping is done in parallel.

type

one of the supported cluster types for makeCluster. Defaults to "SOCK".

Details

This is the package's flagship function. It applies the Sklar's Omega methodology to nominal, ordinal, count, amount, balance, or percentage outcomes, and, if desired, produces confidence intervals. Parallel computing is supported, when applicable, and other measures (e.g., sparse matrix operations) are taken in the interest of computational efficiency.

If the level of measurement is nominal or ordinal, the scores (which must take values in 1, \dots , K) are assumed to share a common categorical marginal distribution. A composite marginal likelihood (CML) approach is used for categorical scores. Only parametric bootstrap intervals are supported for categorical outcomes since sandwich estimation tends to lead to inflated standard errors.

If the scores are counts, control parameter dist must be used to select a marginal distribution of "poisson" or "negbinomial". For counts a distributional transform (DT) approximation of the likelihood is employed. Either bootstrap or sandwich intervals are available: confint = "bootstrap" or confint = "asymptotic".

If the level of measurement is balance or amount or percentage, control parameter dist must be used to select a marginal distribution from among "gaussian", "laplace", "t", and "empirical"; or from among "gamma" and "empirical"; or from among "beta" or "kumaraswamy", respectively. The method of maximum likelihood (ML) is used unless dist = "empirical", in which case conditional maximum likelihood is used, i.e., the copula parameters are estimated conditional on the sample distribution function of the scores. For the ML method, both bootstrap and asymptotic confidence intervals are available. When dist = "empirical", only bootstrap intervals are available.

When applicable, functions of appropriate sample quantities are used as starting values for marginal parameters, regardless of the level of measurement.

Value

Function sklars.omega returns an object of class "sklarsomega", which is a list comprising the following elements.

AIC

the value of AIC for the fit, if level = "amount" or level = "balance" and dist != "empirical", or if level = "percentage".

BIC

the value of BIC for the fit, if level = "amount" or level = "balance" and dist != "empirical", or if level = "percentage".

boot.sample

when applicable, the bootstrap sample.

call

the matched call.

coefficients

a named vector of parameter estimates.

confint

the value of argument confint.

control

the list of control parameters.

convergence

unless optimization failed, the value of convergence returned by optim or hjkb.

cov.hat

if confint = "asymptotic", the estimate of the covariance matrix of the parameter estimator.

data

the matrix of scores, perhaps altered to remove rows (units) containing fewer than two scores.

iter

if optimization converged, the number of iterations required to optimize the objective function.

level

the level of measurement.

message

if applicable, the value of message returned by optim.

method

the approach to inference, one of "CML", "DT", "ML", or "SMP" (semiparametric).

mpar

the number of marginal parameters.

npar

the total number of parameters.

optim.method

the method used to optimize the objective function. The L-BFGS-B method is attempted first. If L-BFGS-B fails, a second attempt is made using the bounded Hooke-Jeeves algorithm.

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.

value

the minimum of the log objective function.

verbose

the value of argument verbose.

y

the scores as a vector, perhaps altered to remove rows (units) containing only one score.

References

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.

Examples

# Fit a subset of the cartilage data, assuming a Laplace marginal distribution. Compute
# confidence intervals in the usual ML way (observed information matrix).

data(cartilage)
data.cart = as.matrix(cartilage)[1:100, ]
colnames(data.cart) = c("c.1.1", "c.2.1")
fit.lap = sklars.omega(data.cart, level = "balance", confint = "asymptotic",
                       control = list(dist = "laplace"))
summary(fit.lap)

# Now assume a noncentral t marginal distribution.

fit.t = sklars.omega(data.cart, level = "balance", confint = "asymptotic",
                     control = list(dist = "t"))
summary(fit.t)

sklarsomega documentation built on April 4, 2023, 5:15 p.m.