r - how to program factoranalysis iterations -
r - how to program factoranalysis iterations -
currently i'm busy new type of factor analysis. created next binary operators:
%m% calculates square positive definite symmetric matrix r dataframe
%e% calculates communality estimates , places these on main diagonal of square matrix m
%f% extracts 1 factor @ time new square matrix
%r% reproduce new square matrix factor loadings of %f% , subtracts original matrix
this 1 cycle. steps 2 4 duplicated residuals,%f% extracts sec factor, %r% reproduces new matrix, etc. in fashion finish procedure (steps 2 - 4 , 2 - 4) successively applied smaller , smaller matrices.
my question is: how can programme these iterations in r? clearly, in each iteration step 4 input new cycle step 2 step 4 in next iteration.
some r - code use:
iterationsres= a%m%lg3 est= res%e%5 f1= est%f%1 res= f1%r%est est= res%e%5 f2= est%f%1 res= f2%r%est est= res%e%5 f3= est%f%1 res= f3%r%est
a= r dataframe, lg3 new bivariate log3 consensus coefficient.
i welcome chance inquire help.
regards,
luc
you utilize while
loop, think:
while(..some stopping criteria..) { est <- res %e% 5 res <- est %f% 1 %r% est }
if wanted run 4 times, add together counter
for(i in 1:4) { est <- res %e% 5 res <- est %f% 1 %r% est }
r
Comments
Post a Comment