| AnotA {sensR} | R Documentation |
Computation of dprime and it's uncertainty for the monadic A-not-A test together with the one-tailed exact P-value of the difference test (Fisher's Exact test).
AnotA(x1, n1, x2, n2, ...)
x1 |
The number of (correct) A-answers on A-samples |
n1 |
The total number of A-samples |
x2 |
The number of A-answers on not-A-samples |
n2 |
The number of not-A-samples |
... |
Additional arguments passed to glm |
The function uses the glm and fisher.test functions
of the stats package. Note that all arguments have to be
positive integers.
An object of class "discrim" (which has a print method). This is
a list with elements
coef |
named vector of coefficients (d-prime) |
res.glm |
the glm-object from the fitting process |
vcov |
variance-covariance matrix of the coefficients |
se |
named vector with standard error of the coefficients (standard error of d-prime |
data |
a named vector with the data supplied to the function |
p.value |
one-sided p-value from Fisher's exact test (fisher.test) |
test |
a string with the name of the test (A-Not A) for
the print method |
call |
the matched call |
Rune Haubo B Christensen and Per Bruun Brockhoff
Brockhoff, P.B. and Christensen, R.H.B.(2008). Thurstonian models for sensory discrimination tests as generalized linear models. Manuscript for Food Quality and Preference.
print.discrim, discrim,
discrimPwr, discrimSim,
discrimSS, findcr
# data: 10 of the A-samples were judged to be A
# 20 A-samples in total
# 3 of the not-A samples were judged to be A
# 20 not-A-samples in total
AnotA(10, 20, 3, 20)
## Extended example plotting the profile likelihood
xt <- cbind(c(3, 10), c(20 - 3, 20 - 10))
lev <- gl(2, 1)
summary(res <- glm(xt ~ lev,
family = binomial(link = probit)))
N <- 100
dev <- double(N)
level <- c(0.95, 0.99)
delta <- seq(1e-4, 5, length = N)
for(i in 1:N)
dev[i] <- glm(xt ~ 1 + offset(c(0, delta[i])),
family = binomial(probit))$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 /
(2 * vcov(res)[2,2])), lty = 2)
## Add confidence limits:
lim <- sapply(level, function(x)
exp(-qchisq(x, df=1)/2) )
abline(h = lim, col = "grey")