logit.2asym: Links for Binomial Family with Variable Upper/Lower...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/gl.links.R

Description

These functions provide links for the binamial family so that psychometric functions can be fit with both the upper and lower asymptotes different from 1 and 0, respectively.

Usage

1
2
3
4
5

Arguments

g

numeric in the range (0, 1), normally <= 0.5, however, which specifies the lower asymptote of the psychometric function.

lam

numeric in the range (0, 1), specifying 1 - the upper asymptote of the psychometric function.

...

used just to pass along the formals of cloglog.2asym as arguments to weib.2asym.

Details

These links are used to specify psychometric functions with the form

P(x) = γ + (1 - γ - λ) p(x)

where γ is the lower asymptote and lambda is 1 - the upper asymptote, and p(x) is the base psychometric function, varying between 0 and 1.

Value

Each link returns a list containing functions required for relating the response to the linear predictor in generalized linear models and the name of the link.

linkfun

The link function

linkinv

The inverse link function

mu.eta

The derivative of the inverse link

valideta

The domain over which the linear predictor is valid

link

A name to be used for the link

Author(s)

Kenneth Knoblauch

References

Klein S. A. (2001) Measuring, estimating, and understanding the psychometric function: a commentary. Percept Psychophys., 63(8), 1421–1455.

Wichmann, F. A. and Hill, N. J. (2001) The psychometric function: I.Fitting, sampling, and goodness of fit. Percept Psychophys., 63(8), 1293–1313.

See Also

glm, glm make.link, psyfun.2asym

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#A toy example,
b <- 3
g <- 0.05 # simulated false alarm rate
d <- 0.03
a <- 0.04
p <- c(a, b, g, d)
num.tr <- 160
cnt <- 10^seq(-2, -1, length = 6) # contrast levels

#simulated Weibull-Quick observer responses
truep <- g + (1 - g - d) * pweibull(cnt, b, a)
ny <- rbinom(length(cnt), num.tr, truep)
nn <- num.tr - ny
phat <- ny/(ny + nn)
resp.mat <- matrix(c(ny, nn), ncol = 2)

ddprob.glm <- psyfun.2asym(resp.mat ~ cnt, link = probit.2asym)
ddlog.glm <- psyfun.2asym(resp.mat ~ cnt, link = logit.2asym)
# Can fit a Weibull function, but use log contrast as variable
ddweib.glm <- psyfun.2asym(resp.mat ~ log(cnt), link = weib.2asym) 
ddcau.glm <- psyfun.2asym(resp.mat ~ cnt, link = cauchit.2asym)

plot(cnt, phat, log = "x", cex = 1.5, ylim = c(0, 1))
pcnt <- seq(0.01, 0.1, len = 100)
lines(pcnt, predict(ddprob.glm, data.frame(cnt = pcnt),
			type = "response"), lwd = 5)
lines(pcnt, predict(ddlog.glm, data.frame(cnt = pcnt),
			type = "response"), lwd = 2, lty = 2, col = "blue")
lines(pcnt, predict(ddweib.glm, data.frame(cnt = pcnt),
			type = "response"), lwd = 3, col = "grey")
lines(pcnt, predict(ddcau.glm, data.frame(cnt = pcnt),
			type = "response"), lwd = 3, col = "grey", lty = 2)

psyphy documentation built on Nov. 10, 2020, 3:49 p.m.