SPSS Statistics

 View Only
Expand all | Collapse all

Basic Output Formatting Questions

  • 1.  Basic Output Formatting Questions

    Posted Mon November 29, 2021 11:49 PM
    Hi everyone,

    I've been using SPSS for years by writing raw commands in the syntax editor, and would like to improve my output formatting.  Could anyone help with the questions below?

    For the sample commands below, how do I?

    Q1) Include commas for all N output in Descriptives, Summarize, or Crosstab commands?

    Q2) Format Currency amounts with $, commas, and 2 rounded decimal places?

    I think this command is close, but will truncate instead of rounding.
         PRINT FORMATS FirstVariable TO LastVARIABLE (DOLLAR12.2)
    I want to apply this format to all Min, Max, Mean, and Sum amounts for the three commands above.

    Q3) Is there a better way to produce simpler output statements than our standard syntax below?

    We repeat this same format for around 20 different criteria variations, and never want these statements to permanently transform the data.

    We always pull 3 columns of data
    1) All full-time students
    2) All part-time students.
    3) Full-time Freshman
    We only pull student counts or amounts (Mean or SUM).

    Example syntax:


    *******************************************
    COUNTS
    *******************************************

    TITLE Counts - All Students by Full/Part Time Status.
    SELECT IF (APPLIED EQ 1).
    CROSSTABS TABLES=APPLIED BY FTPT.

    TITLE Counts - Full-time Freshman.
    TEMPORARY.
    SELECT IF (APPLIED EQ 1).
    SELECT IF (GradLevel = 'Freshman').
    SELECT IF (FTPT EQ 'Full-time').
    FREQUENCIES VARIABLES=FTPT.

    **********************************
    AMOUNTS
    **********************************

    *$ All students by Full/Part Time Status.
    TITLE All Students.
    TEMPORARY.
    SELECT IF (APPLIED EQ 1).
    SELECT IF (AidAmounts GT 0).
    SUMMARIZE TABLES= AidAmounts BY FTPT
    /CELLS=MEAN COUNT MIN MAX.


    *$ for full-time Freshman.
    TITLE Freshman Data.
    TEMPORARY.
    SELECT IF (APPLIED EQ 1).
    SELECT IF (GradLevel = 'Freshman').
    SELECT IF (FTPT EQ 'Full-time').
    SUMMARIZE TABLES= AidAmounts
    /CELLS=MEAN COUNT MIN MAX.

    Dave

    ------------------------------
    David Horne
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Basic Output Formatting Questions

    IBM Champion
    Posted Tue November 30, 2021 08:44 AM
    Q1) Include commas for all N output in Descriptives, Summarize, or Crosstab commands?
    >>> There is a setting "Apply locale's digit grouping to numeric values in Edit > Options > General

    Q2) Format Currency amounts with $, commas, and 2 rounded decimal places?
    >>> The custom currencies CCA etc should display rounded values, so variables with those formats should display values and summary statistics using them.  The formats do not affect the underlying values.

    Q3) Is there a better way to produce simpler output statements than our standard syntax below?
    >>> I am not sure what the question is here, but you can put multiple conditions on one SELECT IF statement.

    Note that you can also use OUTPUT MODIFY or the the SPSSINC MODIFY TABLES extension command for more extended formatting changes on output tables.
     

    --