## help please.. grouping and percentile

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

bebx
Posts: 1
Joined: Sun Nov 24, 2013 12:54 pm

### help please.. grouping and percentile

Hi all,
2 files is attached, SPSS and image file.
The SPSS file contain "week" column (value repeated) , that I want to group the same week and make mean and percentile of "BPD" column.
The image file contains example based on SPSS made by statistician.
How can I create this table ?
Thanks again
Bian
Untitled1.sav
untitled2222.JPG
You do not have the required permissions to view the files attached to this post.
pythonforspss.org
Posts: 116
Joined: Sat Oct 06, 2012 6:21 am

### Re: help please.. grouping and percentile

The N, mean, median (...) are easily done with basic AGGREGATE (www.spss-tutorials.com/aggregate/). The percentiles are more complicated though. One way to do it is

-Run "split files" on week
-Run an OMS block for capturing the table from "frequencies" as a new dataset
-Run frequencies with "format = notable" and all desired statistics
-Run omsend
-Clean up the resulting dataset
-Run casestovars on it

Honestly, you'll need to master SPSS at a reasonable level in order to pull this off. If it's too much of a challenge, let us know where you get stuck, OK?
Kind regards,

Ruben Geert van den Berg
http://www.spss-tutorials.com
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

### Re: help please.. grouping and percentile

- alternatively, you could also add a case-within-week casenumb using lag.
- then use aggregate(n) to get number of cases within each week (e.g.: cases_n = 20).
- Then determine what case to use for each, so for instance:
compute case_fifthperc = rnd(cases_n/20). (to get fifth percentile).
- then if (casewithinweek = case_fifthperc) fifthpercentile = bpd).

### Who is online

Users browsing this forum: No registered users and 3 guests