# NOT RUN {
requireNamespace("psychotools")
data(winetaste)
## No effect of ambient lighting on flavor (Oberfeld et al., 2009)
m <- lapply(ambilight[, c("preference", "fruitiness",
"spiciness", "sweetness")],
function(x) eba.order(summary(x, pcmatrix = TRUE)))
lapply(m, summary)
u <- sapply(m, uscale, norm = 3)
dotchart(
u, xlim = c(0.5, 2), pch = 16, panel.first = abline(v = 1, col = "gray"),
main = "Ambient lighting and the flavor of wine",
xlab = "Utility scale value (Davidson-Beaver model)"
)
ci <- sapply(m, function(x) 1.96 * sqrt(diag(cov.u(x))))
arrows(
u - ci, c(16:18, 11:13, 6:8, 1:3), u + ci, c(16:18, 11:13, 6:8, 1:3),
.05, 90, 3)
mtext("Oberfeld et al. (2009)", line = 0.5)
## Sensory quality of red wines
psychotools::covariates(redwines$preference) # details of the wines
m <- lapply(redwines[, c("bitterness", "fruitiness", "sourness",
"roundness", "preference")],
function(x) eba(summary(x, pcmatrix = TRUE)))
lapply(m, summary)
u <- sapply(m, uscale)
dotchart(
u[order(u[, "preference"]), ], log = "x",
panel.first = abline(v = 1/5, col = "gray"),
main = "SQRU red wine tasting",
xlab = "Utility scale value (BTL model), choice proportion (+)"
)
points(as.vector(
prop.table(table(redwines$best))[order(u[, "preference"])]
), 1:5, pch = 3)
# }
Run the code above in your browser using DataLab