G03CCF (PDF version)
G03 Chapter Contents
G03 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

G03CCF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

G03CCF computes factor score coefficients from the result of fitting a factor analysis model by maximum likelihood as performed by G03CAF.

2  Specification

SUBROUTINE G03CCF ( METHOD, ROTATE, NVAR, NFAC, FL, LDFL, PSI, E, R, LDR, FS, LDFS, WK, IFAIL)
INTEGER  NVAR, NFAC, LDFL, LDR, LDFS, IFAIL
REAL (KIND=nag_wp)  FL(LDFL,NFAC), PSI(NVAR), E(NVAR), R(LDR,*), FS(LDFS,NFAC), WK(NVAR)
CHARACTER(1)  METHOD, ROTATE

3  Description

A factor analysis model aims to account for the covariances among p variables, observed on n individuals, in terms of a smaller number, k, of unobserved variables or factors. The values of the factors for an individual are known as factor scores. G03CAF fits the factor analysis model by maximum likelihood and returns the estimated factor loading matrix, Λ, and the diagonal matrix of variances of the unique components, Ψ. To obtain estimates of the factors, a p by k matrix of factor score coefficients, Φ, is formed. The estimated vector of factor scores, f^, is then given by:
f^=xTΦ,
where x is the vector of observed variables for an individual.
There are two commonly used methods of obtaining factor score coefficients.
The regression method:
Φ=Ψ-1ΛI+ΛTΨ-1Λ -1,
and Bartlett's method:
Φ=Ψ-1ΛΛTΨ-1Λ -1.
See Lawley and Maxwell (1971) for details of both methods. In the regression method as given above, it is assumed that the factors are not correlated and have unit variance; this is true for models fitted by G03CAF. Further, for models fitted by G03CAF,
ΛTΨ-1Λ=Θ-I,
where Θ is the diagonal matrix of eigenvalues of the matrix S*, as described in G03CAF.
The factors may be orthogonally rotated using an orthogonal rotation matrix, R, as computed by G03BAF. The factor scores for the rotated matrix are then given by ΛR.

4  References

Lawley D N and Maxwell A E (1971) Factor Analysis as a Statistical Method (2nd Edition) Butterworths

5  Parameters

1:     METHOD – CHARACTER(1)Input
On entry: indicates which method is to be used to compute the factor score coefficients.
METHOD='R'
The regression method is used.
METHOD='B'
Bartlett's method is used.
Constraint: METHOD='B' or 'R'.
2:     ROTATE – CHARACTER(1)Input
On entry: indicates whether a rotation is to be applied.
ROTATE='R'
A rotation will be applied to the coefficients and the rotation matrix, R, must be given in R.
ROTATE='U'
No rotation is applied.
Constraint: ROTATE='R' or 'U'.
3:     NVAR – INTEGERInput
On entry: p, the number of observed variables in the factor analysis.
Constraint: NVARNFAC.
4:     NFAC – INTEGERInput
On entry: k, the number of factors in the factor analysis.
Constraint: NFAC1.
5:     FL(LDFL,NFAC) – REAL (KIND=nag_wp) arrayInput
On entry: Λ, the matrix of unrotated factor loadings as returned by G03CAF.
6:     LDFL – INTEGERInput
On entry: the first dimension of the array FL as declared in the (sub)program from which G03CCF is called.
Constraint: LDFLNVAR.
7:     PSI(NVAR) – REAL (KIND=nag_wp) arrayInput
On entry: the diagonal elements of Ψ, as returned by G03CAF.
Constraint: PSIi>0.0, for i=1,2,,p.
8:     E(NVAR) – REAL (KIND=nag_wp) arrayInput
On entry: the eigenvalues of the matrix S*, as returned by G03CAF.
Constraint: Ei>1.0, for i=1,2,,p.
9:     R(LDR,*) – REAL (KIND=nag_wp) arrayInput
Note: the second dimension of the array R must be at least 1 if ROTATE='U' and at least NFAC if ROTATE='R'.
On entry: if ROTATE='R', R must contain the orthogonal rotation matrix, R, as returned by G03BAF.
If ROTATE='U', R need not be set.
10:   LDR – INTEGERInput
On entry: the first dimension of the array R as declared in the (sub)program from which G03CCF is called.
Constraints:
  • if ROTATE='R', LDRNFAC;
  • otherwise 1.
11:   FS(LDFS,NFAC) – REAL (KIND=nag_wp) arrayOutput
On exit: the matrix of factor score coefficients, Φ. FSij contains the factor score coefficient for the jth factor and the ith observed variable, for i=1,2,,p and j=1,2,,k.
12:   LDFS – INTEGERInput
On entry: the first dimension of the array FS as declared in the (sub)program from which G03CCF is called.
Constraint: LDFSNVAR.
13:   WK(NVAR) – REAL (KIND=nag_wp) arrayWorkspace
14:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
On entry,NFAC<1,
orNVAR<NFAC,
orLDFL<NVAR,
orLDFS<NVAR,
orROTATE='R' and LDR<NFAC,
orMETHOD'R' or 'B',
orROTATE'R' or 'U'.
IFAIL=2
On entry,a value of PSI0.0,
ora value of E1.0.

7  Accuracy

Accuracy will depend on the accuracy requested when computing the estimated factor loadings using G03CAF.

8  Further Comments

To compute the factor scores using the factor score coefficients the values for the observed variables first need to be standardized by subtracting the sample means and, if the factor analysis is based upon a correlation matrix, dividing by the sample standard deviations. This may be performed using G03ZAF. The standardized variables are then post-multiplied by the factor score coefficients. This may be performed using routines from Chapter F06, for example F06YAF (DGEMM).
If principal component analysis is required the routine G03AAF computes the principal component scores directly. Hence, the factor score coefficients are not needed.

9  Example

This example is taken from Lawley and Maxwell (1971). The correlation matrix for 220 observations on six school subjects is input and a factor analysis model with two factors fitted using G03CAF. The factor score coefficients are computed using the regression method.

9.1  Program Text

Program Text (g03ccfe.f90)

9.2  Program Data

Program Data (g03ccfe.d)

9.3  Program Results

Program Results (g03ccfe.r)


G03CCF (PDF version)
G03 Chapter Contents
G03 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012