Learn R Programming

LHD (version 1.4.1)

WT: Williams Transformation

Description

WT returns a matrix after implementing the Williams transformation

Usage

WT(X, baseline = 1)

Value

If all inputs are logical, then the output will be a matrix whose sizes are the same as input matrix.

Arguments

X

A matrix object. In general, X stands for the design matrix, e.g. an LHD or a GLP design.

baseline

A integer, which defines the minimum value for each column of the matrix. The default is set to be 1.

References

Williams, E. J. (1949) Experimental designs balanced for the estimation of residual effects of treatments. Australian Journal of Chemistry, 2, 149-168.

Examples

Run this code
#create a toy LHD with 5 rows and 3 columns
toy=rLHD(n=5,k=3);toy
toy2=toy-1;toy2  #make elements of "toy" become 0,1,2,3,4

#Implementing Williams transformation on both toy and toy2:
#The result shows that "WT" function is able to detect the
#elements of input matrix and make adjustments.
WT(toy)
WT(toy2)

#Change the baseline
WT(toy,baseline=5)
WT(toy,baseline=10)

Run the code above in your browser using DataLab