contr.simplex: Orthonormal Contrast Generator

View source: R/contr.simplex.R

contr.simplexR Documentation

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. If this is a factor or character vector, 'n' will be 'length(n)'

size

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

Value

A matrix of Orthonormal contrasts.

Examples

contr.simplex(4)

skpr documentation built on July 9, 2023, 7:23 p.m.

Related to contr.simplex in skpr...