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 .
RANK VARIABLES=x (A) BY id
/RANK
/PRINT=YES
/TIES=MEAN.
* 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
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/"When all else fails, RTFM."
PLEASE NOTE THE FOLLOWING:
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (
https://listserv.uga.edu/).