I am using Principal components analysis on bond returns. I have five bond series from short-term to long-term, Ret1-Ret5:
I run the following to extract the loadings:
pca Ret*, covariance components(3)
estat loadings
mat L = r(A)
Now I would like to graph the loadings, so that the loadings are on the Y-axis and the X-axis are the portfolio numbers 1 to 5. Maybe the question is really about working with matrices in stata than in principal components, but perhaps there is a way to get loadingplot to produce the result.
[I realize this might seem strange, but the loadings have a level, slope and curve pattern. The first factor loads equally on all bonds, the second has a monotonic pattern from low to high, and the third has a hump shape with low loadings on the extreme bonds and high loadings on the middle.]
I run the following to extract the loadings:
pca Ret*, covariance components(3)
estat loadings
mat L = r(A)
Now I would like to graph the loadings, so that the loadings are on the Y-axis and the X-axis are the portfolio numbers 1 to 5. Maybe the question is really about working with matrices in stata than in principal components, but perhaps there is a way to get loadingplot to produce the result.
[I realize this might seem strange, but the loadings have a level, slope and curve pattern. The first factor loads equally on all bonds, the second has a monotonic pattern from low to high, and the third has a hump shape with low loadings on the extreme bonds and high loadings on the middle.]
Comment