EFA Procedure

Example 10.1 Estimating the Number of Factors or Components

(View the complete code for this example.)

This example shows how to use the EFA procedure to estimate either the number of common factors or the number of principal components that are likely to explain the observed correlations in a data set. It uses the simulated testdata data set that is described in the examples for the Principal Component Analysis action set in SAS Visual Statistics software. The data table is the result of multiplying two low-rank matrices, and , and adding random noise.

To create the data table testdata, you can modify the DATA step that is used in the Principal Component Analysis action set documentation. For this example, it is assumed that your libref is named mylib, but you can substitute any appropriately defined libref.

In this example, you want to determine how many latent factors are needed to explain the variation in the input data. The following statements perform this analysis:

proc efa data=mylib.testdata method=none;
   nfactors type=eigenvalue;
   nfactors type=proportion threshold=0.9;
run;

When you use PROC EFA to suggest the number of latent dimensions, you specify one or more NFACTORS statements. Each NFACTORS statement describes a criterion that is used to determine the number of factors to retain.

In this example, you specify two criteria. The first criterion is the eigenvalue criterion. This criterion is based on the eigenvalues of the reduced correlation matrix (that is, the correlation matrix of the input data, but with the diagonal elements replaced by the prior communality estimates). By default, any eigenvalue greater than 1 is assumed to indicate the existence of a latent factor. You can use the THRESHOLD= option to specify a threshold value to use instead of the default value.

The second criterion that you specify is the proportion criterion. This criterion is based on the cumulative fraction of the common variance of the input data set that is explained by the latent factors that correspond to each eigenvalue. In this example, you use the THRESHOLD= option to specify a threshold value of 0.9. At this threshold, the number of factors that the proportion criterion suggests is the smallest number of factors that are necessary to explain 90% of the common variance of the input data set.

By default, PROC EFA uses squared multiple correlations (SMC) for the prior communality estimates. This means that the prior communality estimate for each variable is the squared multiple correlation of that variable with all other variables. The prior communalities are placed on the diagonal of the data correlation matrix before the eigenvalues of that matrix are computed. You can use the PRIORS= option to specify different prior communality estimates.

The "Number of Observations" table in Output 10.1.1 summarizes the number of observations that are read from the input data table and the number of observations that are used for the analysis. For this analysis, these two numbers are the same. These numbers would be different if some observations were discarded from the analysis. PROC EFA uses only complete cases for analysis, so a record is discarded if any field contains a missing value.

Output 10.1.1: Number of Observations

The EFA Procedure

Number of Observations Read1000000
Number of Observations Used1000000


The "Simple Statistics" table in Output 10.1.2 summarizes the means and standard deviations of the variables that are included in the analysis.

Output 10.1.2: Simple Statistics

Simple Statistics
VariableMeanStandard
Deviation
x10.000519582.03642
x20.001713.04429
x3-0.000361701.25872
x40.001941.79332
x50.000580281.47249
x6-0.000838521.52032
x70.002301.83223
x8-0.003572.30643
x9-0.000228352.13378
x100.001603.40267


The primary output of the analysis is shown in the "Determination of Number of Factors" table in Output 10.1.3. In this analysis, the results for both specified criteria suggest that three latent factors are sufficient to describe the input data.

In general, when you specify multiple criteria, PROC EFA must combine the results from all the active criteria to form a final estimate for the number of factors. By default, PROC EFA uses the minimum number of factors among all the active criteria. You can use the NFACTORS= option to specify a different method to obtain a final estimate. You can use the STATUS= option to change a criterion from active to inactive.

A footnote at the bottom of the table summarizes the minimum and maximum number of factors that are determined by the active criteria. It also summarizes the mean and median values of these numbers. In this analysis, the two criteria suggest the same number of latent factors, so all four summary values are the same. Thus the final result of this analysis is that three factors should be retained.

Output 10.1.3: Number of Factors

Determination of Number of Factors
CriterionDescriptionFactors
1Minimum Eigenvalue (Eigenvalue > 1.00)3
2Total Proportion (Threshold = 0.90)3
Min = 3, Max = 3, Mean = 3, Median = 3


Additional information about the eigenvalue and proportion criteria is presented in the "Eigenvalues of the Reduced Correlation Matrix" table in Output 10.1.4. For the proportion criteria, the number of factors is the minimum number that is required in order for the cumulative common variance to meet or exceed the user-specified threshold. The table shows that three factors are sufficient to explain approximately 93% of the cumulative common variance in the original data. Thus the proportion criterion with the option value THRESHOLD=0.90 produces an estimate of three factors. For the eigenvalue criterion, the third-largest eigenvalue is larger than 1.5, whereas the fourth-largest eigenvalue is much smaller than 1.0. For this reason, the eigenvalue criterion that is specified in this analysis suggests that three factors should be retained.

Output 10.1.4: Eigenvalues and Variance Explained

Eigenvalues of the Reduced Correlation Matrix
 EigenvalueDifferenceProportionCumulative
15.8225733.9246040.58500.5850
21.8979690.3335070.19070.7757
31.5644620.8868260.15720.9329
40.6776360.6784390.06811.0009
5-0.0008040.000258-0.00011.0009
6-0.0010620.000542-0.00011.0008
7-0.0016040.000082164-0.00021.0006
8-0.0016860.000107-0.00021.0004
9-0.0017940.000669-0.00021.0002
10-0.002462 -0.00021.0000


In addition to estimating the number of latent factors, you can also use PROC EFA to estimate the number of principal components that are needed to approximate an input data set. For example, you might want to determine how many components you need to retain to approximate a prespecified proportion of the total variance in the original data set. The following statements perform this analysis:

proc efa data=mylib.testdata method=none priors=one;
   nfactors type=proportion threshold=0.90;
   nfactors type=proportion threshold=0.95;
   nfactors type=proportion threshold=0.99;
run;

These statements demonstrate how you can specify three different threshold values for the proportion criterion. Each of these threshold values is applied separately to estimate the number of factors in the input data set. The specification of multiple threshold values is a useful technique to assess the degree to which the analysis results are robust to different threshold values.

In this analysis, the PRIORS=ONE option is used to specify that the prior communality estimates for all variables should be set to 1. When you specify this option value, PROC EFA estimates the number of principal components that are needed to approximate the input data set.

The "Number of Observations" and "Simple Statistics" tables for this analysis are identical to those in the previous analysis. The "Determination of Number of Factors" table is shown in Output 10.1.5. Of the three specified threshold values, the first value produces an estimate that three factors should be retained, and the remaining two criteria produce estimates that four factors should be retained.

Output 10.1.5: Number of Factors

The EFA Procedure

Determination of Number of Factors
CriterionDescriptionFactors
1Total Proportion (Threshold = 0.90)3
2Total Proportion (Threshold = 0.95)4
3Total Proportion (Threshold = 0.99)4
Min = 3, Max = 4, Mean = 4, Median = 4


Additional information about the number of components that are suggested by these three criteria is presented in the "Eigenvalues of the Correlation Matrix" table in Output 10.1.6. As in the previous analysis, the proportion criterion examines the cumulative variance explained by eigenvalues and corresponding principal components. For this analysis, the principal components that correspond to the three largest eigenvalues explain just under 93% of the total variance of the input data set. Thus, an estimate of three components is obtained when you set the threshold value to 0.9. When you add a fourth component, the cumulative variance explained exceeds 99%, so that four components are estimated when you set the THRESHOLD= option to 0.95 or 0.99.

Output 10.1.6: Eigenvalues and Variance Explained

Eigenvalues of the Correlation Matrix
 EigenvalueDifferenceProportionCumulative
15.8272383.9246510.58270.5827
21.9025870.3331700.19030.7730
31.5694170.8874900.15690.9299
40.6819270.6764560.06820.9981
50.0054710.0010570.00050.9987
60.0044140.0012090.00040.9991
70.0032050.0008000.00030.9994
80.0024050.0006280.00020.9997
90.0017770.0002180.00020.9998
100.001559 0.00021.0000


Last updated: June 22, 2026