Friday, May 15, 2020

scale (z-score)

The R docs present this as a generic function (Scaling and Centering of Matrix-like Objects). In Stat 3743, Kern uses it. It appears to calculate the z-score for an element based on the data.frame. I'm not sure yet how to get just one z-score for a particular value in a data.frame.

R Example

For example, the data.frame precip provides rainfall data from 7 to 67 inches:

> range(precip)
[1]  7 67

And scale(range(precip)) provides the min and max z-scores for all the elements in precip:

> range(scale(precip))
[1] -2.034466  2.342971

No comments:

Post a Comment

Please help to combat malicious use of the Internet.