Inputting ASCII Correlation Matrix to Factor Analysis

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Inputting ASCII Correlation Matrix to Factor Analysis

Edgar F. Johns
Dear Group:



I have a correlation matrix that was published in a test manual. I want to
input the matrix to run factor analysis.



Is there a routine available that will take as input the excel file
containing the lower half of the correlation matrix and set it up for matrix
input into the factor routine?



Thanks,

Edgar

---

Discover Technologies

42020 Koppernick Rd.

Suite 204

Canton, MI 48187

(734) 564-4964

(734) 468-0800 fax
Reply | Threaded
Open this post in threaded view
|

Re: Inputting ASCII Correlation Matrix to Factor Analysis

Richard Ristow
At 11:20 AM 6/22/2007, Edgar F. Johns wrote:

>I have a correlation matrix that was published in a test manual. I
>want to input the matrix to run factor analysis.
>
>Is there a routine available that will take as input the excel file
>containing the lower half of the correlation matrix and set it up for
>matrix input into the factor routine?

SPSS matrix data files are regular SPSS data files, with special
constraints on their structure of variables and cases. SPSS correlation
matrix files (there are other matrix files, including factor-loading
matrices) are described with command CORRELATIONS about as well as they
are anywhere.

(Richard Oliver: This is why I'm copying to you. Would it make sense to
describe matrix file formats under 'file types' in Universals, rather
than again and again with every command that uses them?)

Once you've read your data from Excel, it shouldn't be too hard to
write SPSS code to create a data file in correlation-matrix form. I
don't know whether FACTOR will work without the rows giving the Ns and
descriptive statistics.

Here's an illustration of a a correlation matrix (SPSS 15 draft output
- WRR:not saved separately):

|-----------------------------|---------------------------|
|Output Created               |22-JUN-2007 15:22:45       |
|-----------------------------|---------------------------|
CASENUM VALUE_A VALUE_B VALUE_C

     1      5.76    5.48    3.66
     2      3.24    9.64    5.80
     3      4.18    3.36    5.05
     4      6.83    8.16    4.30
     5      3.33    5.27    4.34
     6      4.87    3.53    4.11
     7      5.07    6.27    3.26
     8      4.80    5.89    5.02
     9      4.86    7.37    6.96
    10      5.59    1.26    1.99

Number of cases read:  10    Number of cases listed:  10


DATASET DECLARE CorrMtrx.


CORRELATIONS
    VARIABLES=VALUE_A TO VALUE_C
   /MATRIX   =OUT('CorrMtrx').


Correlations
|-----------------------------|---------------------------|
|Output Created               |22-JUN-2007 15:22:45       |
|-----------------------------|---------------------------|
Correlations
|-------|---------------|-------|-------|-------|
|       |               |VALUE_A|VALUE_B|VALUE_C|
|-------|---------------|-------|-------|-------|
|VALUE_A|Pearson        |1      |-.109  |-.409  |
|       |Correlation    |       |       |       |
|       |Sig. (2-tailed)|       |.764   |.240   |
|       |N              |10     |10     |10     |
|-------|---------------|-------|-------|-------|
|VALUE_B|Pearson        |-.109  |1      |.623   |
|       |Correlation    |       |       |       |
|       |Sig. (2-tailed)|.764   |       |.054   |
|       |N              |10     |10     |10     |
|-------|---------------|-------|-------|-------|
|VALUE_C|Pearson        |-.409  |.623   |1      |
|       |Correlation    |       |       |       |
|       |---------------|-------|-------|-------|
|       |Sig. (2-tailed)|.240   |.054   |       |
|       |---------------|-------|-------|-------|
|       |N              |10     |10     |10     |
|-------|---------------|-------|-------|-------|


DATASET ACTIVATE CorrMtrx.
LIST.

List
|-----------------------------|---------------------------|
|Output Created               |22-JUN-2007 15:22:45       |
|-----------------------------|---------------------------|
[CorrMtrx]

ROWTYPE_ VARNAME_    VALUE_A    VALUE_B    VALUE_C

MEAN               4.8526147  5.6228953  4.4493840
STDDEV             1.0916177  2.4683583  1.3758708
N        VALUE_A  10.0000000 10.0000000 10.0000000
N        VALUE_B  10.0000000 10.0000000 10.0000000
N        VALUE_C  10.0000000 10.0000000 10.0000000
CORR     VALUE_A   1.0000000  -.1089691  -.4092322
CORR     VALUE_B   -.1089691  1.0000000   .6227226
CORR     VALUE_C   -.4092322   .6227226  1.0000000


Number of cases read:  8    Number of cases listed:  8
===================
APPENDIX: Test data
===================
INPUT PROGRAM.
.  NUMERIC CASENUM (F3).
.  NUMERIC VALUE_A VALUE_B VALUE_C (F6.2).
.  LOOP    CASENUM = 1 TO 10.
.     VECTOR DATA=VALUE_A TO VALUE_C.
.     LOOP  #DATAIDX = 1 TO 3.
.        COMPUTE DATA(#DATAIDX) = RV.NORMAL(5,2).
.     END LOOP.
.     END CASE.
.  END LOOP.
END FILE.
END INPUT PROGRAM.
LIST.
Reply | Threaded
Open this post in threaded view
|

Re: Inputting ASCII Correlation Matrix to Factor Analysis

Richard Ristow
In reply to this post by Edgar F. Johns
Addendum:

At 11:20 AM 6/22/2007, Edgar F. Johns wrote:

>I have a correlation matrix that was published in a test manual. I
>want to input the matrix to run factor analysis.

There was a detailed discussion of this, including excellent advice
from Marta Garcia-Granero, in recent thread "Importing Correlation
Matrix for Factor Analysis", Mon, 18 Jun 2007 <12:55:48 -0400> and
following.
Reply | Threaded
Open this post in threaded view
|

Re: Inputting ASCII Correlation Matrix to Factor Analysis

Edgar F. Johns
Thanks - I got it to work. I appreciate your pointing me in the right
direction.

Edgar
---
Discover Technologies
42020 Koppernick Rd.
Suite 204
Canton, MI 48187
(734) 564-4964
(734) 468-0800 fax
-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Richard Ristow
Sent: Friday, June 22, 2007 6:04 PM
To: [hidden email]
Subject: Re: Inputting ASCII Correlation Matrix to Factor Analysis

Addendum:

At 11:20 AM 6/22/2007, Edgar F. Johns wrote:

>I have a correlation matrix that was published in a test manual. I
>want to input the matrix to run factor analysis.

There was a detailed discussion of this, including excellent advice
from Marta Garcia-Granero, in recent thread "Importing Correlation
Matrix for Factor Analysis", Mon, 18 Jun 2007 <12:55:48 -0400> and
following.