Appendix D R functions and codes

This appendix includes all R codes used throughout the book. It is worth noting that we used and fully recognize the validity and authorship of R codes existing in R packages and produced as complementary material for other books. Among those we refer to the following websites:

Packages

Package stats (version 2.15.3)

  • ansari.test(x, y, alternative = c("two.sided", "less", "greater"), exact = NULL, conf.int = FALSE, conf.level = 0.95,…)

    It performs the Ansari–Bradley two-sample test for a difference in scale parameters.

  • binom.test(x, n, p = 0.5, alternative = c("two.sided", "less", "greater"), conf.level = 0.95)

    It performs an exact test on the proportion/probability of success in a Bernoulli experiment.

  • chisq.test(x, y = NULL, correct = TRUE, p = rep(1/length(x), length(x)), rescale.p = FALSE,simulate.p.value = FALSE, B = 2000)

    It performs the chi-square goodness-of-fit tests for comparisons of proportions/ probabilities and for independence of categorical variables.

  • cor(x, y = NULL, use = "everything", method = c("pearson", "kendall", "spearman"))

    It computes the correlation of x and y if these are vectors. If x and y are matrices then the covariances (or correlations) between the columns of x and the ...

Get Nonparametric Hypothesis Testing: Rank and Permutation Methods with Applications in R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.