Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: PCA


From   Muhammad Ramzan <[email protected]>
To   [email protected]
Subject   Re: st: PCA
Date   Sat, 18 Jan 2014 12:20:30 +0500

thanks Nick , for your help.

I have modified the code to get the eigenvector. can i save the values
of first eigen vector in excel.

sysuse auto,clear
pca  trunk weight length headroom displacement
mat eigenv = e(L)
mat li eigenv


                   Comp1       Comp2       Comp3       Comp4       Comp5
       trunk   .43335481   .36647998   -.7676352   .29135313   .06120126
      weight   .48420457  -.33293068   .07372254   -.2668877   .76028879
      length   .48630825  -.23721442  -.10501275  -.57452327  -.60508589
    headroom   .35873169   .76396311   .52237979  -.12092568   .01297203
displacement   .46104816  -.33902696   .34841479   .70652976  -.22785555


I want to save the first comp1 in Excel.

Thanks

On 18 January 2014 01:39, Nick Cox <[email protected]> wrote:
> With some guesses on what Muhammad is asking here:
>
> Consider this code example and its results:
>
> sysuse auto
> pca  trunk weight length headroom displacement
> mat eigenv = e(Ev)
> mat li eigenv
> mat eigenv = e(Ev)'
> mat li eigenv
> svmat eigenv
> l eigenv1 in 1/5
>
> Nick
> [email protected]
>
> Muhammad Ramzan
>
>> how to sun flowwing commands after PCA command.
>>
>> e(Ev)               1 x p matrix of eigenvalues (sorted)
>>       e(L)                p x f matrix of eigenvectors = components
>
> Muhammad Ramzan
>
>>> is there any way to save the eigenvector obtained form pca command.
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/



-- 
Assalam-o-Alaikum







Muhammad Ramzan
Lecturer (Economics)
Pakistan Institute of Development Economics
Islamabad
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index