SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  Help with bootstrap factor analysis - spss syntax

    Posted Mon July 26, 2021 03:16 PM

    Hi all,

    I have tried to run a bootstrapping for factor analysis applying a syntax but I keep receiving the error message at this point:

    *//////////////////---------------------------------------------------

    DEFINE !boot (nb=!TOKENS(1))

    !DO !cnt=1 !TO !nb

    INCLUDE 'c:\BFA_2.sps'.

    !IF (!cnt=1) !THEN

    GET FILE='C:\brotorig.SAV'.

    !ELSE

    ADD FILES FILE='c:\Tbrotorig.SAV'

    /FILE='C:\brotorig.SAV'.

    !IFEND

    SAVE OUTFILE='c:\Tbrotorig.SAV'.

    !IF (!cnt=1) !THEN

    GET FILE='C:\eigenvorig.SAV'.

    !ELSE

    ADD FILES FILE='c:\Teigenvorig.SAV'

    /FILE='C:\eigenvorig.SAV'.

    !IFEND

    SAVE OUTFILE='c:\Teigenvorig.SAV'.

    !DOEND

    !ENDDEFINE.

    *//////////////////-------------------------------------

    which calls another syntax:

    *//////////////////----------------------------------------

    set mxloop=50000 results=none highres=off cache 100000 compression = on mprint=off .

    set printback=none workspace=40000.

    get file='c:\holz.sav'.

    COMMENT Resample with Replacement.

    input program.

    loop #i=1 to 301 .

    compute seqnum=trunc(uniform( 301 ))+1.

    end case.

    end loop.

    end file.

    end input program.

    sort cases by seqnum.

    match files file=* /tables='c:\holz.sav'/by seqnum.

    execute.

    save outfile='c:\fact.sav'.

    *//////////////////-----------------------------------------

    at this point (match files file=* /tables='c:\holz.sav'/by seqnum.) it appears the following message:

    The BY variable list is invalid. All the variables on the list must exist on all the input files.....etc etc

    Any suggestion on how solve the problem?

    Thank you






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Help with bootstrap factor analysis - spss syntax

    Posted Mon July 26, 2021 03:31 PM

    There is a lot of syntax here to wade through. Add a SET MPRINT ON. at the start, and you will see the actual code run after the macro expansion. That might help to spot the problem.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: Help with bootstrap factor analysis - spss syntax

    Posted Mon July 26, 2021 03:47 PM

    Thank you for your response, the error appears after this:

    "sort cases by seqnum.

    match files file=* /tables='c:\holz.sav'/by seqnum.

    execute."

    >Error # 5126

    >The BY variable list is invalid. All the variables on the list must exist on all the input files and each variable must be of the same type (numeric, or strings of the same length) on all the input files.

    Execution of this command stops.

    The variable are of the same type so I don't know what to do..






    #SPSSStatistics
    #Support
    #SupportMigration