Learn R Programming

skpr (version 1.9.2)

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)

Value

A matrix of Orthonormal contrasts.

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.

Examples

Run this code
contr.simplex(4)

Run the code above in your browser using DataLab