constraint: Sum-to-zero constraint

View source: R/survPenV1_60.r

constraintR Documentation

Sum-to-zero constraint

Description

Applies the sum-to-zero constraints to design and penalty matrices.

Usage

constraint(X, S, Z = NULL)

Arguments

X

A design matrix

S

A penalty matrix or a list of penalty matrices

Z

A list of sum-to-zero constraint matrices; default is NULL

Value

List of objects with the following items:

X

Design matrix

S

Penalty matrix or list of penalty matrices

Z

List of sum-to-zero constraint matrices

Examples


library(survPen)

set.seed(15)

X <- matrix(rnorm(10*3),nrow=10,ncol=3)
S <- matrix(rnorm(3*3),nrow=3,ncol=3) ; S <- 0.5*( S + t(S))

# applying sum-to-zero constraint to a desgin matrix and a penalty matrix
constr <- constraint(X,S) 


survPen documentation built on Sept. 14, 2023, 1:06 a.m.