Substracts the mean or median from observations belonging to the same level of a factor.
allignment(response, block, type = c("mean", "median"), ...)
a numeric vector
a factor of the same length as response
type of location measure to calculate and substract; only the choices "mean" and "median" are supported
further arguments to be passed to mean
or median
A numeric vector.
Splits response
according to the levels of block
, calculates and substracts the mean or median and returns the resulting vector in appropriate order.