Transformation from the Observation Scale to the Link Scale

Share:

Description

The function transforms a variable from the observation scale (probability or count) to the link scale.

Usage

1
link(x, type = c("cloglog", "log", "logit"))

Arguments

x

A vector of real numbers.

type

A character string. Legal values are “cloglog”, “log” and “logit”.

Value

logit(x) = log(x / (1 - x))
cloglog(x) = log(-log(1 - x ))

See Also

invlink

Examples

1
2
3
4
5
6
7
8
  x <- seq(.001, .999, length = 100)
  plot(x, link(x, type = "logit"),
       type = "l", lwd = 2, ylab = "link(proba.)")
  lines(x, link(x, type = "cloglog"), lty = 2, lwd = 2)
  grid(col = "black")
  legend(0, 6, legend = c("logit(x)", "cloglog(x)"),
         lty = c(1, 2), bg = "white")
  

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.