alogitlink | R Documentation |
Computes some arcsine–logit mixture link transformations, including their inverse and the first few derivatives.
alogitlink(theta, bvalue = NULL, taumix.logit = 1,
tol = 1e-13, nmax = 99, inverse = FALSE, deriv = 0,
short = TRUE, tag = FALSE, c10 = c(4, -pi))
lcalogitlink(theta, bvalue = NULL, pmix.logit = 0.01,
tol = 1e-13, nmax = 99, inverse = FALSE, deriv = 0,
short = TRUE, tag = FALSE, c10 = c(4, -pi))
theta |
Numeric or character. See below for further details. |
bvalue |
See |
taumix.logit |
Numeric, of length 1.
Mixing parameter assigned
to |
pmix.logit |
Numeric, of length 1.
Mixing probability assigned
to |
tol , nmax |
Arguments fed into a function implementing a vectorized bisection method. |
inverse , deriv , short , tag |
Details at |
c10 |
See |
lcalogitlink
is a
linear combination (LC) of
asinlink
and
logitlink
.
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.
The default values for taumix.logit
and pmix.logit
may change in the future.
The name and order of the arguments
may change too.
Thomas W. Yee
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.
asinlink
,
logitlink
,
Links
,
probitlink
,
clogloglink
,
cauchitlink
,
binomialff
,
sloglink
,
hdeff
,
https://www.cia.gov/index.html.
p <- seq(0.01, 0.99, length= 10)
alogitlink(p)
max(abs(alogitlink(alogitlink(p), inv = TRUE) - p)) # 0?
## Not run:
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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.