【发布时间】:2015-05-28 13:50:43
【问题描述】:
我已经对道琼斯的 10 个股票数据进行了 PCA,现在我尝试使用我的 PCA 的第一个主成分从股票数据中提取“股票指数”因子,但我不知道如何这样做。
library(FactoMineR);
str <- "Exxon Mobil;Intel;McDonald's;Microsoft;Nike;Procter And Gamble;The Travelers Companies;Verizon Communications;Visa;Wal-Mart Stores
84,46;30,81;96,29;40,72;99,55;82,32;107,11;48,92;65,18;80,71
85;31,27;97,44;40,66;100,33;81,94;108,13;48,63;65,41;82,25
85,63;31,46;97,88;40,96;100,89;82,72;109,64;49,12;65,66;82,53
83,58;32;96,96;40,97;99,88;82,31;107,13;48,56;65,54;81,35
84,32;30,08;97,64;41,21;99,33;82,15;106,83;48,42;65,59;81,89
84,86;29,89;98,14;41,46;98,99;83,01;107,61;48,73;65,73;81,32
84,52;30,79;99,36;42,9;100,65;83,92;109,23;49,41;67,1;83,05
85,43;31,2;98,62;42,86;101,46;84,86;109,62;49,64;67,08;83,31
84,54;31,31;97,05;42,88;101,98;84,74;109,73;49,56;67,41;83,24
84,41;30,74;95,98;42,29;98,32;83,38;109,11;49,3;66,81;81,52
86,07;30,89;97;42,5;97,51;83,75;109,52;49,54;267,67001;82,53
84,08;30,59;96,17;41,7;96,54;82,85;108,75;48,95;264,5;82,62
84,76;30,83;97,15;41,56;96,44;83,56;108,93;49,27;269,01999;83,29"
Actions <- read.table(text=str, dec="," , header=TRUE, sep=";")
Actions.PCA<-PCA(Actions)
summary(Actions.PCA)
【问题讨论】:
-
您需要向我们展示您所做的最小可复制示例,否则人们将无法帮助您。请阅读。见stackoverflow.com/questions/5963269/…
-
以后我建议您使用
dput(Actions)命令发布数据。更容易解析。 -
或者更确切地说是
dput(head(Actions))。