Learn R Programming

hyper2 (version 3.0-0)

pwa: Player with advantage

Description

Commonly, when considering competitive situations we suspect that one player has an advantage of some type which we would like to quantify in terms of an additional strength. Examples might include racing at pole position, playing white in chess, or playing soccer at one's home ground. Function pwa() (“player with advantage”) returns a modified hyper2 object with the additional strength represented as a reified entity.

Usage

pwa(H, pwa, chameleon = "S")

Value

Returns an object of class hyper2.

Arguments

H

A hyper2 object

pwa

A list of the players with the supposed advantage; may be character in the case of a named hyper2 object, or an integer vector

chameleon

String representing the advantage

Author

Robin K. S. Hankin

Details

Given an object of class hyper2 and a competitor a, we replace every occurrence of a with a+S, with S representing the extra strength conferred.

However, the function also takes a vector of competitors. If there is more than one competitor, the resulting likelihood function does not seem to instantiate any simple situation.

Nice examples of pwa() are given in inst/cook.Rmd and inst/universities.Rmd.

See Also

ordervec2supp

Examples

Run this code

summary(formula1 %>% pwa("Hamilton","pole"))

H <- ordervec2supp(c(a = 2, b = 3, c = 1, d = 5, e = 4))
pwa(H,'a')

## Four races between a,b,c,d:
H1 <- ordervec2supp(c(a = 1, b = 3, c = 4, d = 2))
H2 <- ordervec2supp(c(a = 0, b = 1, c = 3, d = 2))
H3 <- ordervec2supp(c(a = 4, b = 2, c = 1, d = 3))
H4 <- ordervec2supp(c(a = 3, b = 4, c = 1, d = 2))

## Now it is revealed that a,b,c had some advantage in races 1,2,3
## respectively.  Is there evidence that this advantage exists?

if (FALSE)   # takes ~10 seconds, too long for here
specificp.test(pwa(H1,'a') + pwa(H2,'b') + pwa(H3,'c') + H4,"S")



Run the code above in your browser using DataLab