本站分享:AI、大数据、数据分析师培训认证考试,包括:Python培训Excel培训Matlab培训SPSS培训SAS培训R语言培训Hadoop培训Amos培训Stata培训Eviews培训

成分分析中biplot函数不理解_主成分分析

r语言 cdadata 7091℃

成分分析中biplot函数不理解_主成分分析

关键词:biplot 分析matlab biplot函数函数型主成分分析

对主成分分析中的biplot函数不理解,谁能帮忙解释?谢谢了

解答:

运行下面的例子,理解我加黑的那句话即可:

Examples

Perform a principal component analysis of the data in carsmall.mat:
load carsmall
x = [Acceleration Displacement Horsepower MPG Weight];
x = x(all(~isnan(x),2),:);

[coefs,score] = princomp(zscore(x));

View the data and the original variables in the space of the first three principal components:
vbls = {‘Accel’,’Disp’,’HP’,’MPG’,’Wgt’};
biplot(coefs(:,1:3),’scores’,score(:,1:3),…
‘varlabels’,vbls);

 


又基本上看了一个下午,我的时间啊!!不过基本上搞明白了
1.图只能表示二个或三个主成分的载荷,这是其缺点,所以往往只看重点主成分。
2.红点代表二个或三个观测值主成分值,如二维图,红点横坐标就是主成分1的值,纵坐标就是主成分2的值。但都是经过一定的量化。(Scale the scores so they fit on the plot, and change the sign of their coordinates according to the sign convention for the coefs.)。
3.蓝点和蓝线代表的是载荷值,坐标与红点意义相类似,所以线在横坐标的投影就是对主成分1的载荷(系数),在纵坐标的投影就是对主成分2的载荷。其值是或取相反数了。 (magnitude in each column of COEFS to be positive.  This flips some of the vectors in COEFS to the opposite direction, but often makes the ploteasier to read)。

希望给那些像我一样不懂的人一点启示


r语言主成分分析biplot怎么看

#R中作为主成分分析最主要的函数是princomp()函数
#princomp()主成分分析   可以从相关阵或者从协方差阵做主成分分析
#summary()提取主成分信息 
#loadings()显示主成分分析或因子分析中载荷的内容
#predict()预测主成分的值 
#screeplot()画出主成分的碎石图 
#biplot()画出数据关于主成分的散点图和原坐标在主成分下的方向

3、案例
#现有30名中学生身高、体重、胸围、坐高数据,对身体的四项指标数据做主成分分析。
#1.载入原始数据
test<-data.frame(
  X1=c(148, 139, 160, 149, 159, 142, 153, 150, 151, 139,
           140, 161, 158, 140, 137, 152, 149, 145, 160, 156,
           151, 147, 157, 147, 157, 151, 144, 141, 139, 148),

转载请注明:数据分析 » 成分分析中biplot函数不理解_主成分分析

喜欢 (4)or分享 (0)