Create an rsm.factor from a Vector

DESCRIPTION:

Converts a vector to an rsm.factor , for use with fitting response surface methods.

USAGE:

as.rsm.factor(x, logx = F) 

REQUIRED ARGUMENTS:

x
a vector (often with 3 or 5 unique values), or factor

OPTIONAL ARGUMENTS:

logx
logical for whether the rsm.factor is spaced on the log scale

VALUE:

An rsm.factor, a vector with the following attributes:
scale
half the distance between the cube points
center
the average of the cube points
alpha
a scaling constant for the star points
log
a logical value for whether the factor is computed on the log scale

DETAILS:

If x has 3 or 5 unique values the returned value is computed as follows. The cube points, a and b, of the vector x are taken as the second and fourth unique ordered value of x (first and third if there are 3 values). The star points, c and d are the first and fifth unique ordered values of x (first and third if there are 3 values). Then scale = (b-a)/2, center = (a+b)/2, and alpha = (d - "center")/("center" - a).

For any other number of unique values, alpha = 1; scale = (max(x)-min(x))/2; center = min(x)+ scale. In this case the scaled rsm.factor (as used in rsm.lm) will have min = -1 and max = 1.

SEE ALSO:

, , .