sumtozero_contrast: Sum-to-zero contrast matrix

View source: R/bmediatR.R

sumtozero_contrastR Documentation

Sum-to-zero contrast matrix

Description

This function takes the dimensions of a design matrix to produce a sum-to-zero contrast matrix, which is post-multiplied by the design matrix, reducing its dimension by one, resulting in a parameterization of the model in terms of deviation from mean (of a balanced data set).

Usage

sumtozero_contrast(k)

Arguments

k

Number of columns of the design matrix.

Value

sumtozero_contrast returns a k x k-1 matrix to be post-multiplied by the design matrix.

Examples

sumtozero_contrast(8)

wesleycrouse/bmediatR documentation built on April 28, 2023, 4:01 p.m.