法一:
shuju<-read.csv(file="shuju.csv",header=TRUE,sep=",")
library(psych)
library(GPArotation)
fa.parallel(shuju[,-1],fa="pc",n.iter=100,show.legend=FALSE)
pc<-principal(shuju[,-1],nfactors=4,score=T)
RC1 RC2 RC3 RC4 h2 u2
Open 0.95 0.11 0.21 0.16 0.98 0.0220
High 0.95 0.15 0.20 0.18 0.99 0.0074
Low 0.94 0.17 0.22 0.13 0.99 0.0147
Close 0.94 0.22 0.21 0.14 0.99 0.0094
Volume 0.67 0.26 0.14 0.59 0.88 0.1215
Chengjiaoe 0.72 0.27 0.12 0.56 0.91 0.0851
MA5 0.95 0.00 0.20 0.16 0.98 0.0228
AR26 0.14 0.23 0.92 0.17 0.96 0.0448
BR26 0.33 0.23 0.89 0.15 0.97 0.0329
BIAS12 0.19 0.89 0.30 0.16 0.93 0.0668
OBV 0.88 0.16 -0.02 0.29 0.88 0.1214
PSY 0.36 0.16 0.38 0.73 0.83 0.1656
K 0.19 0.79 0.29 0.29 0.83 0.1697
WR -0.10 -0.93 -0.0 0.02 0.88 0.1231
法二:
shuju.pr<-princomp(shuju[,-1],cor=TRUE)
summary(shuju.pr,loadings=TRUE)
Loadings:
Comp.1 Comp.2 Comp.3 Comp.4
Open -0.312 0.199 0.182
High -0.319 0.178 0.158
Low -0.316 0.165 0.233
Close -0.320 0.144 0.213
Volume -0.293 -0.411
Chengjiaoe -0.302 -0.365
MA5 -0.301 0.258 0.162
AR26 -0.186 -0.332 0.568 0.126
BR26 -0.230 -0.254 0.520 0.206
BIAS12 -0.203 -0.466 -0.239
OBV -0.288 0.209 -0.181
PSY -0.241 0.210 -0.628
K -0.207 -0.422 -0.186
WR 0.134 0.435 0.466 -0.209


雷达卡




京公网安备 11010802022788号







