Learn R Programming

ANSM5

The ANSM5 package provides a number of functions and data to accompany the book “Applied Nonparametric Statistical Methods”, 5th edition (Smeeton, Spencer & Sprent, 2024, Taylor Francis), the revisions from the 4th edition including a move from describing the output from a miscellany of statistical software packages to using R. While the output from many of the functions can also be obtained using a range of pre-existing R functions, this package provides functions in a unified setting and give output using both p-values and confidence intervals, exemplifying the book’s approach of treating p-values as a guide to statistical importance and not an end product in their own right.

Installation

You can install the development version of ANSM5 like so:

# install.packages("devtools")
devtools::install_github("neilhspencer/ANSM5")

Example

This is a basic example which shows you how to solve a common problem:

library(ANSM5)

#From Example 3.1 in "Applied Nonparametric Statistical Methods" (5th edition)
sgn.test(ch3$sampleI, 110)
#> 
#> Sign test for ch3$sampleI 
#> 
#> Null hypothesis: theta = 110 
#> Alternative hypothesis (2-sided): theta != 110 
#> 
#> Exact p-value: 0.10937
#> Exact 95% Confidence Interval (97.852% achieved) 
#> (11.00000, 151.00000)

#From Example 6.1 in "Applied Nonparametric Statistical Methods" (5th edition)
wilcoxon.mann.whitney(ch6$groupA, ch6$groupB)
#> 
#> Wilcoxon-Mann-Whitney test for ch6$groupA and ch6$groupB
#> 
#> H0: samples are from the same population
#> H1: samples differ in location
#> 
#> Statistic for exact test: 
#> 76 (rank sum from ch6$groupA), 155 (rank sum from ch6$groupB)
#> 21 (Mann-Whitney U from ch6$groupA), 89 (Mann-Whitney U from ch6$groupB) 
#> Exact p-value: 0.01587
#> Exact 95% Confidence Interval 
#> (-13.00000, -2.00000)

#From Example 7.6 in "Applied Nonparametric Statistical Methods" (5th edition)
friedman(ch7$pulse, ch7$time.period, ch7$student)
#> 
#> Friedman test for ch7$pulse and ch7$time.period (as groups) with ch7$student (as blocks)
#> 
#> H0: distributions of ch7$pulse are identical
#> H1: distributions differ
#> 
#> Statistic for exact test: 10.57143 
#> Exact p-value: 0.00272

Copy Link

Version

Install

install.packages('ANSM5')

Monthly Downloads

388

Version

1.1.1

License

GPL (>= 3)

Maintainer

Neil Spencer

Last Published

August 31st, 2024

Functions in ANSM5 (1.1.1)

ansari.bradley

Perform Ansari-Bradley test
ch9

Data used in Chapter 9
friedman

Perform Friedman test
friedman.lsd

Perform Least Significant Differences test after the Friedman test
breslow.day

Perform Breslow and Day test
ch7

Data used in Chapter 7
ch8

Data used in Chapter 8
gehan.wilcoxon

Perform Gehan-Wilcoxon test
ch6

Data used in Chapter 6
ch12

Data used in Chapter 12
ch15

Data used in Chapter 15
hettmansperger.elmore

Perform Hettmansperger and Elmore interaction test
ch3

Data used in Chapter 3
control.median

Perform Control median test
fishertest.ANSM

Perform Fisher exact test
cramer.von.mises

Perform Cramer-von Mises test
kruskal.wallis.vdW

Perform Kruskal-Wallis test with van der Waerden scores
kruskal.wallis

Perform Kruskal-Wallis test
cox.stuart

Perform Cox-Stuart test
moses.extreme.reactions

Perform Moses test for extreme reactions
kruskal.wallis.lsd

Perform Least Significant Differences test after the Kruskal-Wallis test
hodges.ajne

Perform Hodges-Ajne test
noether

Calculate Noether approximation
kstest.ANSM

Perform Smirnov test and Kolgomorov test
normal.scores.test

Perform Normal Scores test
linear.by.linear

Perform Linear by linear association test
logoddsratio.2x2

Perform Log odds ratio test
mantel.haenszel

Perform Mantel-Haenszel test
logrank

Perform logrank test
jonckheere.terpstra

Perform Jonckheere-Terpstra test
rng.test

Perform Range test
ch4

Data used in Chapter 4
ch5

Data used in Chapter 5
runs.2cat

Perform Runs test for two categories
oddsratio.2x2diff

Perform test for difference in odds ratios
peto.wilcoxon

Perform Peto-Wilcoxon test
ch13

Data used in Chapter 13
kendall.concordance

Calculate Kendall's concordance
cohen.kappa

Calculate Cohen's kappa
conover

Perform Conover test using standard or squared ranks
ch14

Data used in Chapter 14
spearman

Calculate Spearman correlation
spearman.beta

Calculate Spearman beta
wilcoxon.signedrank

Perform Wilcoxon signed-rank test
runs.ncat

Perform Runs test for three or more categories
pitman

Perform Pitman test
sgn.test

Perform Sign test
zelen

Perform Zelen test
cochran.q

Perform Cochran Q test
med.test

Perform Median test
chisqtest.ANSM

Perform Chi-squared test
mood

Perform Mood test
pearson.beta

Calculate Pearson beta
pearson

Calculate Pearson correlation
siegel.tukey

Perform Siegel-Tukey test
shapirotest.ANSM

Perform Shapiro-Wilk test of Normality
kendall.tau

Perform Kendall's tau
lik.ratio

Perform Likelihood ratio test
lilliefors

Performs Lilliefors test of Normality
print.ANSMstat

Prints an ANSMstat object
print.ANSMtest

Prints an ANSMtest object
wilcoxon.mann.whitney

Perform Wilcoxon-Mann-Whitney test
theil.kendall

Calculate Theil-Kendall beta
bowker

Perform Bowker's extension of McNemar's test
ch10

Data used in Chapter 10
bs

Create bootstrap confidence interval
blomqvist

Calculate Blomqvist coefficient
binom

Perform Binomial test
app1

Data in Appendix 1
ch11

Data used in Chapter 11