简体   繁体   English

如何计算变量对R(PCA)中2台或更多台PC的总贡献

[英]How to calculate the total contribution of a variable for 2 or more PCs in R (PCA)

I have used SVD to get the matrix V and D 我用SVD来得到矩阵V和D.

a <- rnorm(10, 50, 20)
b <- seq(10, 100, 10)
c <- seq(88, 10, -8)
d <- rep(seq(3, 16, 3), 2)
e <- rnorm(10, 61, 27)

my_table <- data.frame(a, b, c, d, e)
X<- as.matrix(my_table)
sv<- svd(X)
U<- sv$u
V<- sv$v
D<- sv$d
Z<- X%*%V

# I know V is loadings for each variable
V
            [,1]       [,2]        [,3]       [,4]        [,5]
[1,] -0.47127774  0.1101038  0.84237687 -0.2330963 -0.04291587
[2,] -0.46309655  0.6788144 -0.19949420  0.5031776  0.17823289
[3,] -0.41041595 -0.7145416  0.02300398  0.5538093  0.11728268
[4,] -0.07145917  0.0415040 -0.03735585  0.2083779 -0.97383478
[5,] -0.62441269 -0.1216386 -0.49867688 -0.5851088 -0.06543590

D^2/sum(D^2) is the contribution of each PC for total variation. D ^ 2 / sum(D ^ 2)是每台PC对总变化的贡献。

How do you calculate the total contribution of a variable for 2 or more PCs? 如何计算变量对2台或更多台PC的总贡献? eg how much variable b contribute to PC1 + PC2 + PC3? 例如,变量b对PC1 + PC2 + PC3有多大贡献?

I have read this Principal Components Analysis - how to get the contribution (%) of each parameter to a Prin.Comp.? 我已经阅读了这个主要组件分析 - 如何获得每个参数对Prin.Comp的贡献(%)。

Thanks, Ming 谢谢,明

As per this PCA process (read First Principal Component, Second Principal Component), there should not be contribution of same parameters to different components. 根据这个 PCA过程(读取第一主成分,第二主成分),不应该对不同的组件贡献相同的参数。 Correlation between parameters that have contributed to Principal Component 1 (PC1) and PC2 is 0. 导致主成分1(PC1)和PC2的参数之间的相关性为0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM