View source: R/detect_sepcols.R
| detect_sepcols_bcl | R Documentation |
This function identifies the columns in a design matrix for a baseline-category link model that have an infinite MLE, due to separation. Note this is due to separation which includes the case of a design matrix that doesn't have full rank.
detect_sepcols_bcl(
y,
X,
rational = FALSE,
backend = c("rcdd", "ROI"),
solver = NULL
)
sepcols_bcl(y, X, rational = FALSE, backend = c("rcdd", "ROI"), solver = NULL)
y |
the outcome variable. Can be factor, numeric, character or boolean. Works best if it is a factor because then we keep specified reference caetgory, else we use the alphanumerically lowest value. |
X |
a design matrix, e.g. generated via a call to 'model.matrix'. This means we expect that X already contains the desired contrasts for factors (e.g., dummies) and any other expanded columns (e.g., for polynomials). |
rational |
should rational arithmetic be used. |
backend |
which backend to use for the linear program. Can be "rcdd" (default and only option for rational=TRUE) or "ROI". |
solver |
the solver to be used in the backend. Defaults to "DualSimplex" for "rcdd" and the first LP solver returned by 'ROI_applicable_solver()' for "ROI". |
We solve a linear program in this function that operates only on y and X, so without a specific model. This program corresponds to detecting which columns in the design matrix leads to infinite MLE for some link functions, but it is more general as there are links that can still give finite estimates even though there is separation. Hence this function detects separation even in the case of (seemingly) finite estimates or if there is no warning. The prime example is using the log link in logistic regression.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.