Factor Analysis: Rolling Loadings

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

gabictfer
Posts: 2
Joined: Mon May 02, 2016 5:03 pm

Factor Analysis: Rolling Loadings

Postby gabictfer » Mon May 02, 2016 5:10 pm

Hello, I really need your help.

I want to do a rolling estimation of Factor Analysis, and store the loadings, together with score and uniqueness, for a single variable (which is the second in the group). The scores and uniqueness work fine, but I am completely unable to store the loadings, tried everything.

Here is my code as of now (I'm no genius programmer). I need a vector storing the rolling loadings for Factor 1, for variable number 2.

Code: Select all

!window = 300 !length = @obsrange !nrolls = (!length-!window) vector(!nrolls) fatorg vector(!nrolls) uniquenessg !counter=1 for !i = 1 to !nrolls smpl @first+!i @first+!i+!window factor meufatorg.ml(n=4) group_dcds meufatorg.scores(type="exact",coefout="mattesteg",unrotated) fatorg(!counter)=mattesteg(2,1) uniquenessg(!counter)=meufatorg.@unique(2) !counter=!counter+1 next
Thanks a lot!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Factor Analysis: Rolling Loadings

Postby EViews Gareth » Tue May 03, 2016 12:06 am

You can do something like:

Code: Select all

Matrix temp = meufatorg.@loadings colplace(loadingsmat, temp.@col(2), !counter)
inside your loop, where loadingsmat is a matrix you defined outside of the loop.


Return to “Programming”

Who is online

Users browsing this forum: JMviews and 1 guest