hexad | R Documentation |
Creates af binomial family object with the inverse link function equal to the psychometric function for the unspecified Hexad test.
hexad()
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
.
Several functions in this package makes use of functions in the hexad family object, but it may also be used on its own—see the example below.
Karolina Stachlewska
Eberhardt, K., Aubry, V., & Robinson, K. (2008). A thurstonian model for the unspecified hexad test. In 2008 Sensometrics Meeting 'Discover a New World of Data' (E-5). Kraft Foods.
duotrio
, triangle
, twoAFC
,
threeAFC
, tetrad
, twofive
,
twofiveF
, discrim
,
discrimPwr
, discrimSim
,
AnotA
, discrimSS
,
samediff
, findcr
## Estimating d-prime using glm for an unspecified Hexad test:
xt <- matrix(c(10, 5), ncol = 2) ## data: 10 correct answers, 5 incorrect
res <- glm(xt ~ 1, family = hexad)
summary(res)
## Equivalent to (Estimate and Std. Error):
discrim(10, 15, method="hexad")
## 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 = hexad))
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 = hexad)$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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.