Learn R Programming

brglm2 (version 0.7.1)

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

Description

A simple diagnostic of whether the maximum likelihood estimates are infinite

Usage

# S3 method for 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.

References

Kosmidis I, Firth D (2020). Jeffreys-prior penalty, finiteness and shrinkage in binomial-response generalized linear models. *Biometrika* 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 10.1111/j.2517-6161.1989.tb01752.x

See Also

multinom, brmultinom

Examples

Run this code
# NOT RUN {
## 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))
# }

Run the code above in your browser using DataLab