Possible Duplicate:
R, correlation: is there a func that converts a vector of nums to a vector of standard units
By reading stackoverflow's comments, I found z-score maybe calculated with Python or perl, but I did not comes across any for R yet. Did I miss it? Is it possible to be done with R?
As (http://en.wikipedia.org/wiki/Standard_score.)
z-score = (x-μ)/σ x is a raw score to be standardized; μ is the mean of the population; σ is the standard deviation of the population.
I believe there are R packages designed for this? Where can we found them? Or similar package for normalization?
zscore works for any distribution for which a cumulative distribution function (like pnorm ) exists in R. The argument distribution is the name of the cumulative distribution function with the "p" removed.
The z-score of a value is the count of the number of standard deviations between the value and the mean of the set. You can find it by subtracting the value from the mean, and dividing the result by the standard deviation.
z-scores make no sense for nominal data; the negative part of the definition of nominal data is that numerical coding is completely arbitrary so long as distinct values are coded distinctly.
if x
is a vector with raw scores then scale(x)
is a vector with standardized scores.
Or manually: (x-mean(x))/sd(x)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With