nag_mv_fac_score (g03ccc) (PDF version)
g03 Chapter Contents
g03 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_mv_fac_score (g03ccc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_mv_fac_score (g03ccc) computes factor score coefficients from the result of fitting a factor analysis model by maximum likelihood as performed by nag_mv_factor (g03cac).

2  Specification

#include <nag.h>
#include <nagg03.h>
void  nag_mv_fac_score (Nag_FacScoreMethod method, Nag_FacRotation rotate, Integer nvar, Integer nfac, const double fl[], Integer tdfl, const double psi[], const double e[], const double r[], Integer tdr, double fs[], Integer tdfs, NagError *fail)

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. nag_mv_factor (g03cac) 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 nag_mv_factor (g03cac). Further, for models fitted by nag_mv_factor (g03cac),
ΛT Ψ -1 Λ = Θ - I ,
where Θ  is the diagonal matrix of eigenvalues of the matrix S * , as described in nag_mv_factor (g03cac).
The factors may be orthogonally rotated using an orthogonal rotation matrix, R , as computed by nag_mv_orthomax (g03bac). 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  Arguments

1:     methodNag_FacScoreMethodInput
On entry: indicates which method is to be used to compute the factor score coefficients.
method=Nag_FacScoreRegsn
The regression method is used.
method=Nag_FacScoreBart
Bartlett's method is used.
Constraint: method=Nag_FacScoreRegsn or Nag_FacScoreBart.
2:     rotateNag_FacRotationInput
On entry: indicates whether a rotation is to be applied.
rotate=Nag_FacRotate
A rotation will be applied to the coefficients and the rotation matrix, R , must be given in r.
rotate=Nag_FacNoRotate
No rotation is applied.
Constraint: rotate=Nag_FacRotate or Nag_FacNoRotate.
3:     nvarIntegerInput
On entry: the number of observed variables in the factor analysis, p .
Constraint: nvarnfac .
4:     nfacIntegerInput
On entry: the number of factors in the factor analysis, k .
Constraint: nfac1 .
5:     fl[nvar×tdfl]const doubleInput
Note: the i,jth element of the matrix is stored in fl[i-1×tdfl+j-1].
On entry: the matrix of unrotated factor loadings, Λ , as returned by nag_mv_factor (g03cac).
6:     tdflIntegerInput
On entry: the stride separating matrix column elements in the array fl.
Constraint: tdflnfac .
7:     psi[nvar]const doubleInput
On entry: the diagonal elements of Ψ , as returned by nag_mv_factor (g03cac).
Constraint: psi[i-1] > 0.0 , for i=1,2,,p.
8:     e[nvar]const doubleInput
On entry: the eigenvalues of the matrix S * , as returned by nag_mv_factor (g03cac).
Constraint: e[i-1] > 1.0 , for i=1,2,,p.
9:     r[nfac×tdr]const doubleInput
Note: the i,jth element of the matrix R is stored in r[i-1×tdr+j-1].
On entry: if rotate=Nag_FacRotate, then r must contain the orthogonal rotation matrix, R , as returned by nag_mv_orthomax (g03bac).
If rotate=Nag_FacNoRotate then r need not be set.
10:   tdrIntegerInput
On entry: the stride separating matrix column elements in the array r.
Constraint: if rotate=Nag_FacRotate then tdrnfac .
11:   fs[nvar×tdfs]doubleOutput
On exit: the matrix of factor score coefficients, Φ . fs[i-1×tdfs+j-1]  contains the factor score coefficient for the j th factor and the i th observed variable, for i=1,2,,p and j=1,2,,k.
12:   tdfsIntegerInput
On entry: the stride separating matrix column elements in the array fs.
Constraint: tdfsnfac .
13:   failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_2_INT_ARG_ENUM_CONS
On entry, tdr=value  while nfac=value  and rotate=Nag_FacRotate. These arguments must satisfy tdrnfac  when rotate=Nag_FacRotate.
NE_2_INT_ARG_LT
On entry, nvar=value  while nfac=value . These arguments must satisfy nvarnfac .
On entry, tdfl=value  while nfac=value . These arguments must satisfy tdflnfac .
On entry, tdfs=value  while nfac=value . These arguments must satisfy tdfsnfac .
NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_BAD_PARAM
On entry, argument method had an illegal value.
On entry, argument rotate had an illegal value.
NE_INT_ARG_LT
On entry, nfac=value.
Constraint: nfac1.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_REAL_ARRAY_INPUT
On entry, e[value] = value.
Constraint: e[value] > 1.0 .
On entry, psi[value] = value.
Constraint: psi[value] > 0.0 .

7  Accuracy

Accuracy will depend on the accuracy requested when computing the estimated factor loadings using nag_mv_factor (g03cac).

8  Parallelism and Performance

Not applicable.

9  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 nag_mv_z_scores (g03zac). The standardized variables are then post-multiplied by the factor score coefficients. This may be performed using functions from the f16 Chapter Introduction, for example nag_dgemm (f16yac).
If principal component analysis is required, the function nag_mv_prin_comp (g03aac) computes the principal component scores directly. Hence, the factor score coefficients are not needed.

10  Example

The 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 nag_mv_factor (g03cac). The factor score coefficients are computed using the regression method.

10.1  Program Text

Program Text (g03ccce.c)

10.2  Program Data

Program Data (g03ccce.d)

10.3  Program Results

Program Results (g03ccce.r)


nag_mv_fac_score (g03ccc) (PDF version)
g03 Chapter Contents
g03 Chapter Introduction
NAG Library Manual

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