| cobot | R Documentation |
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.
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
)
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. |
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)
object of ‘cobot’ class.
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
Formula, as.data.frame
## The code is commented out because it will give a Fortran 90 runtime
## error due to the outdated version of Fortran 90 on CRAN's Debian test
## environment (11/2025).
#data(PResidData)
#cobot(x|y~z, data=PResidData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.