我可以用R计算z得分吗?

a83*_*a83 23 r normalization

可能重复:
R,相关性:是否存在将num矢量转换为标准单位矢量的函数

通过阅读stackoverflow的评论,我发现z-score可能是用Python或perl计算的,但我还没有看到任何R.我错过了吗?是否可以用R完成?

如(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. 
Run Code Online (Sandbox Code Playgroud)

我相信有为此设计的R套餐?我们在哪里找到它们?或类似的规范化包?

Sac*_*amp 56

如果x是具有原始分数的向量,则scale(x)是具有标准化分数的向量.

或手动: (x-mean(x))/sd(x)

  • 注意:`scale`在内部执行`na.rm`,所以它更相当于`(x-mean(x, na.rm=TRUE))/sd(x, na.rm=TRUE)` (4认同)