SPSS Statistics

 View Only
  • 1.  Syntax for Using Polychoric Correlations in Exploratory Factor Analysis

    Posted Thu June 02, 2022 10:39 AM
    Hi all, 

    Apologies for two queries in a couple of days! 

    I'm currently trying to use polychoric correlations in an exploratory factor analysis. I followed the advice on the IBM Support page Reading correlation matrix text for factor analysis in SPSS for reading correlation matrix text for factor analysis. 

    As such, I tried coping the code they provided and entering in my own data. However, this did not work - I do have some missing correlations so perhaps this is affecting my results. 

    I then moved to entering the correlation into a data editor file as per the instructions on the support page and running the following code:

    MATRIX DATA VARIABLES = y1 TO y27
    /N= 185
    /CONTENTS = CORR .

    FACTOR

    /MATRIX = IN (COR = *)
    /MISSING LISTWISE
    /PRINT INITIAL EXTRACTION ROTATION repr kmo
    /FORMAT SORT
    /CRITERIA MINEIGEN(1.0) ITERATE(100)
    /EXTRACTION PAF
    /CRITERIA ITERATE(25) DELTA(0)
    /ROTATION varimax
    /METHOD=CORRELATION .

    This also didn't work for me. I've also tried saving the correlation matrix as a text file and running the code below but I never seem to get an output?
     
    MATRIX DATA
    /FILE="/C:\Users\ailbh\OneDrive\Documents\SPSS/matrix.txt"
    /N=185
    /CONTENTS=CORR.
    EXECUTE.

    FACTOR
    /MATRIX = IN(CORR= CORR_MATRIX.txt)
    /PRINT INITIAL EXTRACTION ROTATION
    /FORMAT SORT
    /CRITERIA MINEIGEN(1) ITERATE(250)
    /EXTRACTION= PC
    /CRITERIA ITERATE(250) DELTA(0)
    /ROTATION VARIMAX
    /METHOD=CORRELATION.

    Can anyone tell where I am going wrong here? I have never used syntax properly so I'm a bit lost. 

    Thank you in advance!

    ------------------------------
    Ailbhe Lawlor
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Syntax for Using Polychoric Correlations in Exploratory Factor Analysis

    IBM Champion
    Posted Thu June 02, 2022 11:48 AM
    We can't make progress on this unless you explain what you mean when you say it "didn't work".

    Did you get error messages?  What was the output?


    --





  • 3.  RE: Syntax for Using Polychoric Correlations in Exploratory Factor Analysis

    Posted Thu June 02, 2022 01:26 PM
    Hi Jon, this is the output/error message I get when I run the syntax code.

    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 105
    while reading variable y4
    The field contained '_SLINE'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 105 while reading row type CORR


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value 3. found in record number 105 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 106
    while reading variable y7
    The field contained 'MATRIX'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 106 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 106
    while reading variable y8
    The field contained 'DATA'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value DATA found in record number 106 while reading row type CORR


    >Warning # 16788. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered a numeric datum that
    >exceeded 40 characters in length. The variable will be assigned the
    >system-missing value.
    The error occurred on record number 107
    while reading variable y9
    The field contained '/FILE="/C:\USERS\AILBH\ONEDRIVE\DOCUMENTS\SPSS/MATRIX.TXT"'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value \USERS\AILBH\ONEDRIVE\DOCUMENTS\SPSS/MATRIX.TXT" found in record number 107 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 108
    while reading variable y10
    The field contained '/N=185'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 108 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 109
    while reading variable y11
    The field contained '/CONTENTS=CORR.'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value NTS=CORR. found in record number 109 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 110
    while reading variable y12
    The field contained 'EXECUTE.'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 110 while reading row type CORR


    >Warning # 16782. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered a blank record. The
    >record will be ignored.
    The blank record was number 111


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 112
    while reading variable y13
    The field contained 'FACTOR'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 112 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 113
    while reading variable y14
    The field contained '/MATRIX'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value X found in record number 113 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 113
    while reading variable y15
    The field contained '='


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value = found in record number 113 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 113
    while reading variable y16
    The field contained 'IN(CORR='


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value IN(CORR= found in record number 113 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 113
    while reading variable y17
    The field contained 'CORR_MATRIX.TXT)'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value CORR_MATRIX.TXT) found in record number 113 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 114
    while reading variable y18
    The field contained '/PRINT'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 114 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 114
    while reading variable y19
    The field contained 'INITIAL'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value INITIAL found in record number 114 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 114
    while reading variable y20
    The field contained 'EXTRACTION'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value EXTRACTION found in record number 114 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 114
    while reading variable y21
    The field contained 'ROTATION'


    >Warning # 16815. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data
    >different from 1 and -1 to be assigned to a diagonal element of the
    >correlation matrix. The system-missing value will be assigned.
    Wrong value ROTATION found in record number 114 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 115
    while reading variable y1
    The field contained '/FORMAT'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value /FORMAT found in record number 115 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 115
    while reading variable y2
    The field contained 'SORT'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value SORT found in record number 115 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 116
    while reading variable y3
    The field contained '/CRITERIA'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 116 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 116
    while reading variable y4
    The field contained 'MINEIGEN(1)'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value MINEIGEN(1) found in record number 116 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 116
    while reading variable y5
    The field contained 'ITERATE(250)'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value ITERATE(250) found in record number 116 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 117
    while reading variable y6
    The field contained '/EXTRACTION='


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 117 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 117
    while reading variable y7
    The field contained 'PC'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value PC found in record number 117 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 118
    while reading variable y8
    The field contained '/CRITERIA'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 118 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 118
    while reading variable y9
    The field contained 'ITERATE(250)'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value ITERATE(250) found in record number 118 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 118
    while reading variable y10
    The field contained 'DELTA(0)'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value DELTA(0) found in record number 118 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 119
    while reading variable y11
    The field contained '/ROTATION'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 119 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 119
    while reading variable y12
    The field contained 'VARIMAX'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value VARIMAX found in record number 119 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 120
    while reading variable y13
    The field contained '/METHOD=CORRELATION.'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value ON. found in record number 120 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 121
    while reading variable y14
    The field contained '_SLINE'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value found in record number 121 while reading row type CORR


    >Warning # 1102. Command name: MATRIX DATA
    >An invalid numeric field has been found. The result has been set to the
    >system-missing value.
    The error occurred on record number 121
    while reading variable y15
    The field contained 'OFF.'


    >Warning # 16812. Command name: MATRIX DATA
    >In reading the data, the MATRIX DATA command encountered numeric data with an
    >absolute value greater than 1 to be assigned to an element of the correlation
    >matrix. The system-missing value will be assigned.
    Wrong value OFF. found in record number 121 while reading row type CORR

    ------------------------------
    Ailbhe Lawlor
    ------------------------------



  • 4.  RE: Syntax for Using Polychoric Correlations in Exploratory Factor Analysis

    Posted Thu June 02, 2022 01:29 PM
    OK, thanks.

    It would be better to see the syntax you used; that would explain the errors. It looks like a problem with the MATRIX DATA syntax.

    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 5.  RE: Syntax for Using Polychoric Correlations in Exploratory Factor Analysis

    Posted Thu June 02, 2022 02:24 PM
    Hi Rick, 

    This is the syntax I used that gave me those errors: 

     
    MATRIX DATA
    /FILE="/C:\Users\ailbh\OneDrive\Documents\SPSS/matrix.txt"
    /N=185
    /CONTENTS=CORR.
    EXECUTE.

    FACTOR
    /MATRIX = IN(CORR= CORR_MATRIX.txt)
    /PRINT INITIAL EXTRACTION ROTATION
    /FORMAT SORT
    /CRITERIA MINEIGEN(1) ITERATE(250)
    /EXTRACTION= PC
    /CRITERIA ITERATE(250) DELTA(0)
    /ROTATION VARIMAX
    /METHOD=CORRELATION.

    ------------------------------
    Ailbhe Lawlor
    ------------------------------



  • 6.  RE: Syntax for Using Polychoric Correlations in Exploratory Factor Analysis

    Posted Thu June 02, 2022 02:57 PM
    Let's try:

    MATRIX DATA
     /FILE="C:\Users\ailbh\OneDrive\Documents\SPSS\matrix.txt"
     /N=185
     /CONTENTS=CORR.
    EXECUTE.
    
    FACTOR
     /MATRIX = IN(CORR=*)
     /PRINT INITIAL EXTRACTION ROTATION
     /FORMAT SORT
     /CRITERIA MINEIGEN(1) ITERATE(250)
     /EXTRACTION= PC
     /CRITERIA ITERATE(250) DELTA(0)
     /ROTATION VARIMAX
     /METHOD=CORRELATION.​


    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 7.  RE: Syntax for Using Polychoric Correlations in Exploratory Factor Analysis

    IBM Champion
    Posted Thu June 02, 2022 03:07 PM
    The errors suggest a problem in creating the MATRIX DATA file, so I would concentrate on that.

    --





  • 8.  RE: Syntax for Using Polychoric Correlations in Exploratory Factor Analysis

    Posted Thu June 02, 2022 05:13 PM
    Hi Rick, 

    I think I'm almost there to getting this solved! I got this message on my output after running your suggested code:

    >Error # 16716. Command name: MATRIX DATA
    >The MATRIX DATA command does not include a VARIABLES subcommand. This
    >subcommand is required.
    >Execution of this command stops.


    For the warning message - perhaps there is a way to edit the correlation matrix and add a rowtype_ variable to the correlation matrix?

    ------------------------------
    Ailbhe Lawlor
    ------------------------------



  • 9.  RE: Syntax for Using Polychoric Correlations in Exploratory Factor Analysis

    Posted Thu June 02, 2022 06:05 PM
    Edited by System Fri January 20, 2023 04:17 PM
    Yes, I'm sorry I missed that. The syntax of course requires you to provide variable names. I can't know that on my side. You have to know how many variables you have and give them names.

    MATRIX DATA VARIABLES=<varlist>
     /FILE="C:\Users\ailbh\OneDrive\Documents\SPSS\matrix.txt"
     /N=185
     /CONTENTS=CORR.
    EXECUTE.
    
    FACTOR /MATRIX = IN(CORR=*)
     /PRINT INITIAL EXTRACTION ROTATION
     /FORMAT SORT
     /CRITERIA MINEIGEN(1) ITERATE(250)
     /EXTRACTION= PC
     /CRITERIA ITERATE(250) DELTA(0)
     /ROTATION VARIMAX
     /METHOD=CORRELATION.​​


    Say you have 10 variables. If you don't need descriptive variable names, you could say:

    MATRIX DATA VARIABLES=VAR1 TO VAR10
     /FILE=etc.


    Note that FACTOR does not need the names; the matrix file will tell it everything it needs to know.



    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------