contr.TianXu: A complex-valued contrast function for s^el levels based on...

contr.TianXuR Documentation

A complex-valued contrast function for s^el levels based on powers of the s-th root of the unity

Description

A complex-valued contrast function for s^el levels based on powers of the s-th root of the unity

Usage

contr.TianXu(n, s = 2, contrasts = TRUE)

Arguments

n

integer or vector; either an integer number of levels of the factor for which contrasts are created, which must be a a power of s; or a factor whose number of levels is a power of s; or a vector of levels whose number of elements is a power of s.

s

positive integer, at least 2

contrasts

logical; must be TRUE

Details

The function implements the complex-valued contrasts from Tian and Xu (2022). Its sole use is the calculation of the stratification pattern (also called space-filling pattern). However, note that it is not used in function Spattern, but only in the internal function Spattern_TianXu, which yields exactly the same results as function Spattern.
The contrasts argument has been kept in order to be prepared in case the model.matrix function gains the ability to handle complex-valued contrasts.

The Tian and Xu contrasts are full-factorial-based contrasts in the sense of Groemping (2023b). Function Spattern uses a different type of full-factorial-based contrasts, the full-factorial-based Helmert contrasts provided in function contr.FFbHelmert.

Value

contr.TianXu yields a matrix of complex-valued contrasts. It can therefore NOT be used in function model.matrix or in statistical modeling functions.

References

Groemping (2023b) Tian and Xu (2022)

Examples

## the same n can yield different contrasts for different s
contr.TianXu(16, 2)
contr.TianXu(16, 4)
round(contr.TianXu(16, 16), 4)


SOAs documentation built on Aug. 11, 2023, 1:09 a.m.