If a dimension reduction object has \(p\) dimension, returns a \(p \times r\) matrix whose columns space a subspace specified by a formula.

coord.hyp.basis(object, spec, which = 1)

Arguments

object

A dr object

spec

A one-sided formula, see below

which

either +1 or \(-1\); see below

Details

The workings of this function is best explained by an example. Suppose the dr object was created with the formula y~x1+x2+x3+x4, so we have \(p=4\) predictors. A matrix that spans the subspace of \(R^4\) specified by Span(x1,x2,x3,x4) is simply the identity matrix of order 4.

This function will return a subset of the columns of this identity matrix, as determined by spec. For example, if spec = ~.-(x3+x4), the function returns the columns corresponding to x1 and x2 if which=+1 or the columns corresponding to x3 and x4 if which=\(-1\). Similarly, if spec=~x1+x2, the same matrices will be returned.

Value

A matrix corresponding to the value of spec and which given.

Author

Sanford Weisberg, sandy@stat.umn.edu

Examples

data(ais)
s1 <- dr(LBM~log(Ht)+log(Wt)+log(RCC)+log(WCC)+log(Hc)+log(Hg),
         data=ais,method="sir")
coord.hyp.basis(s1,~.-log(Wt)-log(Hg))
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    0    0    0
#> [2,]    0    0    0    0
#> [3,]    0    1    0    0
#> [4,]    0    0    1    0
#> [5,]    0    0    0    1
#> [6,]    0    0    0    0