Description Usage Arguments Details Value Examples
View source: R/comparebinlinks.R
Compare two link functions for the binomial distribution.
1 2  comparebinlinks(d1, d2, a = 8, b = 8, n = 2001, prob1 = NULL,
plot = TRUE)

d1 
Either a positive number of one of "logit" or "probit"
defining the link function. If positive number, this corresponds
to the 
d2 
Same as 
a 
Beginning of range of points to evaluate (and plot) the two link functions. 
b 
End of range of points to evaluate (and plot) the two link functions. 
n 
Number of points for evaluating (and plot) the two link functions. 
prob1 
Binomial probabilities corresponding to the first link function. 
plot 
Whether the two link functions should be plotted. If so, two plots are created: the left plot shows two curves corresponding to the two link functions (black is the first) and the right plot shows their difference (first  second). 
Finds the closest (after suitable scaling) of the link function
d2
to d1
. If prob1
is provided, then this
corresponds to probabilities under link d1
and the
probabilities are transformed to d2
. Also creates a plot of
the two link functions.
A list with the following elements
scale
The optimal scaling c
such that
max(abs(link(x/c,d1)  link(x,d2)))
is minimised for
x = seq(a,b,length.out=n)
maxdiff
The maximum difference between the two links.
prob2
The corresponding probabilities from prob1
to the second link.
1 2 3 4 5  ## Not run:
comparebinlinks("logit", 7) # The robit(7) approximates logit
comparebinlinks("probit", 1, prob1 = c(.5, .6, .7, .8, .9))
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.