Learn R Programming

VGAM (version 1.1-14)

copsd: Centre of the Parameter Space Distance

Description

Returns a distance measure for how far regression coefficients are from the parameter space interior, so that warning can be given if they are too close to the parameter space boundary, for a fitted VGLM.

Usage

copsd(object, ...)
copsdvglm(object, doffset = 0.1, ...)

Value

A named vector, similar to coefvlm.

Arguments

object

A vglm object, e.g., representing a logistic regression.

doffset

Numeric, positive and of unit length. Called the denominator offset.

...

fed into copsvglm.

Author

Thomas W. Yee.

Details

The values returned by this function can be thought of as scaled distances. They are diagnostic for assessing whether there are boundary problems in the regression. The model must have a Centre of the Parameter Space (COPS) in the interior, e.g., it excludes ordinary Poisson regression. If the computed COPS is too large, relative to the regression coefficient, in that is indicative of there being boundary problems. A value of 5 is recommended for concluding that statistical inference is fraught. Higher values indicate a worsening problem. Common reasons for trouble are linearly separable problems and outliers.

An S3 version of this function is available, called copsd3.glm, because the convergence criteria for vglm and glm differ. The latter iterates closer to the parameter space boundary in general, so the COPSDs can be higher.

The COPSD is probably a better alternative to the WSDM. Both should ideally be used to assess a fitted model.

References

Yee, T. W. (2025). Mapping the parameter space by the WSDM function: A diagnostic for logistic regression and beyond. In preparation.

See Also

cops, wsdm, binomialff, multinomial, hdeff, coefvlm, coef, fbeetle.

Examples

Run this code
if (FALSE)    # Example 1: flour beetles
copsd3(glm(cbind(dead, n-dead) ~ logdose, binomial  , fbeetle))
copsd(vglm(cbind(dead, n-dead) ~ logdose, binomialff, fbeetle))

# Example 2: quasi-separation
Nmax <-  25
data1 <- data.frame(y = c(rep(0, Nmax), 1, rep(1, Nmax-1)),
   x = c(seq(0, 0.5, len = Nmax), seq(0.5, 1, len = Nmax)))
copsd3(glm(y ~ x, binomial, data1, maxit = 3, tr = TRUE))  # OK
copsd3(glm(y ~ x, binomial, data1, tr = TRUE))  # Not OK

Run the code above in your browser using DataLab