check_infinite_estimates.glm: A simple diagnostic of whether the maximum likelihood...

Description Usage Arguments Details Note References See Also Examples

View source: R/check_infinite_estimates.R

Description

A simple diagnostic of whether the maximum likelihood estimates are infinite

Usage

1
2
## S3 method for class 'glm'
check_infinite_estimates(object, nsteps = 20, ...)

Arguments

object

the result of a glm call.

nsteps

starting from maxit = 1, the GLM is refitted for maxit = 2, maxit = 3, ..., maxit = nsteps. Default value is 30.

...

currently not used.

Details

check_infinite_estimates attempts to identify the occurrence of infinite estimates in GLMs with binomial responses by successively refitting the model. At each iteration the maximum number of allowed IWLS iterations is fixed starting from 1 to nsteps (by setting control = glm.control(maxit = j), where j takes values 1, ..., nsteps in glm). For each value of maxit, the estimated asymptotic standard errors are divided to the corresponding ones from control = glm.control(maxit = 1). Then, based on the results in Lesaffre & Albert (1989), if the sequence of ratios in any column of the resultant matrix diverges, then complete or quasi-complete separation occurs and the maximum likelihood estimate for the corresponding parameter has value minus or plus infinity.

Note

check_infinite_estimates will be removed from brglm2 at version 0.8. An new version of check_infinite_estimates is now maintained in the detectseparation R package at https://cran.r-project.org/package=detectseparation. In order to use the version in detect_separation load first brglm2 and then detectseparation, i.e. library(brglm2); library(detectseparation).

References

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

Lesaffre E, Albert A (1989). Partial Separation in Logistic Discrimination. *Journal of the Royal Statistical Society. Series B (Methodological)*, **51**, 109-116 doi: 10.1111/j.2517-6161.1989.tb01752.x

See Also

multinom, brmultinom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## endometrial data from Heinze \& Schemper (2002) (see ?endometrial)
data("endometrial", package = "brglm2")
endometrialML <- glm(HG ~ NV + PI + EH, data = endometrial,
                     family = binomial("probit"))
## clearly the maximum likelihood estimate for the coefficient of
## NV is infinite
check_infinite_estimates(endometrialML)

## Not run: 
## Aligator data (Agresti, 2002, Table~7.1)
data("alligator", package = "brglm2")
all_ml <- brmultinom(foodchoice ~ size + lake , weights = round(freq/3),
                     data = alligators, type = "ML", ref = 1)
## Clearly some estimated standard errors diverge as the number of
## Fisher scoring iterations increases
matplot(check_infinite_estimates(all_ml), type = "l", lty = 1,
        ylim = c(0.5, 1.5))

## End(Not run)

ikosmidis/brglm2 documentation built on Feb. 10, 2021, 3:27 a.m.