Learn R Programming

BayesTools (version 0.2.18)

contr.orthonormal: Orthornomal contrast matrix

Description

Return a matrix of orthornomal contrasts. Code is based on stanova::contr.bayes and corresponding to description by rouder2012default;textualBayesTools

Usage

contr.orthonormal(n, contrasts = TRUE)

Value

A matrix with n rows and k columns, with k = n - 1 if contrasts = TRUE and k = n if contrasts = FALSE.

Arguments

n

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

contrasts

logical indicating whether contrasts should be computed

References

Examples

Run this code
contr.orthonormal(c(1, 2))
contr.orthonormal(c(1, 2, 3))

Run the code above in your browser using DataLab