Learn R Programming

VGAM (version 1.1-14)

hdeffsev0: Hauck-Donner Effect: Severity Measures

Description

Computes the severity of the Hauck-Donner effect for each regression coefficient of a fitted VGLM.

Usage

hdeffsev0(x, y, dy, ddy, allofit = FALSE, eta0 = 0, COPS0 = eta0,
          severity.table = c("None", "Faint", "Weak",
              "Moderate", "Strong", "Extreme", "Undetermined"))
hdeffsev2(x, y, dy, ddy, allofit = FALSE, ndepends = FALSE,
          eta0 = 0,
          severity.table = c("None", "Faint", "Weak",
              "Moderate", "Strong", "Extreme",
              "Undetermined")[if (ndepends) TRUE else
              c(1, 4, 6, 7)], tol0 = 0.1)

Arguments

Value

By default this function (hdeffsev0) returns a labelled vector with elements selected from

severity.table. If allofit = TRUE then Yee (2022) gives details about some of the other list components, e.g., a quantity called

zeta is the normal line projected onto the x-axis, and its first derivative gives additional information about the position of the estimate along the curve.

Details

Note: The function hdeffsev0 has a bug or two in it but they should be fixed later this year (2025). Instead, hdeffsev is recommended.

Function hdeffsev0 is currently rough-and-ready. It is possible to use the first two derivatives obtained from hdeff to categorize the severity of the the Hauck-Donner effect (HDE). It is effectively assumed that, starting at the origin and going right, the curve is made up of a convex segment followed by a concave segment and then the convex segment. Midway in the concave segment the first derivative is 0, and beyond that the HDE is really manifest because the derivative remains negative.

For "None" the estimate lies on the convex part of the curve near the origin, hence there is very little HDE at all.

For "Weak" the estimate lies on the concave part of the curve but the Wald statistic is still increasing as estimate gets away from 0, hence it is only a mild form of the HDE.

For "Moderate", "Strong" and "Extreme" the Wald statistic is decreasing as the estimate gets away from eta0, hence it really does exhibit the HDE. It is recommended that lrt.stat be used to compute LRT p-values, as they do not suffer from the HDE.

References

Yee, T. W. (2022). On the Hauck-Donner effect in Wald tests: Detection, tipping points and parameter space characterization, Journal of the American Statistical Association, 117, 1763--1774. tools:::Rd_expr_doi("10.1080/01621459.2021.1886936").

See Also

hdeffsev is recommended instead, seglines, hdeff, wsdm which is superior.

Examples

Run this code
deg <- 4  # myfun is a function that approximates the HDE
myfun <- function(x, deriv = 0) switch(as.character(deriv),
  '0' = x^deg * exp(-x),
  '1' = (deg * x^(deg-1) - x^deg) * exp(-x),
  '2' = (deg*(deg-1)*x^(deg-2) - 2*deg*x^(deg-1) + x^deg)*exp(-x))

xgrid <- seq(0, 10, length = 101)
ansm <- hdeffsev0(xgrid, myfun(xgrid), myfun(xgrid, deriv = 1),
                 myfun(xgrid, deriv = 2), allofit = TRUE)
digg <- 4
cbind(severity = ansm$sev, 
      fun      = round(myfun(xgrid), digg),
      deriv1   = round(myfun(xgrid, deriv = 1), digg),
      deriv2   = round(myfun(xgrid, deriv = 2), digg),
      zderiv1  = round(1 + (myfun(xgrid, deriv = 1))^2 +
                       myfun(xgrid, deriv = 2) * myfun(xgrid), digg))

Run the code above in your browser using DataLab