- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use ODS OUTPUT (ODS = Output Delivery System) ...
- ODS Output FinalCommunWgt = work.FinalCommunWgt ;
(or maybe another table ... the one containing what you want)
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_factor_details15.htm
By Rick Wicklin on The DO Loop December 11, 2023
https://blogs.sas.com/content/iml/2023/12/11/polychoric-correlation.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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).