/* ***************************************************************** */ /* */ /* REFINED ("EXACT") FACTOR SCORE EVALUATION */ /* Idealized Variables (Equation 10) */ /* ---------------------------------------------- */ /* The user makes only two changes to the program (marked in the */ /* code with numbers) before running: */ /* 1. The name of the data set to be analyzed is specified on */ /* the SET subcommand. The variables to be factored (only) */ /* are listed on the "KEEP" subcommand. */ /* 2. Desired options are set on the PROC FACTOR command. */ /* */ /* Note: The item correlation matrix must have an inverse for */ /* this program to run without producing an error. */ /* */ /* ***************************************************************** */ options linesize=132 font='Sasfont' 8 nocenter; data work; set WISC; /* 1 */ keep piccom inform coding simila picara arithm blockd vocabu object compre symbol digits; proc factor data=work m=ml n=4 r=p power=4 scree outstat=fact; /* 2 */ proc standard data=work mean=0 std=1 replace out=zscores; data ItmLabel; set fact; if _type_ = 'SCORE'; proc transpose data=ItmLabel out=ItmLabel; proc iml; reset fw=8 spaces=4; start corr (x, corr); nr=nrow(x); sum=x[+,]; xpx=t(x)*x-t(sum)*sum/nr; s=diag(1/sqrt(vecdiag(xpx))); corr=s*xpx*s; finish corr; use ItmLabel; read all var{_name_} into Item; use fact; read all into ItemCor where(_type_ = 'CORR'); read all into Pattern where(_type_ = 'PATTERN'); Pattern=T(Pattern); nr=nrow(Pattern); nc=ncol(Pattern); read all into FactCor where(_type_ = 'FCORR'); if type(FactCor) = 'U' then FactCor = I(nc); FactCor=FactCor[1:nc,1:nc]; Struct=Pattern*FactCor; use zscores; read all into ZScore; factor=T(DO(1,nc,1)); print , , "**** BEGIN OUTPUT FROM PROC IML **** ", , ; FSCoef=Pattern*inv(t(Pattern)*Pattern); print "Factor Score Coefficients for Items / Factors", Item FSCoef [format=6.3], , ,; MultR=t(Struct)*inv(ItemCor)*Struct; RSQR=vecdiag(MultR); MultR=sqrt(vecdiag(MultR)); MinCor=j(nrow(MultR),1,0); do i=1 to nrow(MultR); MinCor[i] = 2 * MultR[i]**2 - 1; end; print "Indeterminacy / Determinacy Indices", "(Multiple R, R-Squared, and Minimum Correlation)" ,factor MultR [format=6.3] RSQR [format=6.3] MinCor [format=6.3], , ,; C=t(FSCoef)*ItemCor*FSCoef; C=diag(C); C=sqrt(C); Univ=t(Struct)*FSCoef*inv(C); Valid=vecdiag(Univ); print "Validity Coefficients", factor Valid [format=6.3] " compare to MULTR --> " MultR [format=6.3], , ,; do i=1 to nrow(Univ); Univ[i,i] = .; FactCor[i,i] = .; end; print "Univocality", "(Rows = Factor Scores / Columns = Factors)", Univ [format=6.3] " compare to FACTCOR --> " FactCor [format=6.3], , ,; FactScor=ZScore*FSCoef; run corr(FactScor,ScoreCor); do i=1 to nrow(ScoreCor); do j=1 to ncol(ScoreCor); if i < j then do; ScoreCor[i,j] = .; FactCor[i,j] = .; end; FactCor[i,i] = 1; end; end; print "Correlational Accuracy", ScoreCor [format=6.3] " compare to FACTCOR --> " FactCor [format=6.3], , ,; stop; run;