set.seed(0) knitr::opts_chunk$set(echo = TRUE) library("hyper2") library("magrittr") options("digits" = 5)
knitr::include_graphics(system.file("help/figures/hyper2.png", package = "hyper2"))
To cite the hyper2
package in publications, please use @hankin2017_rmd.
The modern
pentathlon is an
Olympic sport that comprises five different events: fencing, swimming,
horse riding, and running. This short document discusses a dataset
taken from the 2004 Summer
Olympics,
analysing the order statistic for the top seven competitors:
(I have removed diacritics from some of the names).
pentathlon_table <- as.matrix(read.table("pentathlon.txt")) pentathlon_table
Thus the top line shows that Moiseev came fifth in shooting, first in fencing and swimming, sixth in riding, and fifth in running. The first column shows that the shooting was won by Meliakh (who came first), runner up was Machalik, and so on.
We can present the same information in another way:
ordertable_to_ranktable(pentathlon_table)
pentathlon <- ordertable2supp(pentathlon_table) pentathlon_maxp <- maxp(pentathlon) pentathlon_maxp pie(pentathlon_maxp)
And we can test the null that the competitors all have the same Plackett-Luce strengths:
equalp.test(pentathlon)
Following lines create pentathlon.rda
, residing in the data/
directory of the package.
save(pentathlon_table,pentathlon,pentathlon_maxp,file="pentathlon.rda")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.