blom | R Documentation |
Normal scores transformation (Inverse normal transformation) by Elfving, Blom, van der Waerden, Tukey, and rankit methods, as well as z score transformation (standardization) and scaling to a range (normalization).
blom(
x,
method = "general",
alpha = pi/8,
complete = FALSE,
na.last = "keep",
na.rm = TRUE,
adjustN = TRUE,
min = 1,
max = 10,
...
)
x |
A vector of numeric values. |
method |
Any one |
alpha |
A value used in the |
complete |
If |
na.last |
Passed to |
na.rm |
Used in the |
adjustN |
If |
min |
For the |
max |
For the |
... |
additional arguments passed to |
By default, NA
values are retained in the output.
This behavior can be changed with the na.rm
argument
for "zscore"
and "scale"
methods, or
with na.last
for the normal scores methods.
Or NA
values can be removed from the input with
complete=TRUE
.
For normal scores methods, if there are NA
values
or tied values,
it is helpful to look up
the documentation for rank
.
In general, for normal scores methods, either of the arguments
method
or alpha
can be used.
With the current algorithms, there is no need to use both.
Normal scores transformation will return a normal distribution with a mean of 0 and a standard deviation of 1.
The "scale"
method coverts values to the range specified
in max
and min
without transforming the distribution
of values. By default, the "scale"
method converts values
to a 1 to 10 range.
Using the "scale"
method with
min = 0
and max = 1
is
sometimes called "normalization".
The "zscore"
method converts values by the usual method
for z scores: (x - mean(x)) / sd(x)
. The transformed
values with have a mean of 0 and a standard deviation of
1 but won't be coerced into a normal distribution.
Sometimes this method is called "standardization".
A vector of numeric values.
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
Conover, 1995, Practical Nonparametric Statistics, 3rd.
Solomon & Sawilowsky, 2009, Impact of rank-based normalizing transformations on the accuracy of test scores.
Beasley and Erickson, 2009, Rank-based inverse normal transformations are increasingly used, but are they merited?
set.seed(12345)
A = rlnorm(100)
## Not run: hist(A)
### Convert data to normal scores by Elfving method
B = blom(A)
## Not run: hist(B)
### Convert data to z scores
C = blom(A, method="zscore")
## Not run: hist(C)
### Convert data to a scale of 1 to 10
D = blom(A, method="scale")
## Not run: hist(D)
### Data from Sokal and Rohlf, 1995,
### Biometry: The Principles and Practice of Statistics
### in Biological Research
Value = c(709,679,699,657,594,677,592,538,476,508,505,539)
Sex = c(rep("Male",3), rep("Female",3), rep("Male",3), rep("Female",3))
Fat = c(rep("Fresh", 6), rep("Rancid", 6))
ValueBlom = blom(Value)
Sokal = data.frame(ValueBlom, Sex, Fat)
model = lm(ValueBlom ~ Sex * Fat, data=Sokal)
anova(model)
## Not run:
hist(residuals(model))
plot(predict(model), residuals(model))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.