alogitlink.RdComputes some arcsine–logit mixture link transformations, including their inverse and the first few derivatives.
Numeric or character. See below for further details.
See Links.
Numeric, of length 1.
Mixing parameter assigned
to logitlink. Then
1 - exp(-taumix.log * theta) is used
to weight
asinlink.
Thus a 0 value will result in
logitlink
and a very large numeric such as 1e4
should be roughly equivalent to
asinlink over almost all
of the parameter space.
Numeric, of length 1.
Mixing probability assigned
to logitlink. Then
1 - pmix.logit is used to weight
asinlink.
Thus a 0 value will result in
asinlink.
and 1 is equivalent to logitlink.
Arguments fed into a function implementing a vectorized bisection method.
Details at Links.
The following holds for the LC variant.
For deriv >= 0,
(1 - pmix.logit) * asinlink(p, deriv = deriv)
+ pmix.logit * logitlink(p, deriv = deriv)
when inverse = FALSE,
and if inverse = TRUE then a nonlinear
equation is solved for the probability,
given
eta.
For deriv = 1, then the function
returns d eta / d
theta as a function of theta if
inverse = FALSE, else if inverse
= TRUE then it returns the reciprocal.
Hauck, J. W. W. and A. Donner (1977). Wald's test as applied to hypotheses in logit analysis. Journal of the American Statistical Association, 72, 851–853.
The default values for taumix.logit
and pmix.logit
may change in the future.
The name and order of the arguments
may change too.
p <- seq(0.01, 0.99, length= 10)
alogitlink(p)
#> [1] -4.5768539 -1.9761899 -1.2097002 -0.6756555 -0.2185496 0.2185496
#> [7] 0.6756555 1.2097002 1.9761899 4.5768539
max(abs(alogitlink(alogitlink(p), inv = TRUE) - p)) # 0?
#> [1] 4.774826e-14
if (FALSE) { # \dontrun{
par(mfrow = c(2, 2), lwd = (mylwd <- 2))
y <- seq(-4, 4, length = 100)
p <- seq(0.01, 0.99, by = 0.01)
for (d in 0:1) {
matplot(p, cbind(logitlink(p, deriv = d), probitlink(p, deriv = d)),
type = "n", col = "blue", ylab = "transformation",
las = 1, main = if (d == 0) "Some probability link functions"
else "First derivative")
lines(p, logitlink(p, deriv = d), col = "green")
lines(p, probitlink(p, deriv = d), col = "blue")
lines(p, clogloglink(p, deriv = d), col = "tan")
lines(p, alogitlink(p, deriv = d), col = "red3")
if (d == 0) {
abline(v = 0.5, h = 0, lty = "dashed")
legend(0, 4.5, c("logitlink", "probitlink", "clogloglink",
"alogitlink"), lwd = mylwd,
col = c("green", "blue", "tan", "red3"))
} else
abline(v = 0.5, lwd = 0.5, col = "gray")
}
for (d in 0) {
matplot(y, cbind( logitlink(y, deriv = d, inverse = TRUE),
probitlink(y, deriv = d, inverse = TRUE)),
type = "n", col = "blue", xlab = "transformation", ylab = "p",
main = if (d == 0) "Some inverse probability link functions"
else "First derivative", las=1)
lines(y, logitlink(y, deriv = d, inverse = TRUE), col = "green")
lines(y, probitlink(y, deriv = d, inverse = TRUE), col = "blue")
lines(y, clogloglink(y, deriv = d, inverse = TRUE), col = "tan")
lines(y, alogitlink(y, deriv = d, inverse = TRUE), col = "red3")
if (d == 0) {
abline(h = 0.5, v = 0, lwd = 0.5, col = "gray")
legend(-4, 1, c("logitlink", "probitlink", "clogloglink",
"alogitlink"), lwd = mylwd,
col = c("green", "blue", "tan", "red3"))
}
}
par(lwd = 1)
} # }