I'm trying to run a SAS code on a large dataset with 187 variables and 12927 observations as follows:
proc factor data=dealer_vars_imputed scree nfactors=5 out=all_dealers r=varimax method=ml; run;
Apparently, method = ml requires a "non-singular correlation matrix" and I'm getting an error for it too. I'm not too sure about what that is and what exactly I'm supposed to do. Can someone help me out with this?
In the Cautions section of proc FACTOR documentation it says:
Singular correlation matrices cause problems with the options PRIORS=SMC and METHOD=ML. Singularities can result from using a variable that is the sum of other variables, coding too many dummy variables from a classification variable, or having more variables than observations.
Those are three things to look for.
Edit: Well, two things, actually, since you have more obs than variables, unless a great number of observations were excluded because of missing values.
In the Cautions section of proc FACTOR documentation it says:
Singular correlation matrices cause problems with the options PRIORS=SMC and METHOD=ML. Singularities can result from using a variable that is the sum of other variables, coding too many dummy variables from a classification variable, or having more variables than observations.
Those are three things to look for.
Edit: Well, two things, actually, since you have more obs than variables, unless a great number of observations were excluded because of missing values.
I do have quite a few dummy variables so I guess that makes sense! I'll look into that. Thank you so much for your answer!
Why do you want to do factor analysis on data that has lots of dummy variables? Usually, you want to do factor analysis of continuous variables only, that makes more sense to me.
But, you can use PROC PRINQUAL to do something similar, which is specifically designed to work with categorical variables (and you don't have to specifically create the dummy variables first) as well as continuous variables.
Hi! Thanks for the response! All the variables in my dataset are continuous now but I still seem to be getting the same error
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.