# duotrio: Create duotrio binomial family In perbrock/sensR: Thurstonian Models for Sensory Discrimination

 duotrio R Documentation

## Create duotrio binomial family

### Description

Creates af copy of the binomial family with the inverse link function changed to equal the duotrio psychometric function and correspondingly changed link function and derivative of the inverse link function.

### Usage

``````duotrio()
``````

### Value

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

### Note

Several functions in this package makes use of the function, but it may also be used on its ownâ€”see the example below.

### Author(s)

Per Bruun Brockhoff

### References

Brockhoff, P.B. and Christensen, R.H.B. (2010). Thurstonian models for sensory discrimination tests as generalized linear models. Food Quality and Preference, 21, pp. 330-338.

`triangle`, `twoAFC`, `threeAFC`, `tetrad`, `discrim`, `discrimPwr`, `discrimSim`, `AnotA`, `discrimSS`, `samediff`, `findcr`

### Examples

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

## Extended example plotting the profile likelihood
## data: 10 correct answers, 5 incorrect
xt <- matrix(c(10, 5), ncol = 2)
summary(res <- glm(xt ~ 1, family = duotrio))
N <- 100
dev <- double(N)
delta <- seq(1e-4, 5, length = N)
for(i in 1:N)
dev[i] <- glm(xt ~ -1 + offset(delta[i]),
family = duotrio)\$deviance
plot(delta, exp(-dev/2), type = "l",
xlab = expression(delta),
ylab = "Normalized Profile Likelihood")
lines(delta, exp(-(delta - coef(res))^2 /
(2 * vcov(res))), lty = 2)