*note: In the input statement-- s=number of factors tchisq_b=SAS chi-square for testing that s factors are sufficient (goodness of fit for the target model tdf=df for target model nchisq_b=SAS chi-square for testing that no common factors are sufficient (goodness of fit for the null model ndf=df for null model sasrmr=root mean square residual from SAS N=sample size q=number of observed variables.; data; input s tchisq_b tdf nchisq_b ndf sasrmr N q ; tchisq=(N-1)/(N-1-(2*q+5)/6-2*s/3)*tchisq_b; disc=tchisq/(N-1); pdischat=disc-(tdf/(N-1)); if pdischat < 0 then pdischat=0; rmsea=sqrt(pdischat/tdf); pexact=1-probchi(tchisq,tdf); pclose=1-probchi(tchisq,tdf,.0025*(N-1)*tdf); ecvi=(tchisq+(q*(q+1))-2*tdf)/(n-1); ecvis=q*(q+1)/(n-2-q); chisqdif=lag(tchisq)-tchisq; dfdif=lag(tdf)-tdf; pdif=1-probchi(chisqdif,dfdif); lt=tchisq-tdf; nchisq=(N-1)/(N-1-(2*q+5)/6)*nchisq_b; ln=nchisq-ndf; lttil=max(lt,0); lntil=max(lt,ln,0); cfi=1-lttil/lntil; srmr=sqrt((q-1)/(q+1))*sasrmr; tli=(nchisq/ndf-tchisq/tdf)/(nchisq/ndf-1); nfactor=s; nvar=q; format srmr ecvi ecvis cfi pclose pexact pdif dfdif rmsea tli 9.4; cards; 1 581.5044 35 1420.5982 45 0.12524960 144 10 2 366.8144 26 1420.5982 45 0.09410718 144 10 proc print ; var nfactor nvar nchisq ndf tchisq tdf pexact chisqdif dfdif pdif srmr rmsea pclose tli cfi; run;