Tail of the cumulative distribution function.
Default is the 2-tailed value.
Value
Numeric value of the cumulative distribution function according to the chosen tail.
Note
The 2-sided exact p-value is defined as P(abs(R-E(R)>=abs(r-E(R)).
The lower (left) tail p-value is defined as P(R<=r).
The upper (right) tail p-value is defined as P(R>=r).
r is the observed value of the random variable R.
Author(s)
D. Labes
Examples
# SPSS "Exact Tests": small sample example, exact p: 0.071
# x <- c(1, 1, 1, 1, 0, 0, 0, 0, 1, 1)
pruns.exact(r=3, n1=4, n2=6)
# 0.07142857
# left tail P(R<=3)=0.04761905
pruns.exact(r=3, n1=4, n2=6, tail="lower")
# right tail P(R>=3)=0.9904762
pruns.exact(r=3, n1=4, n2=6, tail="upper")
# or via runs.pvalue (2-sided)
x <- c(1, 1, 1, 1, 0, 0, 0, 0, 1, 1)
runs.pvalue(x, pmethod="ex")