【发布时间】:2013-01-21 12:45:51
【问题描述】:
我正在对大型电子表格进行一些 PCA 分析,并根据负载选择我的 PC。 据我所知,由于我的数据有不同的单位,因此在进行 PCA 分析之前必须进行标准化。
函数prcomp() 本身是否执行标准化?
我正在阅读prcomp() 帮助文件,并在prcomp() 的参数下看到了这个:
scale. a logical value indicating whether the variables should be scaled to have
unit variance before the analysis takes place. The default is FALSE for
consistency with S, but in general scaling is advisable. Alternatively, a
vector of length equal the number of columns of x can be supplied. The
value is passed to scale.
“缩放变量以具有单位方差”是否意味着标准化?
我目前正在使用这个命令:
prcomp(formula = ~., data=file, center = TRUE, scale = TRUE, na.action = na.omit)
够了吗?还是我应该做一个单独的标准化步骤?
谢谢,
【问题讨论】:
-
取决于你所说的
standardization... -
仅供参考,我想要princomp(按行PCA),而不是prcomp(按列)。对你来说不一定是个问题,但我会把这条评论留给像我这样天真的人。
标签: r