| check_overlap | R Documentation |
This function checks for overlap by calling the appropriate low-level functions. It can be run with the linear program ('quick = FALSE', default), linear program 2 ('quick = TRUE'), on sequential subsets of data ('sequential = TRUE') or via multicore parallelization ('parallel = TRUE').
check_overlap(object, ...)
## Default S3 method:
check_overlap(object, ...)
## S3 method for class 'factor'
check_overlap(
object,
X,
rational = FALSE,
quick = FALSE,
sequential = FALSE,
parallel = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
nc = NULL,
nss = NULL,
...
)
## S3 method for class 'logical'
check_overlap(
object,
X,
rational = FALSE,
quick = FALSE,
sequential = FALSE,
parallel = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
nc = NULL,
nss = NULL,
...
)
## S3 method for class 'numeric'
check_overlap(
object,
X,
rational = FALSE,
quick = FALSE,
sequential = FALSE,
parallel = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
nc = NULL,
nss = NULL,
...
)
## S3 method for class 'integer'
check_overlap(
object,
X,
rational = FALSE,
quick = FALSE,
sequential = FALSE,
parallel = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
nc = NULL,
nss = NULL,
...
)
## S3 method for class 'character'
check_overlap(
object,
X,
rational = FALSE,
quick = FALSE,
sequential = FALSE,
parallel = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
nc = NULL,
nss = NULL,
...
)
## S3 method for class 'matrix'
check_overlap(
object,
rational = FALSE,
quick = FALSE,
sequential = FALSE,
parallel = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
nc = NULL,
nss = NULL,
...
)
## S3 method for class 'formula'
check_overlap(
object,
data,
model = NULL,
rational = FALSE,
contrasts = NULL,
quick = FALSE,
sequential = FALSE,
parallel = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
...
)
## S3 method for class 'osm'
check_overlap(
object,
rational = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
quick = FALSE,
parallel = FALSE,
sequential = FALSE,
nss = NULL,
nc = NULL,
...
)
## S3 method for class 'clm'
check_overlap(
object,
rational = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
quick = FALSE,
parallel = FALSE,
sequential = FALSE,
nss = NULL,
nc = NULL,
...
)
## S3 method for class 'polr'
check_overlap(
object,
rational = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
quick = FALSE,
parallel = FALSE,
sequential = FALSE,
nss = NULL,
nc = NULL,
...
)
## S3 method for class 'multinom'
check_overlap(
object,
rational = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
quick = FALSE,
parallel = FALSE,
sequential = FALSE,
nss = NULL,
nc = NULL,
...
)
## S3 method for class 'glm'
check_overlap(
object,
rational = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
quick = FALSE,
parallel = FALSE,
sequential = FALSE,
nss = NULL,
nc = NULL,
...
)
## S3 method for class 'bracl'
check_overlap(
object,
rational = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
quick = FALSE,
parallel = FALSE,
sequential = FALSE,
nss = NULL,
nc = NULL,
...
)
## S3 method for class 'brmultinom'
check_overlap(
object,
rational = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL,
quick = FALSE,
parallel = parallel,
sequential = sequential,
nss = nss,
nc = nc,
...
)
object |
an R object. Supported inputs:
|
... |
additional arguments to be passed to other functions (e.g. to mclappy in parallel execution) |
X |
a design matrix, e.g. generated via a call to
|
rational |
logical; should rational arithmetic be used? |
quick |
logical; if |
sequential |
conduct a sequential check on data subsets (default 'FALSE'). |
parallel |
conduct a check in parallel on data subsets via multicores (default 'FALSE'). |
backend |
character string specifying the backend for the linear
program. One of |
solver |
character string specifying the solver used by the
backend. Defaults to |
nc |
number of cores to be used for parallel execution. Defaults to 1. |
nss |
number of subsets for parallel or sequneital execution. Defaults to 'nc' for parallel and 10 for sequential. If nss is below 1 or above n-1, it uses 'nss = 1'. |
data |
either a standard data frame, list or environment (or object
coercible by Alternatively, |
model |
character string specifying the model class to be fitted. One of:
If missing or |
contrasts |
an optional list. See the |
check_overlap is an S3 generic function. For developers: If a method should be provided for the generic, it is best to have that method create a matrix of structure vectors S and use the low-level function check_overlap_worker with it.
The formula method is for standard data frames and formulas that
work the same way as when used with glm. It does
not support extended formulas, and may not work for functions that do
formula processing differently.
For a data frame or matrix given as rational numbers in the rcdd definition, this is recognized but the formula does not get expanded and is taken literally. Consequently:
variables in formula must match exactly with the column
names in data;
factors need to be converted to dummies beforehand (which would not be possible in the rational format in any other way anyway).
A logical, 'TRUE' is overlap is detected.
# pre fit
## Binary data
data(csepdat1)
outc<-csepdat1$y
desma<-cbind("(Intercept)"=1,csepdat1[,2:ncol(csepdat1)])
check_overlap(outc, X = desma, model = "b")
# Nominal data
# Baseline-category link
data(qcsepdatm)
check_overlap(y ~ x1 + x2, data = qcsepdatm, model = "bcl")
# Ordinal data
data(qcsepdato)
yo<-qcsepdato$y
Xo<-qcsepdato[,2:ncol(qcsepdato)]
# Sequential link
check_overlap(yo, Xo, model = "sl", rational = TRUE)
# Ordered stereotype
check_overlap(yo, Xo, model = "os", sequential = TRUE, nss =2)
# Adjacent-category link
check_overlap(yo, Xo, model= "acl", parallel = TRUE, nc = 1)
# Cumulative link
check_overlap(yo, Xo, model = "cl", quick = TRUE)
# post fit
m1 <- stats::glm(y~x1+x2,data=csepdat1,family=binomial())
check_overlap(m1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.