detect_infinite_estimates: Detect Infinite Estimates

View source: R/detect_infinite_estimates.R

detect_infinite_estimatesR Documentation

Detect Infinite Estimates

Description

Method for glm that detects infinite components in the maximum likelihood estimates of generalized linear models with binomial responses.

Usage

detect_infinite_estimates(
  x,
  y,
  weights = NULL,
  start = NULL,
  etastart = NULL,
  mustart = NULL,
  offset = NULL,
  family = gaussian(),
  control = list(),
  intercept = TRUE,
  singular.ok = TRUE
)

detectInfiniteEstimates(
  x,
  y,
  weights = NULL,
  start = NULL,
  etastart = NULL,
  mustart = NULL,
  offset = NULL,
  family = gaussian(),
  control = list(),
  intercept = TRUE,
  singular.ok = TRUE
)

Arguments

x

x is a design matrix of dimension n * p.

y

y is a vector of observations of length n.

weights

an optional vector of ‘prior weights’ to be used in the fitting process. Should be NULL or a numeric vector.

start

currently not used.

etastart

currently not used.

mustart

currently not used.

offset

this can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector of length equal to the number of cases. One or more offset terms can be included in the formula instead or as well, and if more than one is specified their sum is used. See model.offset.

family

a description of the error distribution and link function to be used in the model. For glm this can be a character string naming a family function, a family function or the result of a call to a family function. For glm.fit only the third option is supported. (See family for details of family functions.)

control

a list of parameters controlling separation detection. See detect_separation_control for details.

intercept

logical. Should an intercept be included in the null model?

singular.ok

logical. If FALSE, a singular model is an error.

Details

For binomial-response generalized linear models with "log" link, separated data allocations do not necessarily lead to infinite maximum likelihood estimates. For this reason, for models with the "log" link detect_infinite_estimates() relies on an alternative linear optimization model developed in Schwendinger et al. (2021), and for all the other supported links it relies on the linear programming methods developed in Konis (2007). See detect_separation() for definitions and details.

detect_infinite_estimates() is a wrapper to the functions separator_ROI(), separator_lpSolveAPI() (a modified version of the separator() function from the **safeBinaryRegression** R package), and dielb_ROI().

The coefficients() method extracts a vector of values for each of the model parameters under the following convention: 0 if the maximum likelihood estimate of the parameter is finite, and Inf or -Inf if the maximum likelihood estimate of the parameter if plus or minus infinity. This convention makes it easy to adjust the maximum likelihood estimates to their actual values by element-wise addition.

detect_infinite_estimates() can be passed directly as a method to the glm function. See, examples.

detectInfiniteEstimates() is an alias for detect_infinite_estimates().

Author(s)

Ioannis Kosmidis [aut, cre] ioannis.kosmidis@warwick.ac.uk, Florian Schwendinger [aut] FlorianSchwendinger@gmx.at, Dirk Schumacher [aut] mail@dirk-schumacher.net, Kjell Konis [ctb] kjell.konis@me.com

References

Silvapulle, M. J. (1981). On the Existence of Maximum Likelihood Estimators for the Binomial Response Models. Journal of the Royal Statistical Society. Series B (Methodological), 43(3), 310–313. https://www.jstor.org/stable/2984941

Konis K. (2007). *Linear Programming Algorithms for Detecting Separated Data in Binary Logistic Regression Models*. DPhil. University of Oxford. https://ora.ox.ac.uk/objects/uuid:8f9ee0d0-d78e-4101-9ab4-f9cbceed2a2a

Konis K. (2013). safeBinaryRegression: Safe Binary Regression. R package version 0.1-3. https://CRAN.R-project.org/package=safeBinaryRegression

Kosmidis I. and Firth D. (2021). Jeffreys-prior penalty, finiteness and shrinkage in binomial-response generalized linear models. *Biometrika*, **108**, 71–82. doi: 10.1093/biomet/asaa052

Schwendinger, F., Grün, B. & Hornik, K. (2021). A comparison of optimization solvers for log binomial regression including conic programming. *Computational Statistics*, **36**, 1721–1754. doi: 10.1007/s00180-021-01084-5

See Also

glm.fit and glm, detect_separation, check_infinite_estimates, brglm_fit

Examples

# The classical example given in Silvapulle (1981) can be utilized
# to show that for the Log-Binomial model there exist data allocations
# which are separated but produce finite estimates.
data("silvapulle1981", package = "detectseparation")

# Since the data is separated the MLE does not exist for the logit link.
glm(y ~ ghqs, data = silvapulle1981, family = binomial(),
    method = "detect_infinite_estimates")

# However, for the log link all components of the MLE are finite.
glm(y ~ ghqs, data = silvapulle1981, family = binomial("log"),
    method = "detect_infinite_estimates")
glm(y ~ ghqs, data = silvapulle1981, family = binomial("log"), start = c(-1, 0))


detectseparation documentation built on Aug. 27, 2022, 1:08 a.m.