Login  Register

Re: random selection from multiple measures

Posted by David Marso on Sep 05, 2014; 11:00am
URL: http://spssx-discussion.165.s1.nabble.com/random-selection-from-multiple-measures-tp5727162p5727164.html

Presuming there is some sensible reason for tossing 84% of the data ;-(
Study this, fill in the <blanks> and ...< be well and prosper or as Dr. Who would quip RUN>!

GET FILE <yourdata> /KEEP <your6vars>.
COMPUTE ID=$CASENUM.
DATASET NAME rawdata.
*------*.

DATASET DECLARE picker.
SET MXLOOPS=200.
MATRIX.
LOOP #=1 TO 100.
SAVE GRADE(UNIFORM(1,6)) /OUTFILE picker/VARIABLES rank1 TO rank6.
END LOOP.
END MATRIX.

DATASET ACTIVATE picker.
COMPUTE ID=$CASENUM.
VARSTOCASES MAKE rank FROM rank1 TO rank6/ INDEX=index.
SELECT IF rank=1.
EXECUTE.

MATCH FILES FILE */FILE rawdata / BY ID.
VECTOR vars=<youristvar TO your6thvar>.
COMPUTE Keep=vars(rank).




tino wrote
Dear All,

I have repeated measures of the same observational units; specifically, for each observational unit, there are 6 measurements.

From these six measurements, I need to randomly select one measurement for each person.

For example, if there were 100 persons measured six times, there would be 600 measurements. From these 600 measurement, I would need 100 measurements, but each person should only be sampled once.

Say "person" is numbered from 1 to 100, and "measurements" is numbered from 1 to 6. Which sytnax could I use to make the kind of selection outlined above? Many thanks for your help!

Tino

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"