Laptop keyboard with blue glow

NMstats R Package

NMstats is an R package that includes functions that align to the Navidi/Monk Elementary and Essential Statistics program.

Installing the NMstats package

NMstats can be installed from GitHub with

# install.packages("devtools") devtools::install_github("bjmonk/NMstats")

or via the web with (may require restart):

# install.packages("devtools") devtools::install_url("https://barrymonk.com/NMstats.tar.gz")

Examples and Usage

Find usage examples at the NMstats vignette.

Functions in the NMstats package

NMstats includes the following functions:

combs
Calculates the number of ways to choose r items from a total of n items without replacement and where the order does not matter.
perms
Calculates the number of ways to choose r items from a total of n items without replacement and where the order matters.
outlier_bounds
Computes the lower and upper outlier boundaries of a dataset using the IQR method.
data_range
Computes the range of a data set.
rel_hist
Computes a relative histogram of given data values.
var.p
Calculates the population variance of a data set.
sd.p
Calculates the population standard deviation of a data set.
Z_Interval
Calculates the confidence interval for a population mean when the population standard deviation is known.
T_Interval
Calculates the confidence interval for a population mean when the population standard deviation is not known.
One_Prop_Int
Calculates the confidence interval for a population proportion.
Z_Test
Performs a hypothesis test about a population mean when the population standard deviation is known.
T_Test
Performs a hypothesis test about a population mean when the population standard deviation is not known.
One_Prop_Test
Performs a one-sample hypothesis test for a population proportion.
Two_Samp_T_Interval
Constructs a confidence interval for the difference between two population means (μ₁ − μ₂) given two independent samples.
Two_Samp_T_Test
Performs a hypothesis test about the difference between two population means (μ₁ − μ₂) given two independent samples.
Two_Prop_Int
Calculates the confidence interval for the difference between two population proportions (p₁ − p₂).
Sign_Test
Performs a nonparametric one-sample Sign Test for a population median.
Rank_Sum_Test
Performs a nonparametric test for comparing the medians of two populations.
Signed_Rank_Test
Performs a nonparametric test for testing whether there is a difference between the medians of two populations, when the data are in the form of paired samples.