Skip to contents

Applies the link function.

Usage

link_function(mu, family)

Arguments

mu

numeric vector (with values in unit interval if family="binomial")

family

character "gaussian" or "binomial"

Value

Returns a numeric vector of the transformed values.

Examples

family <- "binomial"
from <- ifelse(family=="binomial",0,-3)
to <- ifelse(family=="binomial",1,3)
mu <- seq(from=from,to=to,length.out=100)
eta <- link_function(mu=mu,family=family)
graphics::plot(x=mu,y=eta,type="l",main=family)
v <- ifelse(family=="binomial",0.5,0)
graphics::abline(v=v,lty=2)
graphics::abline(h=0,lty=2)