Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

multComb

Combinations of the first n integers in k groups


Description

This is a function, used for generating the permutations used for the Exact distribution of many of the statistical procedures in Hollander, Wolfe, Chicken - Nonparametric Statistical Methods Third Edition, to generate possible combinations of the first n=n1+n2+...+nk integers within k groups.

Usage

multComb(n.vec)

Arguments

n.vec

Contains the group sizes n1,n2,...,nk

Details

The computations involved get very time consuming very quickly, so be careful not to use it for too many large groups.

Value

Returns a matrix of n!/(n1!*n2!*...*nk!) rows, where each row represents one possible combination.

Author(s)

Grant Schneider

Examples

##What are the ways that we can group 1,2,3,4,5 into groups of 2, 2, and 1?
multComb(c(2,2,1))

##Another example, with four groups
multComb(c(2,2,3,2))

NSM3

Functions and Datasets to Accompany Hollander, Wolfe, and Chicken - Nonparametric Statistical Methods, Third Edition

v1.16
GPL-2
Authors
Grant Schneider, Eric Chicken, Rachel Becvarik
Initial release
2021-04-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.