SPSS Statistics

 View Only
  • 1.  table output to excel, all is character instead of numeric

    Posted Fri April 01, 2022 06:35 AM
    I recently started running tables with significance (see syntax).


    DEFINE singresp (!POS !CHAREND('/')).
    !DO !i !IN ( !1).
    CTABLES
    /VLABELS VARIABLES=ALL DISPLAY=DEFAULT
    /TABLE !i [C] BY totaal2 [C][COUNT 'Abs' F40.0, COLPCT.COUNT '%' PCT40.1]
    + totaal [C][COUNT 'Abs' F40.0, COLPCT.COUNT '%' PCT40.1]
    + segment [C][COUNT 'Abs' F40.0, COLPCT.COUNT '%' PCT40.1]
    /SLABELS POSITION=ROW
    /CATEGORIES VARIABLES=!i ORDER=A KEY=VALUE EMPTY=EXCLUDE TOTAL=YES POSITION=AFTER MISSING=EXCLUDE
    /CATEGORIES VARIABLES=totaal2 totaal segment
    ORDER=A KEY=VALUE EMPTY=INCLUDE
    /CRITERIA CILEVEL=95
    /COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=BONFERRONI ORIGIN=COLUMN INCLUDEMRSETS=YES
    CATEGORIES=ALLVISIBLE MERGE=YES STYLE=SIMPLE SHOWSIG=NO
    /TITLES
    TITLE="4775 "
    CAPTION='2022'.
    !DOEND.
    !ENDDEFINE.


    But when I export the table output to excel, the numerical values are written as a text field.

    excel


    So I can't make any calculations with it in Excel now.
    Now I have already converted the textfileds in excel to numeric, but then (in the green marked cell for example) it turns 901 to 901.
    Anyone have a solution for this?


    ------------------------------
    Michel de Graaf
    ------------------------------

    #SPSSStatistics


  • 2.  RE: table output to excel, all is character instead of numeric

    Posted Fri April 01, 2022 07:23 AM
      |   view attached
    I added an example of the excel output.

    And this is the syntax I use.


    * Export Output.
    OUTPUT EXPORT
    /CONTENTS EXPORT=ALL LAYERS=PRINTSETTING MODELVIEWS=PRINTSETTING
    /XLSX DOCUMENTFILE='D:\Projecten SPSS\4775\TB-4775.xlsx'
    OPERATION=CREATEFILE
    LOCATION=LASTCOLUMN NOTESCAPTIONS=YES.

    ------------------------------
    Michel de Graaf
    ------------------------------

    Attachment(s)

    xlsx
    example.xlsx   12 KB 1 version


  • 3.  RE: table output to excel, all is character instead of numeric

    Posted Fri April 01, 2022 08:38 AM
    Since the cells would have nonnumeric values when there is a marker, you would need to create the table using the option of putting statistics in a separate table.

    --





  • 4.  RE: table output to excel, all is character instead of numeric

    Posted Fri April 01, 2022 10:10 AM
    Thank you. 

    I was hoping this could be in one table. Unfortunately this is not possible I understand.

    ------------------------------
    Michel de Graaf
    ------------------------------



  • 5.  RE: table output to excel, all is character instead of numeric

    Posted Fri April 01, 2022 11:41 AM
    It would be possible to automate removing the alphabetical sig markers before exporting, but that would just leave you with the table as if you had specified a second table for the sig results.

    --