constraint {survPen}R 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) 


[Package survPen version 1.6.0 Index]