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
