X_decomp: Decomposition of the design matrix for random rotation...

View source: R/randRot.R

X_decompR Documentation

Decomposition of the design matrix for random rotation generation

Description

Full QR decomposition of the design matrix X. No argument checks are performed, see Details.

Usage

X_decomp(X = NULL, coef.d = seq_len(ncol(X) - 1))

Arguments

X

Design matrix as generated by model.matrix.

coef.d

Non-H0 coefficients.

Details

The design matrix X is QR decomposed into X = Xq Xr. By performing a full QR decomposition, Xq is automatically extended to a full basis. Xq is further split into Xd and Xhe, where Xd corresponds to columns coef.d (non-H0 or non-Null-Hypothesis columns) and Xhe correspond to all other columns (H0 and error columns), see initRandrot. No argument checks are performed for reasons of performance as this function is called frequently by initRandrot when weights are used. See \insertCiteHettegger2021randRotation and \insertCiteLangsrud2005randRotation for further details.

Value

A list object containing matrices Xd, Xhe and rank of the qr decomposition.

Author(s)

Peter Hettegger

References

\insertAllCited

Examples

design <- cbind(1, rep(0:1, 5))
X_decomp(design)

phettegger/randRotation documentation built on April 10, 2023, 7:25 p.m.