toby989 schrieb:
> Hi All
Hi toby -
I couldn't read the SAS-statements in detail. Just one aspect,
which may be not considered, but may be understood better,
when expressed in terms of rotation.
The initial factor solution is often simply a principal
components/principal factors approach, which will iteratively
enhanced with respect to the new communalities.
In the view of rotations-to-pc/pf-position it gives different
solutions, if you
1) use correlation - rotate to pc/pf
- unstandardize factors according to the covariances/stddevs
2) use covariances - rotate to pc/pf directly.
In the second case the more-deviant variables have more weight
for determining the position of the pc/pf-solution than the less-
deviant variables.
BTW, the ML-estimation, which is often engaged, uses the THETA_U
matrix for rescaling - *before* factoring. In such cases the
methods 1) and 2) converge. It uses something like
S1 = theta_U * S * theta_u
(or inverse of theta_u or of its squareroot)
Maybe, the difference could simply occur corresponding to the
1),2)-methods I noted above. This difference may occur
similarly, if you either
* compute sdevs, use corr, factorize, multiply factor-loadings by sdevs
* use cov, factorize preserving the sdevs by loadings, whose squares
accumulate to sdev�<>1
I couldn't get it precisely, which option you applied.
Anyway, hope I got your problems well...
expressed my thoughts clearly ...
and HTH -
:-)
Gottfried Helms
ps.: if my remarks do not suffice, just send an example with data.
>
> To better understand the factor analysis (FA) based on the covariance
> matrix better, I want to replicate more manually what my satistics
> software package (SAS/STAT) outputs. To do that I used interactive
> matrix language (SAS/IML). Independent from the specific syntax of this
> lanuage, I dont have access to the specific formulas I need to do FA on
> the covariance matrix. However, I was sucessful in replicating the FA
> output of the package using the correlation matrix. It would be very
> helpful, and I would greatly appreciate if one could look over my
> partially correct partially incorrect (in comparison to the package
> output) formulas that I used. Thanks a lot.
>
> Bye Toby
>
>
>
> Comment: The prior communality estimates are different than SAS/STAT
> proc factor uses, however, I think it doesnt too much since both
> (SAS/STAT proc factor and the eigvec and eigval functions of my SAS/IML
> code) converged to the same eigenvalues and eigenvectors.
>
> The problem may be in calculation the factor pattern.
>
>
>
>
>
> proc iml;
> use datafile;
> read all var _all_ into X;
>
> /*sample size n (1x1)*/
> n = nrow (X);
>
> /*number of variables in the dataset (1x1)*/
> p = ncol (X);
>
> /*just a n x n square matrix full of 1 (nxn)*/
> J = shape (1, n, n);
>
> /*mean centered data matrix (nxp)*/
> Xd = X - (J / n)` * X;
> reset print;
>
> /*variance covariance matrix of the datamatrix (pxp)*/
> S = (1 / (n - 1)) * Xd` * Xd;
>
> /*diag matrix of prior communality estimates/squared multiple
> correlations (pxp) (not the same as the SAS/STAT proc factor yields)*/
> thetau = diag (1 - (1 / (S ** (-1))));
>
> /*reduced variance covariance matrix (by 1 - prior communality
> estimates) (i is an identity matrix of pxp) (pxp)*/
> Sr = S - (i (p) - thetau);
>
> /*eigenvalues of the reduced variance covariance matrix (px1) (match
> with SAS/STAT proc factor output)*/
> lambdal = eigval (Sr);
>
> /*eigenvectors of the reduced variance covariance matrix (pxp) match
> with SAS/STAT proc factor output)*/
> U = eigvec (Sr);
>
> /*diagonal matrix of eigenvalues (pxp)*/
> D = diag (lambdal);
>
> /*trace of diagonal matrix of eigenvalues (1x1)*/
> trace = trace (D);
>
> /*factor pattern based on the eigenvectors multiplied by the diagonal
> matrix of eigenvalues (pxp) (doesnt match SAS/STAT proc factor although
> U and D match)*/
> lambdau = U * sqrt (D * D);
>
> /*factors chosen to retain (1x1)*/
> c = 4;
>
> /*factor pattern consisting only of the factors retained (pxc) (doesnt
> match, i get values greater than 1)*/
> lambdauc = lambdau[1:p, 1:c];
>
> /*standardized scoring coefficients (pxc) (doesnt match)*/
> B = Sr ** (-1) * lambdauc;
> quit;
>
>
>
>
>
>
.
.
=================================================================
Instructions for joining and leaving this list, remarks about the
problem of INAPPROPRIATE MESSAGES, and archives are available at:
. http://jse.stat.ncsu.edu/ .
=================================================================