## Two-sample problem
dta <- data.frame(
y = rnorm(20),
x = gl(2, 10)
)
## Exact Ansari-Bradley test
at <- ansari_test(y ~ x, data = dta, distribution = "exact")
## Support of the exact distribution of the Ansari-Bradley statistic
supp <- support(at)
## Density of the exact distribution of the Ansari-Bradley statistic
dens <- dperm(at, supp)
## Plotting the density
plot(supp, dens, type = "s")
## 95 \% quantile
qperm(at, 0.95)
## One-sided p-value
pperm(at, statistic(at))
## Random number generation
rperm(at, 5)
Run the code above in your browser using DataLab