Hi,
I'm trying to create a table (Stata 17) of several PCA models that shows the share of variance explained by each principal component ("Proportion" column in the results), but I'm unsuccessful and searching for help on this did not help either.
Any advice would be more than welcome.
I'm trying to create a table (Stata 17) of several PCA models that shows the share of variance explained by each principal component ("Proportion" column in the results), but I'm unsuccessful and searching for help on this did not help either.
Code:
. sysuse auto
(1978 automobile data)
. pca mpg price weight
Principal components/correlation Number of obs = 74
Number of comp. = 3
Trace = 3
Rotation: (unrotated = principal) Rho = 1.0000
--------------------------------------------------------------------------
Component | Eigenvalue Difference Proportion Cumulative
-------------+------------------------------------------------------------
Comp1 | 2.2225 1.63291 0.7408 0.7408
Comp2 | .589588 .401676 0.1965 0.9374
Comp3 | .187912 . 0.0626 1.0000
--------------------------------------------------------------------------
Principal components (eigenvectors)
----------------------------------------------------------
Variable | Comp1 Comp2 Comp3 | Unexplained
-------------+------------------------------+-------------
mpg | -0.6021 0.4307 0.6723 | 0
price | 0.5037 0.8582 -0.0987 | 0
weight | 0.6195 -0.2792 0.7337 | 0
----------------------------------------------------------

Comment