SPSS Statistics

 View Only
  • 1.  Match file - tables subcommand

    Posted Mon July 26, 2021 01:00 PM
    Dear community,
    I'm tring to perform a bootstrap factor analysis using a spss syntax downloaded from a paper but I continue receive a warning message at this point:

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

    set printback=none workspace=40000.

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

    COMMENT Resample with Replacement.


    input program.

    loop #i=1 to  
    139
       .

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

    end case.

    end loop.

    end file.

    end input program. 

    sort cases by seqnum.

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

    execute.

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

    WARNING MESSAGE: 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.

    I have changed 'tables' with 'table' but keep receiving the same warning message..I've checked my input data but everything seems ok so I don't know what is the problem given that I copied the syntax from a published paper, which it should be correct.
    Any suggestion is greatly appreciated.

    Thank you

    Alessandra



    ------------------------------
    Alessandra Monni
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Match file - tables subcommand

    Posted Mon July 26, 2021 02:10 PM
    So far, I have tried this:

    *Test dataset.
    dataset close all.

    new file.
    input program.
    vector v(5).
    loop #i=1 to 139.
    loop #j=1 to 5.
    compute v(#j)=rv.normal(0,1).
    end loop.
    compute seqnum=$casenum.
    end case.
    end loop.
    end file.
    end input program.
    execute.
    dataset name Test1.

    preserve.
    set mxloop=50000 results=none highres=off cache 100000 compression=on mprint=off
    printback=none workspace=40000.
    * Resample with Replacement.
    input program.
    loop #i=1 to 139.
    compute seqnum=trunc(uniform(139))+1.
    end case.
    end loop.
    end file.
    end input program.
    sort cases by seqnum.
    match files file=* /table Test1 /by seqnum.
    execute.
    restore.

    and do not see any errors or warnings. I have not been able to force that error (yet). The original dataset you're using - how many cases, variables?

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



  • 3.  RE: Match file - tables subcommand

    Posted Mon August 02, 2021 01:54 AM
    Thank you for your response Dr Marcantonio,
    I have tried your syntax and no errors occurred..
    Then it's a problem with my dataset..I have 85 variables and 139 cases
    all numeric type; width= 5, decimals=3; values none, missing none, columns 10,measure=scales and role = input

    to be precise to run the bootstrap analysis I have two syntax concatenated
    The syntax 1:

    COMMENT Be sure to save the Program II to the correct drive.
    COMMENT Following algorithm concatenating bootstrap results contributed by Raynald Levesque.
     
    *//////////////////.

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

    !DO !cnt=1 !TO !nb

    INCLUDE 'c:\BFA_2.sps'. ****calls the 2nd syntax

    !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.

    *//////////////////. 

    *The following macro call will do nb number of resampling.

    SET MPRINT=yes.
    !boot nb=
    1000.
    SET MPRINT=no.
    SET MPRINT=yes.!boot nb=1000 .SET MPRINT=no.

    which calls the syntax2 - (INCLUDE 'c:\BFA_2.sps') 
    - the one I wrote in the first post - then it occurred the Error # 5126
    >The BY variable list is invalid...etc etc
    What do you suggest I could do?

    Thank you very much for your help

    Alessandra

    ------------------------------
    Alessandra Monni
    ------------------------------