options(help_type="html") library(sensR) ################################# ## John and Dorothy: ## Here is John's CI: (dd1 <- discrim(13, 20, method="duotrio", statistic="Wald")) ## Dorothy's CI is not provided by sensR, but here it is nonetheless: b <- coef(dd1) ci.dorothy <- b[3, 1] + c(-1, 1) * qnorm(0.975) * b[3, 2] round(ci.dorothy, 2) ## And here is the likelihood based CI: discrim(13, 20, method="duotrio", statistic="likelihood") ## We can get the profile likelhood with: plot(profile(dd1), xlim=c(0, 5)) ################################# ## Peter and Sally: ## Here is Peter's CI: (dd2 <- discrim(10, 20, method="triangle", stat="Wald")) ## Sally's CI: b <- coef(dd2) ci.sally <- b[3, 1] + c(-1, 1) * qnorm(0.975) * b[3, 2] round(ci.sally, 2) ## And here is the likelihood based CI: discrim(10, 20, method="triangle", statistic="likelihood") ## And the profile likelhood: plot(profile(dd2), xlim=c(0, 5)) ## The end (my friend...) ##################################################################