LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2009)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 21 Dec 2009 12:32:48 -0800
Reply-To:   Bruce Weaver <>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Bruce Weaver <>
Subject:   Re: Five highest scores
In-Reply-To:   <>
Content-Type:   text/plain; charset=us-ascii

Paul Jeffries-2 wrote: > > Dear list, > > I have seven scores for each subject. Scores can range from zero to 1. I > want to take the average of the five highest scores for each subject. So > I do I get SPSS to drop the two lowest scores for each subject and average > the remaining scores. > > Any help is appreciated, > Paul W. Jeffries > >

Here's one way.

* Restructure from one row per person to 7 rows per person .

VARSTOCASES /MAKE x FROM x1 x2 x3 x4 x5 x6 x7 /INDEX=index(7) /KEEP=id /NULL=KEEP.

* Rank the scores within ID .


* Drop the lowest two ranks .

select if (Rx GT 2). exe.

* Compute the mean of the highest 5 scores .

aggregate outfile = * / break = ID / mean_5_hi = mean(x).

----- -- Bruce Weaver "When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- View this message in context: Sent from the SPSSX Discussion mailing list archive at

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

Back to: Top of message | Previous page | Main SPSSX-L page