tetrad: Create tetrad binomial family

View source: R/links.R

tetradR Documentation

Create tetrad binomial family

Description

Creates a binomial family object with the inverse link function equal to the psychometric function for the unspecified method of tetrads.

Usage


tetrad()

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 tetrad family object, but it may also be used on its own—see the example below.

Author(s)

Rune Haubo B Christensen

References

Ennis, J. M., Ennis, D. M., Yip, D., & O'Mahony, M. (1998). Thurstonian models for variants of the method of tetrads. British Journal of Mathematical and Statistical Psychology, 51, pp. 205-215.

Ennis, J. M., & Jesionka, V. (2011). The power of sensory discrimination methods revisited. Journal of Sensory Studies, 26, pp. 371-382.

See Also

duotrio, twoAFC, threeAFC, discrim, discrimPwr, discrimSim, AnotA, discrimSS, samediff, findcr

Examples


## Estimating d-prime using glm for a Tetrad test:
xt <- matrix(c(10, 5), ncol = 2) ## data: 10 correct answers, 5 incorrect
res <- glm(xt ~ 1, family = tetrad)
summary(res)
## Equivalent to (Estimate and Std. Error):
discrim(10, 15, method="tetrad")


## 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 = tetrad))
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 = tetrad)$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")


perbrock/sensR documentation built on Nov. 5, 2023, 10:41 a.m.