Search code examples
spssstat

Change PTILE algorithm in SPSS


Using SPSS 22 and in the documentation it lists several types of percentile calculations:

HPTILE
WPTILE
RPTILE
EPTILE
APTILE

From what I gather the default is APTILE. I would like to change it to HPTILE. The thing is it doesn't really say where to change it in SPSS syntax.

So in the syntax, I have:

CTABLES
/TABLES
...
[VALIDN F40.0,ptile 5, ptile 10, ptile 15, ptile 20 PTILE 25, ptile 30, ptile 35
ptile 40, ptile 45, MEDIAN, MEAN, ptile 55, ptile 60, PTILE 65, ptile 70, PTILE 75, ptile 80, ptile 85, PTILE 90, PTILE 95]

I was hoping it would be as simple as changing PTILE to HPTILE, but it results in an TABLE: Text hptile. An invalid subcommand, keyword, or option was specified.

How can I change the percentile algorithm used?


Solution

  • Well, I managed to get help in the IBM forums. Turns out none of SPSS percentile algorithms match the algorithms used in Excel (percentile.inc) and most databases that have native percentile functions (percentile_cont).

    At any rate, this was what worked:

    EXAMINE VARIABLES = Item Sales BY Item
    /PERCENTILES(10, 25, 50, 65, 75, 90) = [WAVERAGE]
                                           [HAVERAGE]
                                           [ROUND]
                                           [EMPIRICAL]
                                           [AEMPIRICAL]