This script illustrates how to use PROC FACTOR with PARALLEL and PLOTS options for factor analysis. It creates an internal dataset, 'SocioEconomics', then applies PROC FACTOR to analyze the provided variables, including a parallel scree plot test to help identify the optimal number of factors. The reference for this method is Harman (1976), Modern Factor Analysis, 3rd edition.
Data Analysis
Type : CREATION_INTERNE
The 'SocioEconomics' dataset is created directly in the SAS script using a DATA step with in-line data (datalines).
1 Code Block
DATA STEP Data
Explanation : This block creates the 'SocioEconomics' dataset which contains demographic and economic information. Variables include Population, School, Employment, Services, and House Value. Data is entered directly into the script via the DATALINES statement.
INPUT Population School Employment Services HouseValue;
3
DATALINES;
4
570012.8250027025000
5
100010.96001010000
6
34008.81000109000
7
380013.6170014025000
8
400012.8160014025000
9
82008.326006012000
10
120011.44001016000
11
910011.533006014000
12
990012.5340018018000
13
960013.7360039025000
14
96009.633008012000
15
940011.4400010013000
16
;
2 Code Block
ODS
Explanation : This statement activates the ODS Graphics system, enabling the generation of high-quality graphics from SAS procedures, particularly for visualizing PROC FACTOR results.
Copied!
ods graphics on;
1
ods graphics on;
3 Code Block
PROC FACTOR
Explanation : This block executes the FACTOR procedure on the 'SocioEconomics' dataset. The `parallel` option requests a parallel scree plot test to help determine the number of factors. `alpha=0.01` sets the significance level, `nsims=10000` the number of simulations, and `seed` the seed for reproducibility. The `map` option and `plots=(parallel map)` request specific graphics, including the parallel scree plot and the MAP (Minimum Average Partial) for visual decision aid.
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.