Page 1 of 1

Extracting Principal Components via code

Posted: Fri Mar 10, 2017 12:58 am
by saranya
Hi,

I use the below code to get the principal components which satisfy the condition of min eigen to not fall below 1:
freeze(tab) all.pcomp(cov=cov, mineigen=1, eigval=eval, eigvec=evec)

Now, I want the code to determine how many principal components are extracted with this criterion. Is there a way to do it via code, rather than analysing the table per se?

Re: Extracting Principal Components via code

Posted: Fri Mar 10, 2017 8:27 am
by EViews Gareth
Can't you just test the length of the eval vector?
!num = @rows(eval)

Re: Extracting Principal Components via code

Posted: Wed Mar 15, 2017 11:25 pm
by saranya
The length of the eval vector is always equal to the total number of variables/ Principal components. It is not dependent on the cumulative proportion that one mentions in the code. :(

Re: Extracting Principal Components via code

Posted: Fri Mar 17, 2017 9:50 am
by EViews Glenn

Code: Select all

!numge1 = @ege(eval, @ones(eval.@rows))

Re: Extracting Principal Components via code

Posted: Mon Mar 20, 2017 4:53 am
by saranya
Thanks Glenn! Works perfect :)