skpr (version 0.57.0)

contr.simplex: Orthonormal Contrast Generator

Description

Generates orthonormal (orthogonal and normalized) contrasts. Each row is the vertex of an N-dimensional simplex. The only exception are contrasts for the 2-level case, which return 1 and -1.

Usage

contr.simplex(n, size = NULL)

Arguments

n

The number of levels in the catagorical variable.

size

Default `1`. The length of the simplex vector.

Value

A matrix of Orthonormal contrasts.

Examples

Run this code
# NOT RUN {
contr.simplex(4)
# }

Run the code above in your browser using DataCamp Workspace