|
NAG[g03ccc] NAG[nag_mv_fac_score] - Factor score coefficients, following g03cac (nag_mv_factor)
|
|
Calling Sequence
g03ccc(method, rotate, fl, psi, e, r, fs, 'nvar'=nvar, 'nfac'=nfac, 'tdfl'=tdfl, 'tdr'=tdr, 'tdfs'=tdfs, 'fail'=fail)
nag_mv_fac_score(. . .)
Parameters
|
method - String;
|
|
|
On entry: indicates which method is to be used to compute the factor score coefficients.
|
|
The regression method is used.
|
|
Bartlett's method is used.
|
|
Constraint: "Nag_FacScoreRegsn" or "Nag_FacScoreBart". .
|
|
|
rotate - String;
|
|
|
On entry: 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: "Nag_FacRotate" or "Nag_FacNoRotate". .
|
|
|
fl - Matrix(1..nvar, 1..tdfl, datatype=float[8], order=C_order);
|
|
|
|
psi - Vector(1..nvar, datatype=float[8]);
|
|
|
Constraint: , for . .
|
|
|
e - Vector(1..nvar, datatype=float[8]);
|
|
|
Constraint: , for . .
|
|
|
r - Matrix(1..nfac, 1..tdr, datatype=float[8], order=C_order);
|
|
|
If then r need not be set.
|
|
|
fs - Matrix(1..nvar, 1..tdfs, datatype=float[8], order=C_order);
|
|
|
|
'nvar'=nvar - integer; (optional)
|
|
|
Default value: the first dimension of the arrays fl, psi, e, fs.
|
|
On entry: the number of observed variables in the factor analysis, .
|
|
Constraint: . .
|
|
|
'nfac'=nfac - integer; (optional)
|
|
|
Default value: the first dimension of the array r and the second dimension of the array rthe arrays fl, r, fs.
|
|
On entry: the number of factors in the factor analysis, .
|
|
Constraint: . .
|
|
|
'tdfl'=tdfl - integer; (optional)
|
|
|
On entry: the second dimension of the array fl as declared in the function from which nag_mv_fac_score (g03ccc) is called.
|
|
Constraint: . .
|
|
|
'tdr'=tdr - integer; (optional)
|
|
|
On entry: the second dimension of the array r as declared in the function from which nag_mv_fac_score (g03ccc) is called.
|
|
Constraint: if then . .
|
|
|
'tdfs'=tdfs - integer; (optional)
|
|
|
On entry: the second dimension of the array fs as declared in the function from which nag_mv_fac_score (g03ccc) is called.
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
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 g03cac (nag_mv_factor).
|
|
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. g03cac (nag_mv_factor) 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 g03cac (nag_mv_factor). Further, for models fitted by g03cac (nag_mv_factor),
where is the diagonal matrix of eigenvalues of the matrix , as described in g03cac (nag_mv_factor).
The factors may be orthogonally rotated using an orthogonal rotation matrix, , as computed by g03bac (nag_mv_orthomax). The factor scores for the rotated matrix are then given by .
|
|
Error Indicators and Warnings
|
|
"NE_2_INT_ARG_LT"
On entry, while . These arguments must satisfy .
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument method had an illegal value.
"NE_INT_ARG_LT"
On entry, nfac must not be less than 1: .
"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 consult NAG for assistance.
"NE_REAL_ARRAY_INPUT"
On entry, . Constraint: .
|
|
Accuracy
|
|
Accuracy will depend on the accuracy requested when computing the estimated factor loadings using g03cac (nag_mv_factor).
|
|
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 g03zac (nag_mv_z_scores). The standardized variables are then post-multiplied by the factor score coefficients. This may be performed using functions from the the f16 Chapter Introduction, for example f06yac (dgemm).
If principal component analysis is required, the function g03aac (nag_mv_prin_comp) computes the principal component scores directly. Hence, the factor score coefficients are not needed.
|
|
|
Examples
|
|
>
|
method := "Nag_FacScoreRegsn":
rotate := "Nag_FacNoRotate":
nvar := 6:
nfac := 2:
tdfl := 2:
tdr := 6:
tdfs := 2:
fl := Matrix([[0.5533188537924777, -0.4285636478848147], [0.5681559456187576, -0.288316551560737], [0.392178168058324, -0.4499647969874733], [0.7404217621764929, 0.2728004512944513], [0.7238701315235975, 0.2113108264190844], [0.5953586397783873, 0.1316911981935991]], datatype=float[8], order='C_order'):
psi := Vector([0.5101714468054328, 0.5940723866877337, 0.6437279642693187, 0.3773554593674207, 0.4313596544519332, 0.6282055268211225], datatype=float[8]):
e := Vector([5.614183301069973, 2.142797556801371, 1.092257889179389, 1.026411127333595, 0.9908235560038346, 0.890507859246269], datatype=float[8]):
r := Matrix([[0.001066610312408062, 0.0001618707508328503, -0.001550656515364506, -0.004776964219129839, 0.01197785893533679, -0.003626650596094117], [0.01902914713847067, -0.03034671030036405, 0.001196371017856065, 0.00138511281983855, -0.02498509986545496, 0.02871220116849313]], datatype=float[8], order='C_order'):
fs := Matrix(6, 2, datatype=float[8], order='C_order'):
NAG:-g03ccc(method, rotate, fl, psi, e, r, fs, 'nvar' = nvar, 'nfac' = nfac, 'tdfl' = tdfl, 'tdr' = tdr, 'tdfs' = tdfs):
|
|
|