twofiveF: Create twofiveF binomial family

Description Usage Value Note Author(s) References See Also Examples

View source: R/links.R

Description

Creates af binomial family object with the inverse link function equal to the psychometric function for the Two-Out-of-Five with forgiveness test.

Usage

1

Value

A binomial family object for models. Among other things it inludes the psychometric function as linkinv and the inverse psychometric function (for direct d-prime computation) as linkfun.

Note

Several functions in this package makes use of functions in the twofiveF family object, but it may also be used on its own—see the example below.

Author(s)

Karolina Stachlewska

References

Ennis, J. M. (2013). A thurstonian analysis of the Two-Out-of-Five test. Journal of Sensory Studies, 28(4), pp. 297-310.

See Also

duotrio, triangle, twoAFC, threeAFC, tetrad, twofive, hexad, discrim, discrimPwr, discrimSim, AnotA, discrimSS, samediff, findcr

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
## Estimating d-prime using glm for a Two-Out-of-Five with forgiveness test:
xt <- matrix(c(10, 5), ncol = 2) ## data: 10 correct answers, 5 incorrect
res <- glm(xt ~ 1, family = twofiveF)
summary(res)
## Equivalent to (Estimate and Std. Error):
discrim(10, 15, method="twofiveF")


## Extended example plotting the profile likelihood
## data: 10 correct answers, 9 incorrect
xt <- matrix(c(10, 9), ncol = 2)
summary(res <- glm(xt ~ 1, family = twofiveF))
N <- 100
dev <- double(N)
delta <- seq(1e-4, 3, length = N)
for(i in 1:N)
  dev[i] <- glm(xt ~ -1 + offset(delta[i]),
                family = twofiveF)$deviance
plot(delta, exp(-dev/2), type = "l",
     xlab = expression(delta),
     ylab = "Normalized Profile Likelihood")
## Add Normal approximation:
lines(delta, exp(-(delta - coef(res))^2 /
                 (2 * vcov(res))), lty = 2)
## Add confidence limits:
level <- c(0.95, 0.99)
lim <- sapply(level, function(x) exp(-qchisq(x, df=1)/2) )
abline(h = lim, col = "grey")

sensR documentation built on Feb. 11, 2020, 1:10 a.m.