Learn R Programming

bmet (version 0.1.0)

apc: All pairwise comparisons

Description

Function creates a contrast matrix for all pairwise comparisons

Usage

apc(ngroups, labs = NULL)

Value

The function returns a matrix of all pairwise contrasts.

Arguments

ngroups

A positive integer greater than 1 denoting the number of groups

labs

A vector of groups labels with length equal to ngroups. The default is set to NULL, and if used, the labels will be set to 1:length(ngroups).

Examples

Run this code
### A contrast matrix based on all pairwise contrasts of 5 groups
apc(5)

### Adding group labels
apc(5, labs = paste("Group", 1:5, sep = " "))

Run the code above in your browser using DataLab