PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_mv_factor_score (g03cc)
Purpose
nag_mv_factor_score (g03cc) computes factor score coefficients from the result of fitting a factor analysis model by maximum likelihood as performed by
nag_mv_factor (g03ca).
Syntax
[
fs,
ifail] = g03cc(
method,
rotate,
fl,
psi,
e,
r, 'nvar',
nvar, 'nfac',
nfac)
[
fs,
ifail] = nag_mv_factor_score(
method,
rotate,
fl,
psi,
e,
r, 'nvar',
nvar, 'nfac',
nfac)
Description
A factor analysis model aims to account for the covariances among
variables, observed on
individuals, in terms of a smaller number,
, of unobserved variables or factors. The values of the factors for an individual are known as factor scores.
nag_mv_factor (g03ca) 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
by
matrix of factor score coefficients,
, is formed. The estimated vector of factor scores,
, is then given by:
where
is the vector of observed variables for an individual.
There are two commonly used methods of obtaining factor score coefficients.
The regression method:
and Bartlett's method:
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 (g03ca). Further, for models fitted by
nag_mv_factor (g03ca),
where
is the diagonal matrix of eigenvalues of the matrix
, as described in
nag_mv_factor (g03ca).
The factors may be orthogonally rotated using an orthogonal rotation matrix,
, as computed by
nag_mv_rot_orthomax (g03ba). The factor scores for the rotated matrix are then given by
.
References
Lawley D N and Maxwell A E (1971) Factor Analysis as a Statistical Method (2nd Edition) Butterworths
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Indicates which method is to be used to compute the factor score coefficients.
- The regression method is used.
- Bartlett's method is used.
Constraint:
or .
- 2:
– string (length ≥ 1)
-
Indicates whether a rotation is to be applied.
- A rotation will be applied to the coefficients and the rotation matrix, , must be given in r.
- No rotation is applied.
Constraint:
or .
- 3:
– double array
-
ldfl, the first dimension of the array, must satisfy the constraint
.
, the matrix of unrotated factor loadings as returned by
nag_mv_factor (g03ca).
- 4:
– double array
-
The diagonal elements of
, as returned by
nag_mv_factor (g03ca).
Constraint:
, for .
- 5:
– double array
-
The eigenvalues of the matrix
, as returned by
nag_mv_factor (g03ca).
Constraint:
, for .
- 6:
– double array
-
The first dimension,
, of the array
r must satisfy
- if , ;
- otherwise .
The second dimension of the array
r must be at least
if
and at least
if
.
If
,
r must contain the orthogonal rotation matrix,
, as returned by
nag_mv_rot_orthomax (g03ba).
If
,
r need not be set.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the arrays
psi,
e and the first dimension of the array
fl. (An error is raised if these dimensions are not equal.)
, the number of observed variables in the factor analysis.
Constraint:
.
- 2:
– int64int32nag_int scalar
-
Default:
the second dimension of the array
fl.
, the number of factors in the factor analysis.
Constraint:
.
Output Parameters
- 1:
– double array
-
The matrix of factor score coefficients, .
contains the factor score coefficient for the th factor and the th observed variable, for and .
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
On entry, | , |
or | , |
or | , |
or | , |
or | and , |
or | or , |
or | or . |
-
-
On entry, | a value of , |
or | a value of . |
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
Accuracy will depend on the accuracy requested when computing the estimated factor loadings using
nag_mv_factor (g03ca).
Further Comments
If principal component analysis is required the function
nag_mv_prin_comp (g03aa) computes the principal component scores directly. Hence, the factor score coefficients are not needed.
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
nag_mv_factor (g03ca). The factor score coefficients are computed using the regression method.
Open in the MATLAB editor:
g03cc_example
function g03cc_example
fprintf('g03cc example results\n\n');
matrix = 'C';
n = int64(220);
x = [1.000 0.439 0.410 0.288 0.329 0.248;
0.439 1.000 0.351 0.354 0.320 0.329;
0.410 0.351 1.000 0.164 0.190 0.181;
0.288 0.354 0.164 1.000 0.595 0.470;
0.329 0.320 0.190 0.595 1.000 0.464;
0.248 0.329 0.181 0.470 0.464 1.000];
nvar = int64(size(x,1));
isx = ones(nvar,1,'int64');
nfac = int64(2);
iop = [int64(1); -1; 500; 3; 5];
[e, stat, com, psi, res, fl, ifail] = ...
g03ca( ...
matrix, n, x, nvar, isx, nfac, iop);
fprintf(' Loadings, Communalities and Psi\n\n');
for i = 1:nvar
fprintf('%8.3f', fl(i,1:nfac), com(i), psi(i));
fprintf('\n');
end
method = 'R';
rotate = 'U';
r = [0];
[fs, ifail] = g03cc( ...
method, rotate, fl, psi, e, r);
mtitle = 'Factor score coefficients';
matrix = 'General';
diag = ' ';
fprintf('\n');
[ifail] = x04ca( ...
matrix, diag, fs, mtitle);
g03cc example results
Loadings, Communalities and Psi
0.553 -0.429 0.490 0.510
0.568 -0.288 0.406 0.594
0.392 -0.450 0.356 0.644
0.740 0.273 0.623 0.377
0.724 0.211 0.569 0.431
0.595 0.132 0.372 0.628
Factor score coefficients
1 2
1 0.1932 -0.3920
2 0.1703 -0.2265
3 0.1085 -0.3262
4 0.3495 0.3374
5 0.2989 0.2286
6 0.1688 0.0978
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015