myrange.X {plsdof} | R Documentation |
This function scales each column of the matrix of predictor observations via a linear transformation ax+b.
myrange.X(X, a = NULL, b = NULL)
X |
matrix of predictor obersvations |
a |
vector of slopes for the linear transformation |
b |
vector of intercepts for the linear transformation |
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].
X |
scaled X |
a |
vector of slopes |
b |
vector of intercepts |
Nicole Kraemer, Mikio L. Braun
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