Learn R Programming

sparselink (version 1.0.0)

link_function: Link function

Description

Applies the link function.

Usage

link_function(mu, family)

Value

Returns a numeric vector of the transformed values.

Arguments

mu

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

family

character "gaussian" or "binomial"

Examples

Run this code
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)

Run the code above in your browser using DataLab