myrange.X {plsdof}R Documentation

Scaling of predictor variables

Description

This function scales each column of the matrix of predictor observations via a linear transformation ax+b.

Usage

myrange.X(X, a = NULL, b = NULL)

Arguments

X matrix of predictor obersvations
a vector of slopes for the linear transformation
b vector of intercepts for the linear transformation

Details

If both a and b are given, the function transforms the ith column of X via a[i]*X[,i]+b[i]. Otherwise, the columns are scaled such that the range of each column is [-1,+1].

Value

X scaled X
a vector of slopes
b vector of intercepts

Author(s)

Nicole Kraemer, Mikio L. Braun

See Also

X2kernel

Examples

p<-20 # number of variables
n<-100 # number of observations
ntest<-50 # number of test observations

X<-matrix(rnorm(n*p),ncol=p)
Xtest<-matrix(rnorm(ntest*p),ncol=p)

# scale X
range.object<-myrange.X(X)
X.scale<-range.object$X
# scale test data
Xtest.scale<-myrange.X(Xtest,a=range.object$a,b=range.object$b)$X


[Package plsdof version 0.1-1 Index]