Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
emaneman
Pyrite | Level 9

Hello all,

 

I am conducting a factor analysis on a matrix of tetrachoric correlations (since my vars are binary).

I create the matrix using PROC CORR, and then use that as input dataset for PROC FACTOR.

I would like, however, compute factor scores for the two factors that I extract, and have them added to the original dataset (DATA).

Proc factor does not do that when the input is not raw data but a matrix of correlations. I can of course extract coefficients, and then do it "manually". 

Is there a way to do this automatically?

Syntax below.

Thank you all in advance.

Eman

 

proc corr data = DATA polychoric out=TETCORR;
var x1-x10;

proc factor data=TETCORR (type=corr) nfactors=2 method=prin rotate=oblimin ;
var x1-x10;

1 ACCEPTED SOLUTION

Accepted Solutions
emaneman
Pyrite | Level 9

CORRECTION

 

In the previous post the syntax for PROC CORR contained a mistake.

The option to output the correlation matrix should be:

OUTPLC=TETCORR (instead of out=TETCORR).

View solution in original post

3 REPLIES 3
sbxkoenk
SAS Super FREQ
emaneman
Pyrite | Level 9

hello Koen,

 

thanks for your feedback. What I need cannot be directly outputted by the PROC FACTOR in my case, since I use a matrix of correlation and not raw data. 

 

I think, however, that i have found the solution. The last file produced(FATSCORE2) in the following sequence includes the factor scores for factor 1 and factor 2.

 

 

proc corr data = DATA polychoric out=TETCORR noprint;
var x1-x10;

proc factor data=TETCORR (type=corr) nfactors=2 method=prin rotate=oblimin score outstat=P2 ;
var x1-x10;

 

PROC STANDARD DATA=DATA MEAN=0 STD=1 OUT=DATAst;
VAR
var x1-x10;

 

proc score data=DATAst score=P2 out=FATSCORE2;
var x1-x10;
run;

 

emaneman
Pyrite | Level 9

CORRECTION

 

In the previous post the syntax for PROC CORR contained a mistake.

The option to output the correlation matrix should be:

OUTPLC=TETCORR (instead of out=TETCORR).

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 756 views
  • 1 like
  • 2 in conversation