cobot {PResiduals} | R Documentation |
Conditional ordinal by ordinal tests for association.
Description
cobot
tests for independence between two ordered categorical
variables, X and Y conditional on other variables,
Z. The basic approach involves fitting models of X on
Z and Y on Z and determining whether there is any
remaining information between X and Y. This is done by
computing one of 3 test statistics. T1
compares empirical
distribution of X and Y with the joint fitted
distribution of X and Y under independence conditional
on Z. T2
computes the correlation between ordinal
(probability-scale) residuals from both models and tests the null
of no residual correlation. T3
evaluates the
concordance–disconcordance of data drawn from the joint fitted
distribution of X and Y under conditional independence
with the empirical distribution. Details are given in Li C and
Shepherd BE, Test of association between two ordinal variables
while adjusting for covariates. Journal of the American Statistical
Association 2010, 105:612-620.
Usage
cobot(
formula,
link = c("logit", "probit", "cloglog", "loglog", "cauchit"),
link.x = link,
link.y = link,
data,
subset,
na.action = na.fail,
fisher = TRUE,
conf.int = 0.95
)
Arguments
formula |
an object of class |
link |
The link family to be used for ordinal models of both X and Y. Defaults to ‘logit’. Other options are ‘probit’, ‘cloglog’,‘loglog’, and ‘cauchit’. |
link.x |
The link function to be used for a model of the first
ordered variable. Defaults to value of |
link.y |
The link function to be used for a model of the
second variable. Defaults to value of |
data |
an optional data frame, list or environment (or object
coercible by |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
na.action |
how |
fisher |
logical; if |
conf.int |
numeric specifying confidence interval coverage. |
Details
formula is specified as X | Y ~ Z
.
This indicates that models of X ~ Z
and
Y ~ Z
will be fit. The null hypothsis to be
tested is H_0 : X
independant of Y conditional
on Z.
Note that T2
can be thought of as an adjusted rank
correlation.(Li C and Shepherd BE, A new residual for ordinal
outcomes. Biometrika 2012; 99:473-480)
Value
object of ‘cobot’ class.
References
Li C and Shepherd BE, Test of association between two ordinal variables while adjusting for covariates. Journal of the American Statistical Association 2010, 105:612-620.
Li C and Shepherd BE, A new residual for ordinal outcomes. Biometrika 2012; 99:473-480
See Also
Examples
data(PResidData)
cobot(x|y~z, data=PResidData)