Published on :
Statistics CREATION_INTERNE

Documentation Example 3 for PROC FACTOR

This code is also available in: Deutsch Español Français
Awaiting validation
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.
Copied!
1DATA SocioEconomics;
2 INPUT Population School Employment Services HouseValue;
3 DATALINES;
45700 12.8 2500 270 25000
51000 10.9 600 10 10000
63400 8.8 1000 10 9000
73800 13.6 1700 140 25000
84000 12.8 1600 140 25000
98200 8.3 2600 60 12000
101200 11.4 400 10 16000
119100 11.5 3300 60 14000
129900 12.5 3400 180 18000
139600 13.7 3600 390 25000
149600 9.6 3300 80 12000
159400 11.4 4000 100 13000
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!
1ods 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.
Copied!
1PROC FACTOR DATA=SocioEconomics
2 parallel(alpha=0.01 nsims=10000 seed=20170229) map
3 plots=(parallel map);
4RUN;
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.
Copyright Info : S A S S A M P L E L I B R A R Y