contr.niets: Cell Means Contrast Matrix

Description Usage Arguments Details Value Author(s) Examples

View source: R/contr.niets.R

Description

This function generates a cell means contrast matrix to support PLS models.

Usage

1

Arguments

n

A vector of levels for a factor, or the number of levels.

contrasts

a logical indicating whether contrasts should be computed; set to FALSE in order to generate required contrast matrix.

Details

This function uses contr.treatment to generate a cell means contrast matrix in support of PLS models.

Value

For datasets with categorical variables it produces the needed design matrix.

Author(s)

Nelson Lee Afanador

Examples

1
2
3
4
5
6
7
# Three levels
levels <- LETTERS[1:3]
contr.niets(levels)

# Two levels
levels <- LETTERS[1:2]
contr.niets(levels)

mvdalab documentation built on Nov. 17, 2017, 6 a.m.